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

[Bugfix] r/aws_networkmanager_core_network: Fix network-function-groups null error with base policy #38642

Conversation

ddericco
Copy link
Contributor

@ddericco ddericco commented Aug 1, 2024

Description

Fixes the "$.network-function-groups: null found, array expected" error when creating a aws_networkmanager_core_network resource with the create_base_policy argument set to true. Also fixes currently failing acceptance tests for the aws_networkmanager_core_network resource.

Relations

Closes #38255

References

Core network policy version parameters in AWS Cloud WAN: https://docs.aws.amazon.com/network-manager/latest/cloudwan/cloudwan-policies-json.html

Output from Acceptance Testing

$ make testacc TESTS='TestAccNetworkManagerCoreNetwork__*' PKG=networkmanager ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/networkmanager/... -v -count 1 -parallel 3 -run='TestAccNetworkManagerCoreNetwork__*'  -timeout 360m
=== RUN   TestAccNetworkManagerCoreNetwork_basic
=== PAUSE TestAccNetworkManagerCoreNetwork_basic
=== RUN   TestAccNetworkManagerCoreNetwork_disappears
=== PAUSE TestAccNetworkManagerCoreNetwork_disappears
=== RUN   TestAccNetworkManagerCoreNetwork_tags
=== PAUSE TestAccNetworkManagerCoreNetwork_tags
=== RUN   TestAccNetworkManagerCoreNetwork_description
=== PAUSE TestAccNetworkManagerCoreNetwork_description
=== RUN   TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion
=== RUN   TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion
=== RUN   TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion
=== RUN   TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithPolicyDocument
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithPolicyDocument
=== RUN   TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument
=== PAUSE TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument
=== CONT  TestAccNetworkManagerCoreNetwork_basic
=== CONT  TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion
=== CONT  TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithPolicyDocument
--- PASS: TestAccNetworkManagerCoreNetwork_basic (321.47s)
=== CONT  TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion (551.41s)
=== CONT  TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion
--- PASS: TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument (515.15s)
=== CONT  TestAccNetworkManagerCoreNetwork_description
--- PASS: TestAccNetworkManagerCoreNetwork_description (329.12s)
=== CONT  TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithPolicyDocument (1407.00s)
=== CONT  TestAccNetworkManagerCoreNetwork_tags
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion (488.87s)
=== CONT  TestAccNetworkManagerCoreNetwork_disappears
--- PASS: TestAccNetworkManagerCoreNetwork_tags (337.57s)
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion (1363.04s)
--- PASS: TestAccNetworkManagerCoreNetwork_disappears (317.75s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager     1978.705s

@ddericco ddericco requested a review from a team as a code owner August 1, 2024 14:41
Copy link

github-actions bot commented Aug 1, 2024

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/networkmanager Issues and PRs that pertain to the networkmanager service. needs-triage Waiting for first response or review from a maintainer. partner Contribution from a partner. labels Aug 1, 2024
@ewbankkit ewbankkit self-assigned this Aug 1, 2024
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 1, 2024
@justinretzolk justinretzolk added bug Addresses a defect in current functionality. and removed needs-triage Waiting for first response or review from a maintainer. labels Aug 1, 2024
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 🚀.

% make testacc TESTARGS='-run=TestAccNetworkManagerCoreNetwork_' PKG=networkmanager ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.22.5 test ./internal/service/networkmanager/... -v -count 1 -parallel 3  -run=TestAccNetworkManagerCoreNetwork_ -timeout 360m
=== RUN   TestAccNetworkManagerCoreNetwork_basic
=== PAUSE TestAccNetworkManagerCoreNetwork_basic
=== RUN   TestAccNetworkManagerCoreNetwork_disappears
=== PAUSE TestAccNetworkManagerCoreNetwork_disappears
=== RUN   TestAccNetworkManagerCoreNetwork_tags
=== PAUSE TestAccNetworkManagerCoreNetwork_tags
=== RUN   TestAccNetworkManagerCoreNetwork_description
=== PAUSE TestAccNetworkManagerCoreNetwork_description
=== RUN   TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion
=== RUN   TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion
=== RUN   TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion
=== RUN   TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithPolicyDocument
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithPolicyDocument
=== RUN   TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument
=== PAUSE TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument
=== CONT  TestAccNetworkManagerCoreNetwork_basic
=== CONT  TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion
=== CONT  TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithPolicyDocument
--- PASS: TestAccNetworkManagerCoreNetwork_basic (315.09s)
=== CONT  TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion (555.36s)
=== CONT  TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion
--- PASS: TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument (576.20s)
=== CONT  TestAccNetworkManagerCoreNetwork_description
--- PASS: TestAccNetworkManagerCoreNetwork_description (322.62s)
=== CONT  TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithPolicyDocument (1498.64s)
=== CONT  TestAccNetworkManagerCoreNetwork_tags
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion (534.96s)
=== CONT  TestAccNetworkManagerCoreNetwork_disappears
--- PASS: TestAccNetworkManagerCoreNetwork_tags (329.11s)
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion (1429.14s)
--- PASS: TestAccNetworkManagerCoreNetwork_disappears (315.42s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager	2069.194s

@ewbankkit
Copy link
Contributor

@ddericco Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit f65bc57 into hashicorp:main Aug 5, 2024
31 checks passed
@github-actions github-actions bot added this to the v5.62.0 milestone Aug 5, 2024
@ddericco ddericco deleted the b-networkmanager_core_network-invalid_base_policy branch August 5, 2024 22:11
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Aug 9, 2024
Copy link

github-actions bot commented Aug 9, 2024

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

Copy link

github-actions bot commented Sep 9, 2024

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 Sep 9, 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. partner Contribution from a partner. service/networkmanager Issues and PRs that pertain to the networkmanager service.
Projects
None yet
3 participants