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

feat(aws_iam_role): Update inline policy updates to be an update then delete call, not delete then update aws call #31935

Conversation

teddylear
Copy link
Contributor

@teddylear teddylear commented Jun 13, 2023

feat(aws_iam_role): Update inline policy updates to be an update then delete call, not delete then update aws call

Description

Update aws_iam_role so that inline_policy set when applying changes does an update and then delete instead of delete then update like it currently does as this causes issues for users with downtime access. Roles are only deleted if they were in set and then deleted. If there is a test I should write for this please let me know, I'm not sure how to add a test for this in the current test framework. I can do the same thing for managed_policy_arns in another PR as well in a similar fashion. I can make follow up PRs as well to try to resolve the TypeSet issue making plans look undesirable to end users.

Relations

Partially resolves #22336

Output from Acceptance Testing

terraform-provider-aws on  f_aws-iam-role_inline_policy_updates_then_delete [!] via 🐹 v1.20.5 took 3s
[I] ➜ make testacc TESTS=TestAccIAMRole_InlinePolicy PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAMRole_InlinePolicy'  -timeout 180m
=== RUN   TestAccIAMRole_InlinePolicy_basic
=== PAUSE TestAccIAMRole_InlinePolicy_basic
=== RUN   TestAccIAMRole_InlinePolicy_ignoreOrder
=== PAUSE TestAccIAMRole_InlinePolicy_ignoreOrder
=== RUN   TestAccIAMRole_InlinePolicy_empty
=== PAUSE TestAccIAMRole_InlinePolicy_empty
=== RUN   TestAccIAMRole_InlinePolicy_outOfBandRemovalAddedBack
=== PAUSE TestAccIAMRole_InlinePolicy_outOfBandRemovalAddedBack
=== RUN   TestAccIAMRole_InlinePolicy_outOfBandAdditionRemoved
=== PAUSE TestAccIAMRole_InlinePolicy_outOfBandAdditionRemoved
=== RUN   TestAccIAMRole_InlinePolicy_outOfBandAdditionIgnored
=== PAUSE TestAccIAMRole_InlinePolicy_outOfBandAdditionIgnored
=== RUN   TestAccIAMRole_InlinePolicy_outOfBandAdditionRemovedEmpty
=== PAUSE TestAccIAMRole_InlinePolicy_outOfBandAdditionRemovedEmpty
=== CONT  TestAccIAMRole_InlinePolicy_basic
=== CONT  TestAccIAMRole_InlinePolicy_outOfBandAdditionRemoved
=== CONT  TestAccIAMRole_InlinePolicy_outOfBandAdditionRemovedEmpty
=== CONT  TestAccIAMRole_InlinePolicy_outOfBandAdditionIgnored
=== CONT  TestAccIAMRole_InlinePolicy_empty
=== CONT  TestAccIAMRole_InlinePolicy_outOfBandRemovalAddedBack
=== CONT  TestAccIAMRole_InlinePolicy_ignoreOrder
--- PASS: TestAccIAMRole_InlinePolicy_empty (141.36s)
--- PASS: TestAccIAMRole_InlinePolicy_outOfBandRemovalAddedBack (242.77s)
--- PASS: TestAccIAMRole_InlinePolicy_outOfBandAdditionRemovedEmpty (244.60s)
--- PASS: TestAccIAMRole_InlinePolicy_outOfBandAdditionRemoved (244.96s)
--- PASS: TestAccIAMRole_InlinePolicy_outOfBandAdditionIgnored (283.99s)
--- PASS: TestAccIAMRole_InlinePolicy_ignoreOrder (286.64s)
--- PASS: TestAccIAMRole_InlinePolicy_basic (301.11s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/iam        306.365s

@github-actions
Copy link

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added service/iam Issues and PRs that pertain to the iam service. size/S Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Jun 13, 2023
@teddylear teddylear changed the title [WIP] feat(aws_iam_role): Update inline policy updates to be an update then delete call, not delete then update aws call feat(aws_iam_role): Update inline policy updates to be an update then delete call, not delete then update aws call Jun 13, 2023
@teddylear teddylear marked this pull request as ready for review June 13, 2023 23:06
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 14, 2023
@teddylear teddylear closed this Jan 21, 2024
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changes to inline_policy blocks on aws_iam_role always recreates policy
2 participants