Skip to content
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

Merged
merged 1 commit into from
Jan 16, 2018

Conversation

kl4w
Copy link
Contributor

@kl4w kl4w commented Jan 12, 2018

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.

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 (22.50s)
=== RUN   TestAccAWSUser_basic
--- PASS: TestAccAWSUser_basic (32.59s)
=== RUN   TestAccAWSUser_nameChange
--- PASS: TestAccAWSUser_nameChange (29.65s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	84.776s

@Ninir Ninir added bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service. labels Jan 15, 2018
@bflad
Copy link
Contributor

bflad commented Jan 16, 2018

This also relates to #2303, which we're using for consolidated discussion of the underlying issue (I closed the duplicate #2949). There are currently 3 open PRs for this issue and I'll write up full responses to each as necessary.

Other PRs:

@bflad bflad added this to the v1.7.1 milestone Jan 16, 2018
@bflad bflad self-requested a review January 16, 2018 13:24
@kl4w
Copy link
Contributor Author

kl4w commented Jan 16, 2018

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.

@bflad
Copy link
Contributor

bflad commented Jan 16, 2018

@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!

@radeksimko radeksimko changed the title r/iam_user: name change requires id to be reset resource/aws_iam_user: Name change requires id to be reset Jan 16, 2018
Copy link
Contributor

@bflad bflad left a 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

@bflad bflad merged commit f2a525b into hashicorp:master Jan 16, 2018
bflad added a commit that referenced this pull request Jan 16, 2018
@bflad
Copy link
Contributor

bflad commented Jan 16, 2018

This is merged into master and will be released with v1.7.1, hopefully later this week.

@bflad
Copy link
Contributor

bflad commented Jan 22, 2018

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.

drewsonne pushed a commit to drewsonne/terraform-provider-aws that referenced this pull request Mar 3, 2018
@kl4w kl4w deleted the iam_user_name_change branch April 20, 2018 13:57
@ghost
Copy link

ghost commented Apr 6, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants