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

r/iam_instance_profile - detach role when role doesn't exist + remove when deleted from state #16188

Merged
merged 7 commits into from
Feb 11, 2021

Conversation

DrFaust92
Copy link
Collaborator

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

Closes #7792
Closes #7160

Release note for CHANGELOG:

resource_aws_iam_instance_profile - detach role from instance profile when role doesn't exist

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSIAMInstanceProfile_'
--- PASS: TestAccAWSIAMInstanceProfile_disappears (31.66s)
--- PASS: TestAccAWSIAMInstanceProfile_disappears_role (32.98s)
--- PASS: TestAccAWSIAMInstanceProfile_withoutRole (34.85s)
--- PASS: TestAccAWSIAMInstanceProfile_basic (39.57s)
--- PASS: TestAccAWSIAMInstanceProfile_namePrefix (43.95s)

Maybe better to introduce a iam_instance_profile_role_attachment resource

@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/iam Issues and PRs that pertain to the iam service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 13, 2020
@DrFaust92 DrFaust92 added the bug Addresses a defect in current functionality. label Nov 13, 2020
@DrFaust92 DrFaust92 marked this pull request as ready for review November 13, 2020 22:19
@DrFaust92 DrFaust92 requested a review from a team as a code owner November 13, 2020 22:19
@DrFaust92 DrFaust92 changed the title r/iam_instance_profile - recreate when role is recreated r/iam_instance_profile - detach role when role doesn't exist Nov 14, 2020
@DrFaust92 DrFaust92 changed the title r/iam_instance_profile - detach role when role doesn't exist r/iam_instance_profile - detach role when role doesn't exist + remove when deleted from state Dec 10, 2020
Base automatically changed from master to main January 23, 2021 00:59
@DrFaust92 DrFaust92 force-pushed the r/instance_profile_drift_roles branch from 5519abb to 2995f2b Compare February 11, 2021 15:53
@YakDriver YakDriver self-assigned this Feb 11, 2021
@YakDriver YakDriver force-pushed the r/instance_profile_drift_roles branch from 2995f2b to 5bf1a3a Compare February 11, 2021 18:24
@ghost ghost added size/L Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. and removed size/M Managed by automation to categorize the size of a PR. labels Feb 11, 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.

Looks great! 🎉

GovCloud:

--- PASS: TestAccAWSIAMInstanceProfile_withoutRole (16.70s)
--- PASS: TestAccAWSIAMInstanceProfile_disappears (17.04s)
--- PASS: TestAccAWSIAMInstanceProfile_disappears_role (17.64s)
--- PASS: TestAccAWSIAMInstanceProfile_basic (19.81s)
--- PASS: TestAccAWSIAMInstanceProfile_namePrefix (21.82s)

us-west-2:

--- PASS: TestAccAWSIAMInstanceProfile_disappears (10.62s)
--- PASS: TestAccAWSIAMInstanceProfile_withoutRole (10.75s)
--- PASS: TestAccAWSIAMInstanceProfile_disappears_role (10.88s)
--- PASS: TestAccAWSIAMInstanceProfile_basic (12.03s)
--- PASS: TestAccAWSIAMInstanceProfile_namePrefix (13.00s)

@YakDriver YakDriver added this to the v3.28.0 milestone Feb 11, 2021
@YakDriver YakDriver merged commit 2630c75 into hashicorp:main Feb 11, 2021
@ghost
Copy link

ghost commented Feb 12, 2021

This has been released in version 3.28.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 14, 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 Mar 14, 2021
@DrFaust92 DrFaust92 deleted the r/instance_profile_drift_roles branch April 15, 2021 10:38
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. documentation Introduces or discusses updates to documentation. service/iam Issues and PRs that pertain to the iam service. size/L 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
2 participants