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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iam): the order of service principals should not matter #25967

Conversation

pierresouchay
Copy link

As depicted here #9042 (comment)

It seems the order of services is not predictable, causing Terraform to think it has changes to perform

This change avoid this by sorting the order always in the same predictable order

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

Relates #9042

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/iam Issues and PRs that pertain to the iam service. size/XS Managed by automation to categorize the size of a PR. labels Jul 25, 2022
@pierresouchay pierresouchay force-pushed the fix_order_of_principals_does_not_matters branch from ae39230 to 530da4d Compare July 25, 2022 14:01
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. 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 Jul 25, 2022
@pierresouchay pierresouchay force-pushed the fix_order_of_principals_does_not_matters branch from 530da4d to 94e2e67 Compare July 25, 2022 14:04
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @pierresouchay 馃憢

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven鈥檛 already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 馃槂

@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 25, 2022
@pierresouchay
Copy link
Author

Hello @justinretzolk,

Can someone approve the workflow of checks to see if everything is working as expected?

Regards

@pierresouchay
Copy link
Author

Hello @justinretzolk,

I added a changelog entry, does the PR meets your requirements or is it something missing?

Regards

@justinretzolk
Copy link
Member

Hey @pierresouchay 馃憢 Thank you for checking in on this. Unfortunately, I'm not able to provide an estimate on when this will be reviewed due to the potential of shifting priorities (we prioritize work by count of ":+1:" reactions, as well as a few other things). For more information on how we prioritize, check out out prioritization guide. That said, on a quick glance, everything appears to be in order for review, once the maintainers are able to prioritize this 馃檪.

@YakDriver YakDriver self-assigned this Apr 12, 2024
@terraform-aws-provider terraform-aws-provider bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Apr 12, 2024
Pierre Souchay and others added 3 commits April 12, 2024 15:29
As depicted here hashicorp#9042 (comment)

It seems the order of services is not predictable, causing Terraform to think it has changes to perform

This change avoid this by sorting the order always in the same predictable order
@YakDriver YakDriver force-pushed the fix_order_of_principals_does_not_matters branch from d7c61c1 to 802c65b Compare April 12, 2024 20:36
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.

LGTM 馃帀

