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

service/iam: Handle read-after-create eventual consistency in IAM User resources #18458

Merged
merged 3 commits into from
Apr 2, 2021

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Mar 29, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Reference: #16796

Output from acceptance testing in AWS Commercial:

--- PASS: TestAccAWSIAMUserPolicy_basic (38.41s)
--- PASS: TestAccAWSIAMUserPolicy_disappears (23.13s)
--- PASS: TestAccAWSIAMUserPolicy_generatedName (40.70s)
--- PASS: TestAccAWSIAMUserPolicy_multiplePolicies (48.72s)
--- PASS: TestAccAWSIAMUserPolicy_namePrefix (41.87s)

--- PASS: TestAccAWSUser_basic (36.07s)
--- PASS: TestAccAWSUser_disappears (20.47s)
--- PASS: TestAccAWSUser_ForceDestroy_AccessKey (27.25s)
--- PASS: TestAccAWSUser_ForceDestroy_LoginProfile (43.02s)
--- PASS: TestAccAWSUser_ForceDestroy_MFADevice (24.70s)
--- PASS: TestAccAWSUser_ForceDestroy_SigningCertificate (27.38s)
--- PASS: TestAccAWSUser_ForceDestroy_SSHKey (26.60s)
--- PASS: TestAccAWSUser_nameChange (27.75s)
--- PASS: TestAccAWSUser_pathChange (31.26s)
--- PASS: TestAccAWSUser_permissionsBoundary (70.82s)
--- PASS: TestAccAWSUser_tags (36.07s)

--- PASS: TestAccAWSUserGroupMembership_basic (81.80s)

--- PASS: TestAccAWSUserLoginProfile_basic (32.17s)
--- PASS: TestAccAWSUserLoginProfile_keybase (48.60s)
--- PASS: TestAccAWSUserLoginProfile_keybaseDoesntExist (14.41s)
--- PASS: TestAccAWSUserLoginProfile_notAKey (14.70s)
--- PASS: TestAccAWSUserLoginProfile_PasswordLength (45.94s)

--- PASS: TestAccAWSUserPolicyAttachment_basic (38.58s)

--- PASS: TestAccAWSUserSSHKey_basic (26.70s)
--- PASS: TestAccAWSUserSSHKey_pemEncoding (26.11s)

Output from acceptance testing in AWS GovCloud (US):

--- PASS: TestAccAWSIAMUserPolicy_basic (59.83s)
--- PASS: TestAccAWSIAMUserPolicy_disappears (23.85s)
--- PASS: TestAccAWSIAMUserPolicy_generatedName (54.43s)
--- PASS: TestAccAWSIAMUserPolicy_multiplePolicies (80.63s)
--- PASS: TestAccAWSIAMUserPolicy_namePrefix (53.68s)

--- PASS: TestAccAWSUser_basic (35.77s)
--- PASS: TestAccAWSUser_disappears (18.71s)
--- PASS: TestAccAWSUser_ForceDestroy_AccessKey (32.21s)
--- PASS: TestAccAWSUser_ForceDestroy_LoginProfile (40.12s)
--- PASS: TestAccAWSUser_ForceDestroy_MFADevice (47.70s)
--- PASS: TestAccAWSUser_ForceDestroy_SigningCertificate (31.31s)
--- PASS: TestAccAWSUser_ForceDestroy_SSHKey (29.54s)
--- PASS: TestAccAWSUser_nameChange (36.80s)
--- PASS: TestAccAWSUser_pathChange (37.43s)
--- PASS: TestAccAWSUser_permissionsBoundary (98.35s)
--- PASS: TestAccAWSUser_tags (46.03s)

--- PASS: TestAccAWSUserGroupMembership_basic (104.29s)

--- PASS: TestAccAWSUserLoginProfile_basic (55.38s)
--- PASS: TestAccAWSUserLoginProfile_keybase (48.45s)
--- PASS: TestAccAWSUserLoginProfile_keybaseDoesntExist (33.47s)
--- PASS: TestAccAWSUserLoginProfile_notAKey (27.08s)
--- PASS: TestAccAWSUserLoginProfile_PasswordLength (29.66s)

--- PASS: TestAccAWSUserPolicyAttachment_basic (51.20s)

--- PASS: TestAccAWSUserSSHKey_basic (31.28s)
--- PASS: TestAccAWSUserSSHKey_pemEncoding (28.18s)

…r resources

Reference: #16796

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSIAMUserPolicy_basic (38.41s)
--- PASS: TestAccAWSIAMUserPolicy_disappears (23.13s)
--- PASS: TestAccAWSIAMUserPolicy_generatedName (40.70s)
--- PASS: TestAccAWSIAMUserPolicy_multiplePolicies (48.72s)
--- PASS: TestAccAWSIAMUserPolicy_namePrefix (41.87s)

