magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

Fixed SecurityPolicyRule and RegionSecurityPolicyRule resources being unable to manage the policy default rule

Open matheusaleixo-cit opened this issue 1 year ago • 1 comments

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

matheusaleixo-cit avatar Oct 18 '24 15:10 matheusaleixo-cit

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.

github-actions[bot] avatar Oct 18 '24 17:10 github-actions[bot]

@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.

github-actions[bot] avatar Oct 23 '24 09:10 github-actions[bot]

@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.

github-actions[bot] avatar Oct 25 '24 09:10 github-actions[bot]

Sorry, been behind on reviews. Rolled a new reviewer.

rileykarson avatar Oct 25 '24 17:10 rileykarson

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(+))

modular-magician avatar Oct 25 '24 18:10 modular-magician

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

Get to know how VCR tests work

modular-magician avatar Oct 25 '24 18:10 modular-magician

🟢 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.

View the build log or the debug log for each test

modular-magician avatar Oct 25 '24 18:10 modular-magician

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(+))

modular-magician avatar Oct 25 '24 23:10 modular-magician

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

Get to know how VCR tests work

modular-magician avatar Oct 25 '24 23:10 modular-magician

🟢 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.

View the build log or the debug log for each test

modular-magician avatar Oct 25 '24 23:10 modular-magician

@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.

zli82016 avatar Oct 28 '24 21:10 zli82016

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.

melinath avatar Oct 28 '24 21:10 melinath