-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
resource/aws_iam_user: Name change requires id to be reset #2979
Conversation
Ahh in my search I didn't see the other PRs. Just let me know and I'll be happy to close this in preference of one of the others. |
@kl4w no worries and thanks for the work here! I will likely be pulling in both pull requests and testing them together since yours has an additional acceptance test. One piece we're hoping to add here as well is the following code in the resource definition to allow other downstream resources to see the ID change and not require a second plan/apply (untested): CustomizeDiff: func(diff *schema.ResourceDiff, v interface{}) error {
if diff.HasChange("name") || diff.HasChange("path") {
return diff.SetNewComputed("id")
}
return nil
} More soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
make testacc TEST=./aws TESTARGS='-run=TestAccAWSUser_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -run=TestAccAWSUser_ -timeout 120m
=== RUN TestAccAWSUser_importBasic
--- PASS: TestAccAWSUser_importBasic (10.03s)
=== RUN TestAccAWSUser_basic
--- PASS: TestAccAWSUser_basic (12.65s)
=== RUN TestAccAWSUser_nameChange
--- PASS: TestAccAWSUser_nameChange (15.12s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 37.845s
This is merged into master and will be released with v1.7.1, hopefully later this week. |
This 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. |
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! |
addresses #2949
Ran into this the other day. Changing name on a user does not result in new entry in state after update. The Id is required to be reset after update.