--- PASS: TestAccAWSUser_basic (36.07s)
--- PASS: TestAccAWSUser_disappears (20.47s)
--- PASS: TestAccAWSUser_ForceDestroy_AccessKey (27.25s)
--- PASS: TestAccAWSUser_ForceDestroy_LoginProfile (43.02s)
--- PASS: TestAccAWSUser_ForceDestroy_MFADevice (24.70s)
--- PASS: TestAccAWSUser_ForceDestroy_SigningCertificate (27.38s)
--- PASS: TestAccAWSUser_ForceDestroy_SSHKey (26.60s)
--- PASS: TestAccAWSUser_nameChange (27.75s)
--- PASS: TestAccAWSUser_pathChange (31.26s)
--- PASS: TestAccAWSUser_permissionsBoundary (70.82s)
--- PASS: TestAccAWSUser_tags (36.07s)

--- PASS: TestAccAWSUserGroupMembership_basic (81.80s)

--- PASS: TestAccAWSUserLoginProfile_basic (32.17s)
--- PASS: TestAccAWSUserLoginProfile_keybase (48.60s)
--- PASS: TestAccAWSUserLoginProfile_keybaseDoesntExist (14.41s)
--- PASS: TestAccAWSUserLoginProfile_notAKey (14.70s)
--- PASS: TestAccAWSUserLoginProfile_PasswordLength (45.94s)

--- PASS: TestAccAWSUserPolicyAttachment_basic (38.58s)

--- PASS: TestAccAWSUserSSHKey_basic (26.70s)
--- PASS: TestAccAWSUserSSHKey_pemEncoding (26.11s)
```

Output from acceptance testing in AWS GovCloud (US):

```
--- PASS: TestAccAWSIAMUserPolicy_basic (59.83s)
--- PASS: TestAccAWSIAMUserPolicy_disappears (23.85s)
--- PASS: TestAccAWSIAMUserPolicy_generatedName (54.43s)
--- PASS: TestAccAWSIAMUserPolicy_multiplePolicies (80.63s)
--- PASS: TestAccAWSIAMUserPolicy_namePrefix (53.68s)

--- PASS: TestAccAWSUser_basic (35.77s)
--- PASS: TestAccAWSUser_disappears (18.71s)
--- PASS: TestAccAWSUser_ForceDestroy_AccessKey (32.21s)
--- PASS: TestAccAWSUser_ForceDestroy_LoginProfile (40.12s)
--- PASS: TestAccAWSUser_ForceDestroy_MFADevice (47.70s)
--- PASS: TestAccAWSUser_ForceDestroy_SigningCertificate (31.31s)
--- PASS: TestAccAWSUser_ForceDestroy_SSHKey (29.54s)
--- PASS: TestAccAWSUser_nameChange (36.80s)
--- PASS: TestAccAWSUser_pathChange (37.43s)
--- PASS: TestAccAWSUser_permissionsBoundary (98.35s)
--- PASS: TestAccAWSUser_tags (46.03s)

--- PASS: TestAccAWSUserGroupMembership_basic (104.29s)

--- PASS: TestAccAWSUserLoginProfile_basic (55.38s)
--- PASS: TestAccAWSUserLoginProfile_keybase (48.45s)
--- PASS: TestAccAWSUserLoginProfile_keybaseDoesntExist (33.47s)
--- PASS: TestAccAWSUserLoginProfile_notAKey (27.08s)
--- PASS: TestAccAWSUserLoginProfile_PasswordLength (29.66s)

--- PASS: TestAccAWSUserPolicyAttachment_basic (51.20s)

