-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Correctly fetch overridden actions in the Network Firewall policy data source #31089
Correctly fetch overridden actions in the Network Firewall policy data source #31089
Conversation
This currently fails with the following error: panic: Invalid address to set: []string{"stateful_rule_group_reference", "0", "override"} I tried to include an aws_networkfirewall_rule_group resource in the test configuration to avoid depending on the rule group existing, however override blocks are only available on AWS-managed rule group references.
This previously caused a panic if an override is configured.
Community NoteVoting for Prioritization
For Submitters
|
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.
Welcome @dancorne 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR 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! 😃
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=TestAccNetworkFirewallFirewallPolicyDataSource_' PKG=networkfirewall ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/networkfirewall/... -v -count 1 -parallel 2 -run=TestAccNetworkFirewallFirewallPolicyDataSource_ -timeout 180m
=== RUN TestAccNetworkFirewallFirewallPolicyDataSource_arn
=== PAUSE TestAccNetworkFirewallFirewallPolicyDataSource_arn
=== RUN TestAccNetworkFirewallFirewallPolicyDataSource_name
=== PAUSE TestAccNetworkFirewallFirewallPolicyDataSource_name
=== RUN TestAccNetworkFirewallFirewallPolicyDataSource_nameAndARN
=== PAUSE TestAccNetworkFirewallFirewallPolicyDataSource_nameAndARN
=== RUN TestAccNetworkFirewallFirewallPolicyDataSource_withOverriddenManagedRuleGroup
=== PAUSE TestAccNetworkFirewallFirewallPolicyDataSource_withOverriddenManagedRuleGroup
=== CONT TestAccNetworkFirewallFirewallPolicyDataSource_arn
=== CONT TestAccNetworkFirewallFirewallPolicyDataSource_nameAndARN
--- PASS: TestAccNetworkFirewallFirewallPolicyDataSource_nameAndARN (133.21s)
=== CONT TestAccNetworkFirewallFirewallPolicyDataSource_withOverriddenManagedRuleGroup
--- PASS: TestAccNetworkFirewallFirewallPolicyDataSource_arn (153.44s)
=== CONT TestAccNetworkFirewallFirewallPolicyDataSource_name
--- PASS: TestAccNetworkFirewallFirewallPolicyDataSource_withOverriddenManagedRuleGroup (142.07s)
--- PASS: TestAccNetworkFirewallFirewallPolicyDataSource_name (162.20s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/networkfirewall 321.501s
@dancorne Thanks for the contribution 🎉 👏. |
This functionality has been released in v4.66.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
When an AWS-managed rule is configured in a Network Firewall with the action overridden Terraform will fail it's plan or apply with
Invalid address to set: []string{"stateful_rule_group_reference", "0", "override"}
I tried to include an
aws_networkfirewall_rule_group
resource in the test configuration to avoid depending on the referenced rule group existing ahead of time, however override blocks are only available on AWS-managed rule group references.I was tempted to add a very comprehensive resource configuration for the test to try to pre-empt similar issues, but I couldn't find any cases where that's be done before for data sources. Let me know if that'd be preferable though and I'm happy to update the test.
Relations
Closes #31088
References
The override block documentation in the provider resource docs
Output from Acceptance Testing
EDIT: Updated the test output to include all tests for this data source tests to confirm no regressions.