% make t T=TestPolicyUnmarshalServicePrincipalOrder K=iam
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestPolicyUnmarshalServicePrincipalOrder'  -timeout 360m
=== RUN   TestPolicyUnmarshalServicePrincipalOrder
--- PASS: TestPolicyUnmarshalServicePrincipalOrder (0.00s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	2.291s
% make t T=TestAccIAMPolicyDocumentDataSource_ K=iam     
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/iam/... -v -count 1 -parallel 20 -run='TestAccIAMPolicyDocumentDataSource_'  -timeout 360m
=== RUN   TestAccIAMPolicyDocumentDataSource_basic
=== PAUSE TestAccIAMPolicyDocumentDataSource_basic
=== RUN   TestAccIAMPolicyDocumentDataSource_singleConditionValue
=== PAUSE TestAccIAMPolicyDocumentDataSource_singleConditionValue
=== RUN   TestAccIAMPolicyDocumentDataSource_multipleConditionKeys
=== PAUSE TestAccIAMPolicyDocumentDataSource_multipleConditionKeys
=== RUN   TestAccIAMPolicyDocumentDataSource_duplicateConditionKeys
=== PAUSE TestAccIAMPolicyDocumentDataSource_duplicateConditionKeys
=== RUN   TestAccIAMPolicyDocumentDataSource_conditionWithBoolValue
=== PAUSE TestAccIAMPolicyDocumentDataSource_conditionWithBoolValue
=== RUN   TestAccIAMPolicyDocumentDataSource_source
=== PAUSE TestAccIAMPolicyDocumentDataSource_source
=== RUN   TestAccIAMPolicyDocumentDataSource_sourceList
=== PAUSE TestAccIAMPolicyDocumentDataSource_sourceList
=== RUN   TestAccIAMPolicyDocumentDataSource_sourceConflicting
=== PAUSE TestAccIAMPolicyDocumentDataSource_sourceConflicting
=== RUN   TestAccIAMPolicyDocumentDataSource_sourceListConflicting
=== PAUSE TestAccIAMPolicyDocumentDataSource_sourceListConflicting
=== RUN   TestAccIAMPolicyDocumentDataSource_override
=== PAUSE TestAccIAMPolicyDocumentDataSource_override
=== RUN   TestAccIAMPolicyDocumentDataSource_overrideList
=== PAUSE TestAccIAMPolicyDocumentDataSource_overrideList
=== RUN   TestAccIAMPolicyDocumentDataSource_noStatementMerge
=== PAUSE TestAccIAMPolicyDocumentDataSource_noStatementMerge
=== RUN   TestAccIAMPolicyDocumentDataSource_noStatementOverride
=== PAUSE TestAccIAMPolicyDocumentDataSource_noStatementOverride
=== RUN   TestAccIAMPolicyDocumentDataSource_duplicateSid
=== PAUSE TestAccIAMPolicyDocumentDataSource_duplicateSid
=== RUN   TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON
=== PAUSE TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON
=== RUN   TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON
=== PAUSE TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON
=== RUN   TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndSlice
=== PAUSE TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndSlice
=== RUN   TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipals
=== PAUSE TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipals
=== RUN   TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipalsGov
=== PAUSE TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipalsGov
=== RUN   TestAccIAMPolicyDocumentDataSource_version20081017
=== PAUSE TestAccIAMPolicyDocumentDataSource_version20081017
=== CONT  TestAccIAMPolicyDocumentDataSource_basic
=== CONT  TestAccIAMPolicyDocumentDataSource_overrideList
=== CONT  TestAccIAMPolicyDocumentDataSource_source
=== CONT  TestAccIAMPolicyDocumentDataSource_duplicateConditionKeys
=== CONT  TestAccIAMPolicyDocumentDataSource_multipleConditionKeys
=== CONT  TestAccIAMPolicyDocumentDataSource_noStatementOverride
=== CONT  TestAccIAMPolicyDocumentDataSource_sourceListConflicting
=== CONT  TestAccIAMPolicyDocumentDataSource_noStatementMerge
=== CONT  TestAccIAMPolicyDocumentDataSource_singleConditionValue
=== CONT  TestAccIAMPolicyDocumentDataSource_sourceList
=== CONT  TestAccIAMPolicyDocumentDataSource_conditionWithBoolValue
=== CONT  TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipalsGov
=== CONT  TestAccIAMPolicyDocumentDataSource_version20081017
=== CONT  TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipals
=== CONT  TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndSlice
=== CONT  TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON
=== CONT  TestAccIAMPolicyDocumentDataSource_duplicateSid
=== CONT  TestAccIAMPolicyDocumentDataSource_sourceConflicting
=== CONT  TestAccIAMPolicyDocumentDataSource_override
=== CONT  TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON
=== NAME  TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipalsGov
    policy_document_data_source_test.go:390: skipping tests; current partition (aws) does not equal aws-us-gov
--- SKIP: TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipalsGov (0.43s)
--- PASS: TestAccIAMPolicyDocumentDataSource_sourceListConflicting (8.30s)
--- PASS: TestAccIAMPolicyDocumentDataSource_multipleConditionKeys (38.62s)
--- PASS: TestAccIAMPolicyDocumentDataSource_duplicateConditionKeys (38.66s)
--- PASS: TestAccIAMPolicyDocumentDataSource_conditionWithBoolValue (38.78s)
--- PASS: TestAccIAMPolicyDocumentDataSource_overrideList (38.82s)
--- PASS: TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipals (39.09s)
--- PASS: TestAccIAMPolicyDocumentDataSource_sourceList (39.13s)
--- PASS: TestAccIAMPolicyDocumentDataSource_basic (39.13s)
--- PASS: TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndSlice (39.13s)
--- PASS: TestAccIAMPolicyDocumentDataSource_singleConditionValue (39.14s)
--- PASS: TestAccIAMPolicyDocumentDataSource_noStatementMerge (39.14s)
--- PASS: TestAccIAMPolicyDocumentDataSource_sourceConflicting (39.14s)
--- PASS: TestAccIAMPolicyDocumentDataSource_noStatementOverride (39.18s)
--- PASS: TestAccIAMPolicyDocumentDataSource_override (39.18s)
--- PASS: TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON (39.99s)
--- PASS: TestAccIAMPolicyDocumentDataSource_duplicateSid (40.28s)
--- PASS: TestAccIAMPolicyDocumentDataSource_version20081017 (45.59s)
--- PASS: TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON (46.34s)
--- PASS: TestAccIAMPolicyDocumentDataSource_source (46.41s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	48.834s

@YakDriver YakDriver merged commit 91f4146 into hashicorp:main Apr 15, 2024
36 checks passed
@github-actions github-actions bot added this to the v5.46.0 milestone Apr 15, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Apr 19, 2024
Copy link

This functionality has been released in v5.46.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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants