Fixed SecurityPolicyRule and RegionSecurityPolicyRule resources being unable to manage the policy default rule
Adds custom code to allow the google_compute_region_security_policy_rule and google_compute_security_policy_rule resources to override the default rule of their respective security policy without the need of a multi-apply import process.
Fixes: https://github.com/hashicorp/terraform-provider-google/issues/15687
Release Note Template for Downstream PRs (will be copied)
compute: fixed unable to create default rule when using `google_compute_region_security_policy_rule` resource
compute: fixed unable to create default rule when using `google_compute_security_policy_rule` resource
Hello! I am a robot. Tests will require approval from a repository maintainer to run.
@rileykarson, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.
You can help make sure that review is quick by doing a self-review and by running impacted tests locally.
@rileykarson This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.
@GoogleCloudPlatform/terraform-team @rileykarson This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.
Sorry, been behind on reviews. Rolled a new reviewer.
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
google provider: Diff ( 6 files changed, 209 insertions(+), 145 deletions(-))
google-beta provider: Diff ( 10 files changed, 374 insertions(+), 284 deletions(-))
Open in Cloud Shell: Diff ( 4 files changed, 133 insertions(+))
Tests analytics
Total tests: 1044 Passed tests: 965 Skipped tests: 73 Affected tests: 6
Click here to see the affected service packages
- compute
Action taken
Found 6 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
- TestAccComputeInstanceConfidentialInstanceConfigMain
- TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain
- TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleDefaultRuleExample
- TestAccComputeRegionSecurityPolicyRule_securityPolicyDefaultRule
- TestAccComputeSecurityPolicyRule_securityPolicyDefaultRule
- TestAccComputeSecurityPolicyRule_securityPolicyRuleDefaultRuleExample
🟢 Tests passed during RECORDING mode:
TestAccComputeRegionSecurityPolicyRule_securityPolicyDefaultRule [Debug log]
TestAccComputeSecurityPolicyRule_securityPolicyDefaultRule [Debug log]
TestAccComputeSecurityPolicyRule_securityPolicyRuleDefaultRuleExample [Debug log]
🟢 No issues found for passed tests after REPLAYING rerun.
🔴 Tests failed during RECORDING mode:
TestAccComputeInstanceConfidentialInstanceConfigMain [Error message] [Debug log]
TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain [Error message] [Debug log]
TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleDefaultRuleExample [Error message] [Debug log]
🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
google provider: Diff ( 6 files changed, 212 insertions(+), 145 deletions(-))
google-beta provider: Diff ( 10 files changed, 380 insertions(+), 284 deletions(-))
Open in Cloud Shell: Diff ( 4 files changed, 133 insertions(+))
Tests analytics
Total tests: 1044 Passed tests: 968 Skipped tests: 73 Affected tests: 3
Click here to see the affected service packages
- compute
Action taken
Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
- TestAccComputeInstanceConfidentialInstanceConfigMain
- TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain
- TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleDefaultRuleExample
🟢 Tests passed during RECORDING mode:
TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleDefaultRuleExample [Debug log]
🟢 No issues found for passed tests after REPLAYING rerun.
🔴 Tests failed during RECORDING mode:
TestAccComputeInstanceConfidentialInstanceConfigMain [Error message] [Debug log]
TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain [Error message] [Debug log]
🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.
@melinath , it looks like both PR, https://github.com/GoogleCloudPlatform/magic-modules/pull/12054 and https://github.com/GoogleCloudPlatform/magic-modules/pull/11894 are trying to fix the same Github issue with different ways. They both look reasonable to me. What is your thought? Thanks.
FWIW to me this feels like a reasonable situation for acquire-on-create behavior. I don't think these PRs necessarily conflict & having both seems like it's probably good for users.