-
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: Fix issues with update #2940
resource/aws_iam_user: Fix issues with update #2940
Conversation
julienduchesne
commented
Jan 11, 2018
- Path can be updated without creating a new user
- When updating a user's name, the Read query fetched the user with the old name, resulting in a 404.
1. Path can be updated without creating a new user 2. When updating a user's name, the Read query fetched the user with the old name, resulting in a 404.
Fixes #2303 |
@julienduchesne thanks so much for the pull request here! I will likely be pulling this in together with #2979 since it contains 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. FYI I added an additional acceptance test TestAccAWSUser_pathChange to ensure we are successfully updating the user's path. |
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! |