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

d/aws_iam_policy_document: Fix Failed to marshal plan to json, unsupported attribute "override_json" #36383

Merged
merged 8 commits into from
Mar 14, 2024

Conversation

ewbankkit
Copy link
Contributor

Description

Fixes Failed to marshal plan to json, unsupported attribute "override_json" errors on terraform show -json by restoring the override_json and source_json attributes.

Relations

Closes #31637.
Relates #22906.
Relates #30829.

References

Output from Acceptance Testing

% make testacc TESTARGS='-run=TestAccIAMAccessKey_\|TestAccIAMAccessKeysDataSource_' PKG=iam ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/iam/... -v -count 1 -parallel 2  -run=TestAccIAMAccessKey_\|TestAccIAMAccessKeysDataSource_ -timeout 360m
=== RUN   TestAccIAMAccessKey_basic
=== PAUSE TestAccIAMAccessKey_basic
=== RUN   TestAccIAMAccessKey_disappears
=== PAUSE TestAccIAMAccessKey_disappears
=== RUN   TestAccIAMAccessKey_encrypted
=== PAUSE TestAccIAMAccessKey_encrypted
=== RUN   TestAccIAMAccessKey_status
=== PAUSE TestAccIAMAccessKey_status
=== RUN   TestAccIAMAccessKeysDataSource_basic
=== PAUSE TestAccIAMAccessKeysDataSource_basic
=== RUN   TestAccIAMAccessKeysDataSource_twoKeys
=== PAUSE TestAccIAMAccessKeysDataSource_twoKeys
=== CONT  TestAccIAMAccessKey_basic
=== CONT  TestAccIAMAccessKeysDataSource_twoKeys
--- PASS: TestAccIAMAccessKeysDataSource_twoKeys (19.97s)
=== CONT  TestAccIAMAccessKey_status
--- PASS: TestAccIAMAccessKey_basic (23.89s)
=== CONT  TestAccIAMAccessKeysDataSource_basic
--- PASS: TestAccIAMAccessKeysDataSource_basic (21.84s)
=== CONT  TestAccIAMAccessKey_disappears
--- PASS: TestAccIAMAccessKey_disappears (20.46s)
=== CONT  TestAccIAMAccessKey_encrypted
--- PASS: TestAccIAMAccessKey_status (57.47s)
--- PASS: TestAccIAMAccessKey_encrypted (25.00s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	99.784s
% make testacc TESTARGS='-run=TestAccIAMPolicyDocumentDataSource_' PKG=iam ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.21.8 test ./internal/service/iam/... -v -count 1 -parallel 2  -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
--- PASS: TestAccIAMPolicyDocumentDataSource_basic (13.03s)
=== CONT  TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON
--- PASS: TestAccIAMPolicyDocumentDataSource_overrideList (13.05s)
=== CONT  TestAccIAMPolicyDocumentDataSource_version20081017
--- PASS: TestAccIAMPolicyDocumentDataSource_overridePolicyDocumentValidJSON (12.90s)
=== CONT  TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipalsGov
    policy_document_data_source_test.go:388: skipping tests; current partition (aws) does not equal aws-us-gov
--- SKIP: TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipalsGov (0.00s)
=== CONT  TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipals
--- PASS: TestAccIAMPolicyDocumentDataSource_version20081017 (22.93s)
=== CONT  TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndSlice
--- PASS: TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_multiplePrincipals (12.15s)
=== CONT  TestAccIAMPolicyDocumentDataSource_source
--- PASS: TestAccIAMPolicyDocumentDataSource_StatementPrincipalIdentifiers_stringAndSlice (11.86s)
=== CONT  TestAccIAMPolicyDocumentDataSource_override
--- PASS: TestAccIAMPolicyDocumentDataSource_source (21.50s)
=== CONT  TestAccIAMPolicyDocumentDataSource_sourceListConflicting
--- PASS: TestAccIAMPolicyDocumentDataSource_override (12.04s)
=== CONT  TestAccIAMPolicyDocumentDataSource_sourceConflicting
--- PASS: TestAccIAMPolicyDocumentDataSource_sourceListConflicting (3.57s)
=== CONT  TestAccIAMPolicyDocumentDataSource_sourceList
--- PASS: TestAccIAMPolicyDocumentDataSource_sourceConflicting (12.26s)
=== CONT  TestAccIAMPolicyDocumentDataSource_duplicateConditionKeys
--- PASS: TestAccIAMPolicyDocumentDataSource_sourceList (11.98s)
=== CONT  TestAccIAMPolicyDocumentDataSource_conditionWithBoolValue
--- PASS: TestAccIAMPolicyDocumentDataSource_duplicateConditionKeys (11.67s)
=== CONT  TestAccIAMPolicyDocumentDataSource_duplicateSid
--- PASS: TestAccIAMPolicyDocumentDataSource_conditionWithBoolValue (11.58s)
=== CONT  TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON
--- PASS: TestAccIAMPolicyDocumentDataSource_duplicateSid (15.10s)
=== CONT  TestAccIAMPolicyDocumentDataSource_noStatementOverride
--- PASS: TestAccIAMPolicyDocumentDataSource_sourcePolicyValidJSON (14.25s)
=== CONT  TestAccIAMPolicyDocumentDataSource_noStatementMerge
--- PASS: TestAccIAMPolicyDocumentDataSource_noStatementOverride (12.96s)
=== CONT  TestAccIAMPolicyDocumentDataSource_multipleConditionKeys
--- PASS: TestAccIAMPolicyDocumentDataSource_noStatementMerge (12.84s)
=== CONT  TestAccIAMPolicyDocumentDataSource_singleConditionValue
--- PASS: TestAccIAMPolicyDocumentDataSource_multipleConditionKeys (12.76s)
--- PASS: TestAccIAMPolicyDocumentDataSource_singleConditionValue (12.30s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/iam	133.218s

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 size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/iam Issues and PRs that pertain to the iam service. sweeper Pertains to changes to or issues with the sweeper. generators Relates to code generators. labels Mar 14, 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 Mar 14, 2024
Copy link

Thank you for your contribution! 🚀

A new usage of AWS SDK for Go V1 was detected. Please prefer AWS SDK for Go V2 for all net-new services. If this is an enhancement or bug fix to an existing AWS SDK Go V1 based resource, this comment can be safely ignored.

For additional information refer to the AWS SDK for Go Versions page in the contributor guide.

@ewbankkit ewbankkit changed the title [WIP] d/aws_iam_policy_document: Fix Failed to marshal plan to json, unsupported attribute "override_json" d/aws_iam_policy_document: Fix Failed to marshal plan to json, unsupported attribute "override_json" Mar 14, 2024
@ewbankkit ewbankkit merged commit 7dcf701 into main Mar 14, 2024
42 checks passed
@ewbankkit ewbankkit deleted the b-d/aws_iam_policy_document-override_json branch March 14, 2024 20:02
@github-actions github-actions bot added this to the v5.41.0 milestone Mar 14, 2024
github-actions bot pushed a commit that referenced this pull request Mar 14, 2024
Copy link

This functionality has been released in v5.41.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 github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 14, 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 Apr 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
generators Relates to code generators. service/iam Issues and PRs that pertain to the iam service. size/XL Managed by automation to categorize the size of a PR. sweeper Pertains to changes to or issues with the sweeper. 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.

[Bug]: Failed to marshal plan to json, unsupported attribute "override_json"
1 participant