Skip to content

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

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

Conversation

matheusaleixo-cit
Copy link
Contributor

@matheusaleixo-cit matheusaleixo-cit commented Oct 18, 2024

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: hashicorp/terraform-provider-google#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 (beta)
compute: fixed unable to create default rule when using `google_compute_security_policy_rule` resource

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Oct 18, 2024
@matheusaleixo-cit matheusaleixo-cit marked this pull request as ready for review October 18, 2024 17:24
@github-actions github-actions bot requested a review from rileykarson October 18, 2024 17:24
Copy link

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.

Copy link

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

Copy link

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

@rileykarson rileykarson requested review from a team and zli82016 and removed request for rileykarson and a team October 25, 2024 17:35
@rileykarson
Copy link
Member

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

@modular-magician modular-magician added service/compute-security-policy and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Oct 25, 2024
@modular-magician
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

🟢 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 modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Oct 25, 2024
@modular-magician
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

🟢 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

@zli82016
Copy link
Member

@melinath , it looks like both PR, #12054 and #11894 are trying to fix the same Github issue with different ways. They both look reasonable to me. What is your thought? Thanks.

@melinath
Copy link
Member

melinath commented Oct 28, 2024

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.

Copy link
Member

@zli82016 zli82016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

niharika-98 pushed a commit to niharika-98/magic-modules that referenced this pull request Nov 1, 2024
BBBmau pushed a commit to BBBmau/magic-modules that referenced this pull request Nov 5, 2024
@matheusaleixo-cit matheusaleixo-cit deleted the fix-managing-default-rule-for-region-security-policy branch November 6, 2024 20:15
akshat-jindal-nit pushed a commit to akshat-jindal-nit/magic-modules that referenced this pull request Nov 18, 2024
amanMahendroo pushed a commit to amanMahendroo/magic-modules that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google_compute_region_security_policy_rule is not able to override default rule
5 participants