--- PASS: TestAccAWSUserSSHKey_basic (31.28s)
--- PASS: TestAccAWSUserSSHKey_pemEncoding (28.18s)
```
@bflad bflad added the bug Addresses a defect in current functionality. label Mar 29, 2021
@bflad bflad requested a review from a team as a code owner March 29, 2021 14:17
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. service/iam Issues and PRs that pertain to the iam service. labels Mar 29, 2021
…cyARNAttachment function

Previously:

```
aws/resource_aws_iam_user_policy_attachment.go:162:6: `iamUserHasPolicyARNAttachment` is unused (deadcode)
func iamUserHasPolicyARNAttachment(conn *iam.IAM, user string, policyARN string) (bool, error) {
     ^
```
@YakDriver YakDriver self-assigned this Apr 1, 2021
@YakDriver YakDriver added this to the v3.35.0 milestone Apr 1, 2021
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

Underbar! 🎉

Acceptance tests commercial:

--- PASS: TestAccAWSUserLoginProfile_notAKey (21.42s)
--- PASS: TestAccAWSUser_disappears (29.93s)
--- PASS: TestAccAWSIAMUserPolicy_disappears (35.22s)
--- PASS: TestAccAWSUserSSHKey_pemEncoding (40.66s)
--- PASS: TestAccAWSUser_ForceDestroy_LoginProfile (40.66s)
--- PASS: TestAccAWSUser_ForceDestroy_SSHKey (41.40s)
--- PASS: TestAccAWSUser_ForceDestroy_AccessKey (41.42s)
--- PASS: TestAccAWSUserSSHKey_basic (41.42s)
--- PASS: TestAccAWSUser_ForceDestroy_MFADevice (41.43s)
--- PASS: TestAccAWSUser_ForceDestroy_SigningCertificate (41.59s)
--- PASS: TestAccAWSUserLoginProfile_keybaseDoesntExist (16.13s)
--- PASS: TestAccAWSUser_pathChange (56.73s)
--- PASS: TestAccAWSUser_nameChange (56.77s)
--- PASS: TestAccAWSUser_tags (56.86s)
--- PASS: TestAccAWSIAMUserPolicy_basic (57.14s)
--- PASS: TestAccAWSUser_basic (58.55s)
--- PASS: TestAccAWSUserLoginProfile_keybase (30.29s)
--- PASS: TestAccAWSIAMUserPolicy_generatedName (61.01s)
--- PASS: TestAccAWSIAMUserPolicy_namePrefix (61.10s)
--- PASS: TestAccAWSUserLoginProfile_PasswordLength (23.99s)
--- PASS: TestAccAWSUserPolicyAttachment_basic (44.80s)
--- PASS: TestAccAWSUserLoginProfile_basic (28.75s)
--- PASS: TestAccAWSIAMUserPolicy_multiplePolicies (76.36s)
--- PASS: TestAccAWSUser_permissionsBoundary (87.02s)
--- PASS: TestAccAWSUserGroupMembership_basic (95.08s)

Acceptance tests GovCloud:

--- PASS: TestAccAWSIAMUserPolicy_disappears (22.38s)
--- PASS: TestAccAWSUser_disappears (23.39s)
--- PASS: TestAccAWSUserSSHKey_basic (32.55s)
--- PASS: TestAccAWSUser_ForceDestroy_LoginProfile (34.33s)
--- PASS: TestAccAWSUser_ForceDestroy_SSHKey (34.74s)
--- PASS: TestAccAWSUser_ForceDestroy_AccessKey (34.82s)
--- PASS: TestAccAWSUser_ForceDestroy_SigningCertificate (35.00s)
--- PASS: TestAccAWSUser_ForceDestroy_MFADevice (35.07s)
--- PASS: TestAccAWSUserLoginProfile_keybaseDoesntExist (17.80s)
--- PASS: TestAccAWSUserLoginProfile_keybase (45.61s)
--- PASS: TestAccAWSUser_basic (50.03s)
--- PASS: TestAccAWSUser_nameChange (50.35s)
--- PASS: TestAccAWSIAMUserPolicy_basic (50.41s)
--- PASS: TestAccAWSUser_pathChange (50.42s)
--- PASS: TestAccAWSUser_tags (50.42s)
--- PASS: TestAccAWSUserLoginProfile_notAKey (17.43s)
--- PASS: TestAccAWSUserSSHKey_pemEncoding (54.17s)
--- PASS: TestAccAWSIAMUserPolicy_namePrefix (54.17s)
--- PASS: TestAccAWSIAMUserPolicy_generatedName (58.36s)
--- PASS: TestAccAWSUserLoginProfile_basic (43.07s)
--- PASS: TestAccAWSUserLoginProfile_PasswordLength (33.65s)
--- PASS: TestAccAWSUserPolicyAttachment_basic (53.45s)
--- PASS: TestAccAWSIAMUserPolicy_multiplePolicies (93.89s)
--- PASS: TestAccAWSUser_permissionsBoundary (110.10s)
--- PASS: TestAccAWSUserGroupMembership_basic (135.49s)

@breathingdust breathingdust modified the milestones: v3.35.0, v3.36.0 Apr 1, 2021
@bflad bflad merged commit 0e1f67d into main Apr 2, 2021
@bflad bflad deleted the b-iam-user-IsNewResource branch April 2, 2021 00:51
github-actions bot pushed a commit that referenced this pull request Apr 2, 2021
@ghost
Copy link

ghost commented Apr 9, 2021

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

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented May 2, 2021

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 as resolved and limited conversation to collaborators May 2, 2021
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/XL Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants