-
Notifications
You must be signed in to change notification settings - Fork 9.5k
td/aws_networkmanager_core network_policy-enhancements #30879
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
td/aws_networkmanager_core network_policy-enhancements #30879
Conversation
short test that returns an intuitive error
Community NoteVoting for Prioritization
For Submitters
|
59ac7ff
to
e620b93
Compare
e620b93
to
cd63ec9
Compare
There was a problem hiding this 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=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/networkmanager/... -v -count 1 -parallel 2 -run=TestAccNetworkManagerCoreNetwork_ -timeout 180m
=== 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_policyDocument
=== PAUSE TestAccNetworkManagerCoreNetwork_policyDocument
=== RUN TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion
=== RUN TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion
=== RUN TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion
=== PAUSE TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion
=== RUN TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument
=== PAUSE TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument
=== CONT TestAccNetworkManagerCoreNetwork_basic
=== CONT TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion
--- PASS: TestAccNetworkManagerCoreNetwork_basic (47.72s)
=== CONT TestAccNetworkManagerCoreNetwork_description
--- PASS: TestAccNetworkManagerCoreNetwork_description (69.92s)
=== CONT TestAccNetworkManagerCoreNetwork_policyDocument
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithoutRegion (483.35s)
=== CONT TestAccNetworkManagerCoreNetwork_tags
--- PASS: TestAccNetworkManagerCoreNetwork_tags (79.78s)
=== CONT TestAccNetworkManagerCoreNetwork_disappears
--- PASS: TestAccNetworkManagerCoreNetwork_disappears (42.23s)
=== CONT TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion
--- PASS: TestAccNetworkManagerCoreNetwork_policyDocument (637.44s)
=== CONT TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument
--- PASS: TestAccNetworkManagerCoreNetwork_withoutPolicyDocumentUpdateToCreateBasePolicyDocument (526.78s)
=== CONT TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithRegion (423.43s)
--- PASS: TestAccNetworkManagerCoreNetwork_createBasePolicyDocumentWithMultiRegion (1382.64s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/networkmanager 1993.449s
@GlennChia Thanks for the contribution 🎉 👏. |
This functionality has been released in v4.65.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! |
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. |
Description
Currently the api
ExecuteCoreNetworkChangeSetWithContext
is called in aretry
when there is an error ofIncorrect input
which stems from a network policy not being in the correct state. Instead of using a retry, this PR introduces a wait condition to ensure the policy is in theREADY_TO_EXECUTE
state before executing it. The waiter also catches errors when aFAILED_GENERATION
state is detected.As part of this waiter, the finder function is refactored to take in a policy version id so that we can accurately wait for the correct policy to finish. For compatibility with the other APIs, we introduce a
-1
check and default to reading the latest policy versions.Separetely, this PR also adds a test case to check for expected errors should there be an incorrect policy. This helps to test if policy errors can be detected early with an intuitive error message.
Relations
Relates #28867
References
Output from Acceptance Testing