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: Fix issues with update #2940

Merged
merged 1 commit into from
Jan 16, 2018

Conversation

julienduchesne
Copy link
Contributor

  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.

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.
@julienduchesne
Copy link
Contributor Author

Fixes #2303

@jen20 jen20 added bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service. labels Jan 11, 2018
@bflad bflad added this to the v1.7.1 milestone Jan 16, 2018
@bflad bflad self-requested a review January 16, 2018 13:24
@bflad
Copy link
Contributor

bflad commented Jan 16, 2018

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

@radeksimko radeksimko changed the title Fix issues with IAM user update resource/aws_iam_user: Fix issues with update 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 6645072 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. FYI I added an additional acceptance test TestAccAWSUser_pathChange to ensure we are successfully updating the user's path.

@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
@julienduchesne julienduchesne deleted the fix-iam-user-update-main branch June 24, 2018 21:38
@ghost
Copy link

ghost commented Apr 5, 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 5, 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