-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifying AWS IAM user name deletes state #2303
Comments
It looks like The example above updates the name field, but then when the user is re-read the "id" no longer exists because the name was changed, and the resource is deleted from the state. |
There is an attribute as |
Hello, everyone! There are currently 3 open PRs for this issue:
I believe for longterm maintainability we may want to switch the
Given the above, I think we'll prefer to bring in the "quick" fixes of #2940 and #2979 for our bugfix v1.7.1 release coming out shortly (hopefully this week), and leave the longer #2798 change to potentially a later release. Please leave any feedback or reach out with any questions. I'll be commenting in each of the existing PRs. |
FYI the first round of "quick" fixes has been released in terraform-provider-aws version 1.7.1. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
excellent, thank you ! 👍 |
@ebarault make sense since they were written similarly. Its certainly doable to do the "easy" part we implemented here and call |
While the Given the broad scope of deployment of these resources, it is unlikely we will change their resource ID, even in a future major version release, so closing this issue out. For further bug reports with IAM resources, please create a new GitHub issue, thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This issue was originally opened by @alvin-huang as hashicorp/terraform#16646. It was migrated here as a result of the provider split. The original body of the issue is below.
Terraform Version
v0.10.8
Terraform Configuration Files
main.tf
createuser.tfvars
modifyuser.tfvars
Expected Behavior
The
createuser
AWS user should be renamed tomodifyuser
and the state file should reflect this change.Debug
https://gist.github.com/alvin-huang/e07b5e15b5837401b811db1acff84435
Actual Behavior
The AWS user does get renamed but the terraform state file is empty.
Steps to Reproduce
terraform init
terraform apply -var-file=createuser.tfvars
to create thecreateuser
userterraform show
to showcreateuser
is in created and in the state fileterraform apply -var-file=modifyuser.tfvars
to change the name ofcreateuser
tomodifyuser
terraform show
shows an empty state fileImportant Factoids
I see the same issue with a local state file and remote backend (S3).
References
#213
hashicorp/terraform#3227
If this should go in https://github.com/terraform-providers/terraform-provider-aws let me know and I can move it over there or hashibot will take care of it :)
The text was updated successfully, but these errors were encountered: