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: Retry user login profile deletion on EntityTemporarilyUnmodifiable #4143

Merged

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Apr 10, 2018

Fix for flakey tests:

=== RUN   TestAccAWSUserLoginProfile_basic
--- FAIL: TestAccAWSUserLoginProfile_basic (18.43s)
    testing.go:518: Step 0 error: Check failed: Check 2/2 error: Error changing decrypted password: EntityTemporarilyUnmodifiable: Login Profile for User test-user-4147537163883902538 cannot be modified while login profile is being created.
            status code: 409, request id: f8bd8d09-3c8c-11e8-bc50-d37153ae8ac5

=== RUN   TestAccAWSUserLoginProfile_keybase
--- FAIL: TestAccAWSUserLoginProfile_keybase (11.70s)
    testing.go:579: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.
        
        Error: Error applying: 1 error(s) occurred:
        
        * aws_iam_user.user (destroy): 1 error(s) occurred:
        
        * aws_iam_user.user: Error deleting Account Login Profile: EntityTemporarilyUnmodifiable: Login Profile for User test-user-6024721623225702403 cannot be modified while login profile is being created.
            status code: 409, request id: b845803c-3cc0-11e8-81f2-395966b82e3f

=== RUN   TestAccAWSUserLoginProfile_PasswordLength
--- FAIL: TestAccAWSUserLoginProfile_PasswordLength (11.42s)
    testing.go:579: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.
        
        Error: Error applying: 1 error(s) occurred:
        
        * aws_iam_user.user (destroy): 1 error(s) occurred:
        
        * aws_iam_user.user: Error deleting Account Login Profile: EntityTemporarilyUnmodifiable: Login Profile for User test-user-9159356937389943695 cannot be modified while login profile is being created.
            status code: 409, request id: b81ac762-3cc0-11e8-b6b6-17d7b8ab932d
12 tests passed (all tests)
=== RUN   TestAccAWSUser_importBasic
--- PASS: TestAccAWSUser_importBasic (10.51s)
=== RUN   TestAccAWSUserLoginProfile_notAKey
--- PASS: TestAccAWSUserLoginProfile_notAKey (11.99s)
=== RUN   TestAccAWSUserLoginProfile_keybaseDoesntExist
--- PASS: TestAccAWSUserLoginProfile_keybaseDoesntExist (12.21s)
=== RUN   TestAccAWSUserSSHKey_basic
--- PASS: TestAccAWSUserSSHKey_basic (13.94s)
=== RUN   TestAccAWSUserLoginProfile_PasswordLength
--- PASS: TestAccAWSUserLoginProfile_PasswordLength (15.49s)
=== RUN   TestAccAWSUser_nameChange
--- PASS: TestAccAWSUser_nameChange (16.97s)
=== RUN   TestAccAWSUserLoginProfile_keybase
--- PASS: TestAccAWSUserLoginProfile_keybase (17.95s)
=== RUN   TestAccAWSUser_basic
--- PASS: TestAccAWSUser_basic (18.08s)
=== RUN   TestAccAWSUser_pathChange
--- PASS: TestAccAWSUser_pathChange (19.61s)
=== RUN   TestAccAWSUserSSHKey_pemEncoding
--- PASS: TestAccAWSUserSSHKey_pemEncoding (21.14s)
=== RUN   TestAccAWSUserLoginProfile_basic
--- PASS: TestAccAWSUserLoginProfile_basic (24.14s)
=== RUN   TestAccAWSUserPolicyAttachment_basic
--- PASS: TestAccAWSUserPolicyAttachment_basic (25.30s)

@bflad bflad added bug Addresses a defect in current functionality. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/iam Issues and PRs that pertain to the iam service. labels Apr 10, 2018
@bflad bflad added this to the v1.14.1 milestone Apr 10, 2018
@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Apr 10, 2018
@bflad bflad requested a review from a team April 10, 2018 16:28
Copy link
Contributor

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from one comment, LGTM 👍

// EntityTemporarilyUnmodifiable: Login Profile for User XXX cannot be modified while login profile is being created.
if isAWSErr(err, iam.ErrCodeEntityTemporarilyUnmodifiableException, "") {
return resource.RetryableError(err)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if its required, but there is no return resource.NonRetryableError() so any error that is not iam.ErrCodeEntityTemporarilyUnmodifiableException will return a nil unlike in the resource_aws_iam_user_login_profile_test.go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch, we definitely want that in there. Thanks and updated! 👍

@ghost ghost added the size/S Managed by automation to categorize the size of a PR. label Apr 11, 2018
@bflad bflad merged commit b2d4a2b into master Apr 11, 2018
@bflad bflad deleted the t-aws_iam_user_login_profile-EntityTemporarilyUnmodifiable branch April 11, 2018 16:56
bflad added a commit that referenced this pull request Apr 11, 2018
@bflad
Copy link
Contributor Author

bflad commented Apr 11, 2018

This has been released in version 1.14.1 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@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. size/S Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants