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

iam: Improve diff handling for policies #28777

Merged
merged 4 commits into from
Jan 10, 2023
Merged

iam: Improve diff handling for policies #28777

merged 4 commits into from
Jan 10, 2023

Conversation

YakDriver
Copy link
Member

@YakDriver YakDriver commented Jan 9, 2023

Description

Relations

Relates #23288

References

Output from Acceptance Testing

% make testacc TESTS=TestAccIAMRole_ PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAMRole_'  -timeout 180m
=== RUN   TestAccIAMRole_basic
=== PAUSE TestAccIAMRole_basic
=== RUN   TestAccIAMRole_description
=== PAUSE TestAccIAMRole_description
=== RUN   TestAccIAMRole_nameGenerated
=== PAUSE TestAccIAMRole_nameGenerated
=== RUN   TestAccIAMRole_namePrefix
=== PAUSE TestAccIAMRole_namePrefix
=== RUN   TestAccIAMRole_testNameChange
=== PAUSE TestAccIAMRole_testNameChange
=== RUN   TestAccIAMRole_badJSON
=== PAUSE TestAccIAMRole_badJSON
=== RUN   TestAccIAMRole_disappears
=== PAUSE TestAccIAMRole_disappears
=== RUN   TestAccIAMRole_policiesForceDetach
=== PAUSE TestAccIAMRole_policiesForceDetach
=== RUN   TestAccIAMRole_maxSessionDuration
=== PAUSE TestAccIAMRole_maxSessionDuration
=== RUN   TestAccIAMRole_permissionsBoundary
=== PAUSE TestAccIAMRole_permissionsBoundary
=== RUN   TestAccIAMRole_tags
=== PAUSE TestAccIAMRole_tags
=== 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_ManagedPolicy_basic
=== PAUSE TestAccIAMRole_ManagedPolicy_basic
=== RUN   TestAccIAMRole_ManagedPolicy_outOfBandRemovalAddedBack
=== PAUSE TestAccIAMRole_ManagedPolicy_outOfBandRemovalAddedBack
=== RUN   TestAccIAMRole_InlinePolicy_outOfBandRemovalAddedBack
=== PAUSE TestAccIAMRole_InlinePolicy_outOfBandRemovalAddedBack
=== RUN   TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemoved
=== PAUSE TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemoved
=== RUN   TestAccIAMRole_InlinePolicy_outOfBandAdditionRemoved
=== PAUSE TestAccIAMRole_InlinePolicy_outOfBandAdditionRemoved
=== RUN   TestAccIAMRole_InlinePolicy_outOfBandAdditionIgnored
=== PAUSE TestAccIAMRole_InlinePolicy_outOfBandAdditionIgnored
=== RUN   TestAccIAMRole_ManagedPolicy_outOfBandAdditionIgnored
=== PAUSE TestAccIAMRole_ManagedPolicy_outOfBandAdditionIgnored
=== RUN   TestAccIAMRole_InlinePolicy_outOfBandAdditionRemovedEmpty
=== PAUSE TestAccIAMRole_InlinePolicy_outOfBandAdditionRemovedEmpty
=== RUN   TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemovedEmpty
=== PAUSE TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemovedEmpty
=== CONT  TestAccIAMRole_basic
=== CONT  TestAccIAMRole_InlinePolicy_ignoreOrder
=== CONT  TestAccIAMRole_InlinePolicy_outOfBandAdditionIgnored
=== CONT  TestAccIAMRole_ManagedPolicy_outOfBandRemovalAddedBack
=== CONT  TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemoved
=== CONT  TestAccIAMRole_InlinePolicy_outOfBandRemovalAddedBack
=== CONT  TestAccIAMRole_maxSessionDuration
=== CONT  TestAccIAMRole_ManagedPolicy_basic
=== CONT  TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemovedEmpty
=== CONT  TestAccIAMRole_InlinePolicy_outOfBandAdditionRemovedEmpty
=== CONT  TestAccIAMRole_ManagedPolicy_outOfBandAdditionIgnored
=== CONT  TestAccIAMRole_permissionsBoundary
=== CONT  TestAccIAMRole_InlinePolicy_basic
=== CONT  TestAccIAMRole_disappears
=== CONT  TestAccIAMRole_tags
=== CONT  TestAccIAMRole_namePrefix
=== CONT  TestAccIAMRole_badJSON
=== CONT  TestAccIAMRole_InlinePolicy_outOfBandAdditionRemoved
=== CONT  TestAccIAMRole_policiesForceDetach
=== CONT  TestAccIAMRole_InlinePolicy_empty
--- PASS: TestAccIAMRole_badJSON (8.42s)
=== CONT  TestAccIAMRole_testNameChange
--- PASS: TestAccIAMRole_disappears (58.82s)
=== CONT  TestAccIAMRole_description
--- PASS: TestAccIAMRole_InlinePolicy_empty (64.24s)
=== CONT  TestAccIAMRole_nameGenerated
--- PASS: TestAccIAMRole_basic (78.62s)
--- PASS: TestAccIAMRole_namePrefix (80.54s)
--- PASS: TestAccIAMRole_policiesForceDetach (84.67s)
--- PASS: TestAccIAMRole_ManagedPolicy_outOfBandAdditionIgnored (103.12s)
--- PASS: TestAccIAMRole_InlinePolicy_outOfBandAdditionRemoved (107.18s)
--- PASS: TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemovedEmpty (107.48s)
--- PASS: TestAccIAMRole_InlinePolicy_outOfBandAdditionRemovedEmpty (108.13s)
--- PASS: TestAccIAMRole_InlinePolicy_outOfBandRemovalAddedBack (108.27s)
--- PASS: TestAccIAMRole_ManagedPolicy_outOfBandRemovalAddedBack (109.10s)
--- PASS: TestAccIAMRole_ManagedPolicy_outOfBandAdditionRemoved (111.71s)
--- PASS: TestAccIAMRole_tags (113.90s)
--- PASS: TestAccIAMRole_testNameChange (109.20s)
--- PASS: TestAccIAMRole_nameGenerated (55.39s)
--- PASS: TestAccIAMRole_maxSessionDuration (120.07s)
--- PASS: TestAccIAMRole_InlinePolicy_outOfBandAdditionIgnored (122.77s)
--- PASS: TestAccIAMRole_InlinePolicy_ignoreOrder (125.36s)
--- PASS: TestAccIAMRole_InlinePolicy_basic (130.41s)
--- PASS: TestAccIAMRole_ManagedPolicy_basic (130.44s)
--- PASS: TestAccIAMRole_description (86.17s)
--- PASS: TestAccIAMRole_permissionsBoundary (154.02s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	155.777s
% make testacc TESTS=TestAccIAMGroupPolicy_ PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAMGroupPolicy_'  -timeout 180m
=== RUN   TestAccIAMGroupPolicy_basic
=== PAUSE TestAccIAMGroupPolicy_basic
=== RUN   TestAccIAMGroupPolicy_disappears
=== PAUSE TestAccIAMGroupPolicy_disappears
=== RUN   TestAccIAMGroupPolicy_namePrefix
=== PAUSE TestAccIAMGroupPolicy_namePrefix
=== RUN   TestAccIAMGroupPolicy_generatedName
=== PAUSE TestAccIAMGroupPolicy_generatedName
=== CONT  TestAccIAMGroupPolicy_basic
=== CONT  TestAccIAMGroupPolicy_namePrefix
=== CONT  TestAccIAMGroupPolicy_generatedName
=== CONT  TestAccIAMGroupPolicy_disappears
--- PASS: TestAccIAMGroupPolicy_disappears (18.27s)
--- PASS: TestAccIAMGroupPolicy_namePrefix (35.64s)
--- PASS: TestAccIAMGroupPolicy_generatedName (35.79s)
--- PASS: TestAccIAMGroupPolicy_basic (40.76s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	42.529s
% make testacc TESTS=TestAccIAMPolicy_ PKG=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAMPolicy_'  -timeout 180m
=== RUN   TestAccIAMPolicy_basic
=== PAUSE TestAccIAMPolicy_basic
=== RUN   TestAccIAMPolicy_description
=== PAUSE TestAccIAMPolicy_description
=== RUN   TestAccIAMPolicy_tags
=== PAUSE TestAccIAMPolicy_tags
=== RUN   TestAccIAMPolicy_disappears
=== PAUSE TestAccIAMPolicy_disappears
=== RUN   TestAccIAMPolicy_namePrefix
=== PAUSE TestAccIAMPolicy_namePrefix
=== RUN   TestAccIAMPolicy_path
=== PAUSE TestAccIAMPolicy_path
=== RUN   TestAccIAMPolicy_policy
=== PAUSE TestAccIAMPolicy_policy
=== CONT  TestAccIAMPolicy_basic
=== CONT  TestAccIAMPolicy_namePrefix
=== CONT  TestAccIAMPolicy_policy
=== CONT  TestAccIAMPolicy_path
=== CONT  TestAccIAMPolicy_tags
=== CONT  TestAccIAMPolicy_description
=== CONT  TestAccIAMPolicy_disappears
--- PASS: TestAccIAMPolicy_disappears (21.55s)
--- PASS: TestAccIAMPolicy_description (26.93s)
--- PASS: TestAccIAMPolicy_path (27.62s)
--- PASS: TestAccIAMPolicy_namePrefix (27.64s)
--- PASS: TestAccIAMPolicy_basic (27.67s)
--- PASS: TestAccIAMPolicy_policy (40.12s)
--- PASS: TestAccIAMPolicy_tags (50.01s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	51.747s
% make testacc TESTS=TestAccIAMRolePolicy_ PKG=iam     
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAMRolePolicy_'  -timeout 180m
=== RUN   TestAccIAMRolePolicy_basic
=== PAUSE TestAccIAMRolePolicy_basic
=== RUN   TestAccIAMRolePolicy_disappears
=== PAUSE TestAccIAMRolePolicy_disappears
=== RUN   TestAccIAMRolePolicy_policyOrder
=== PAUSE TestAccIAMRolePolicy_policyOrder
=== RUN   TestAccIAMRolePolicy_namePrefix
=== PAUSE TestAccIAMRolePolicy_namePrefix
=== RUN   TestAccIAMRolePolicy_generatedName
=== PAUSE TestAccIAMRolePolicy_generatedName
=== RUN   TestAccIAMRolePolicy_invalidJSON
=== PAUSE TestAccIAMRolePolicy_invalidJSON
=== RUN   TestAccIAMRolePolicy_Policy_invalidResource
=== PAUSE TestAccIAMRolePolicy_Policy_invalidResource
=== CONT  TestAccIAMRolePolicy_basic
=== CONT  TestAccIAMRolePolicy_generatedName
=== CONT  TestAccIAMRolePolicy_Policy_invalidResource
=== CONT  TestAccIAMRolePolicy_invalidJSON
=== CONT  TestAccIAMRolePolicy_policyOrder
=== CONT  TestAccIAMRolePolicy_namePrefix
=== CONT  TestAccIAMRolePolicy_disappears
--- PASS: TestAccIAMRolePolicy_invalidJSON (3.89s)
--- PASS: TestAccIAMRolePolicy_Policy_invalidResource (17.25s)
--- PASS: TestAccIAMRolePolicy_disappears (28.95s)
--- PASS: TestAccIAMRolePolicy_policyOrder (40.32s)
--- PASS: TestAccIAMRolePolicy_generatedName (50.54s)
--- PASS: TestAccIAMRolePolicy_namePrefix (51.26s)
--- PASS: TestAccIAMRolePolicy_basic (51.63s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	54.151s

@github-actions
Copy link

github-actions bot commented Jan 9, 2023

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 size/XS Managed by automation to categorize the size of a PR. service/iam Issues and PRs that pertain to the iam service. labels Jan 9, 2023
@github-actions github-actions bot added size/S Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels Jan 9, 2023
@github-actions github-actions bot added size/M Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Jan 9, 2023
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

@YakDriver YakDriver merged commit 9cfa198 into main Jan 10, 2023
@YakDriver YakDriver deleted the b-iam-policy-diffs branch January 10, 2023 14:34
@github-actions github-actions bot added this to the v4.50.0 milestone Jan 10, 2023
github-actions bot pushed a commit that referenced this pull request Jan 10, 2023
@github-actions
Copy link

This functionality has been released in v4.50.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. Thank you!

@github-actions
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 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/iam Issues and PRs that pertain to the iam service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants