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_role: Ignore additional NoSuchEntity errors on deletion #11125

Merged

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Dec 4, 2019

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Closes #136

Release note for CHANGELOG:

* resource/aws_iam_role: Ignore additional `NoSuchEntity` errors on deletion

Found (fairly consistently) while testing an unrelated resource:

--- FAIL: TestAccAWSEksFargateProfile_Tags (1867.13s)
    testing.go:696: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.
        Error: errors during apply: 2 problems:
        - error deleting IAM Role (tf-acc-test-8845835297481034348-cluster) instance profiles: Error listing Profiles for IAM Role (tf-acc-test-8845835297481034348-cluster) when trying to delete: NoSuchEntity: The role with name tf-acc-test-8845835297481034348-cluster cannot be found.
        	status code: 404, request id: 853018a9-f5b2-4c62-964c-a9a7fc5da6c1

Output from acceptance testing:

--- PASS: TestAccAWSIAMRole_badJSON (2.95s)
--- PASS: TestAccAWSIAMRole_disappears (16.35s)
--- PASS: TestAccAWSIAMRole_namePrefix (21.77s)
--- PASS: TestAccAWSIAMRole_basic (21.79s)
--- PASS: TestAccAWSIAMRole_force_detach_policies (25.87s)
--- PASS: TestAccAWSIAMRole_tags (35.61s)
--- PASS: TestAccAWSIAMRole_MaxSessionDuration (36.71s)
--- PASS: TestAccAWSIAMRole_testNameChange (42.35s)
--- PASS: TestAccAWSIAMRole_basicWithDescription (46.43s)
--- PASS: TestAccAWSIAMRole_PermissionsBoundary (79.25s)

--- PASS: TestAccAWSEksFargateProfile_Selector_Labels (1511.68s)
--- PASS: TestAccAWSEksFargateProfile_basic (1599.46s)
--- PASS: TestAccAWSEksFargateProfile_disappears (1663.86s)
--- PASS: TestAccAWSEksFargateProfile_Tags (1810.36s)

Reference: #136

Found while testing an unrelated resource:

```
--- FAIL: TestAccAWSEksFargateProfile_Tags (1867.13s)
    testing.go:696: Error destroying resource! WARNING: Dangling resources
        may exist. The full state and error is shown below.
        Error: errors during apply: 2 problems:
        - error deleting IAM Role (tf-acc-test-8845835297481034348-cluster) instance profiles: Error listing Profiles for IAM Role (tf-acc-test-8845835297481034348-cluster) when trying to delete: NoSuchEntity: The role with name tf-acc-test-8845835297481034348-cluster cannot be found.
        	status code: 404, request id: 853018a9-f5b2-4c62-964c-a9a7fc5da6c1
```

Output from acceptance testing:

```
--- PASS: TestAccAWSIAMRole_badJSON (2.95s)
--- PASS: TestAccAWSIAMRole_disappears (16.35s)
--- PASS: TestAccAWSIAMRole_namePrefix (21.77s)
--- PASS: TestAccAWSIAMRole_basic (21.79s)
--- PASS: TestAccAWSIAMRole_force_detach_policies (25.87s)
--- PASS: TestAccAWSIAMRole_tags (35.61s)
--- PASS: TestAccAWSIAMRole_MaxSessionDuration (36.71s)
--- PASS: TestAccAWSIAMRole_testNameChange (42.35s)
--- PASS: TestAccAWSIAMRole_basicWithDescription (46.43s)
--- PASS: TestAccAWSIAMRole_PermissionsBoundary (79.25s)
```
@bflad bflad added the bug Addresses a defect in current functionality. label Dec 4, 2019
@bflad bflad requested a review from a team December 4, 2019 00:03
@ghost ghost added needs-triage Waiting for first response or review from a maintainer. size/XS Managed by automation to categorize the size of a PR. service/iam Issues and PRs that pertain to the iam service. labels Dec 4, 2019
@ryndaniels ryndaniels removed the needs-triage Waiting for first response or review from a maintainer. label Dec 4, 2019
Copy link
Contributor

@ryndaniels ryndaniels left a comment

Choose a reason for hiding this comment

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

:shipit:

@bflad bflad added this to the v2.42.0 milestone Dec 5, 2019
@bflad bflad merged commit e4af762 into master Dec 5, 2019
@bflad bflad deleted the b-aws_iam_role-additional-deletion-NoSuchEntity-handling branch December 5, 2019 13:01
bflad added a commit that referenced this pull request Dec 5, 2019
@ghost
Copy link

ghost commented Dec 13, 2019

This has been released in version 2.42.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 Mar 28, 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 Mar 28, 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/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform is trying to detach a removed IAM Instance Profile
2 participants