Skip to content
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

Create region security policies rules #8477

Merged

Conversation

felipegc
Copy link
Contributor

@felipegc felipegc commented Jul 28, 2023

Fixes:
hashicorp/terraform-provider-google#15319

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read Write release notes before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

`google_compute_region_security_policy_rule`
compute: added support for `user_defined_fields` to `google_compute_region_security_policy`

felipegc and others added 30 commits May 15, 2023 08:51
@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.

Terraform GA: Diff ( 4 files changed, 413 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 12 files changed, 2391 insertions(+), 4 deletions(-))
TF Conversion: Diff ( 2 files changed, 372 insertions(+))
TF OiCS: Diff ( 12 files changed, 391 insertions(+))

@felipegc felipegc marked this pull request as draft August 11, 2023 17:31
@felipegc
Copy link
Contributor Author

Hi @zli82016 the code is ready to review again. I put this PR in draft mode to avoid merge for now since the user_defined_fields will be public available in few days. The idea is to let this PR ready for merge once it happens so then I move to "wip" again.
Thanks

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2949
Passed tests 2647
Skipped tests: 302
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 11, 2023
@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Aug 11, 2023
@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.

Terraform GA: Diff ( 4 files changed, 413 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 12 files changed, 2391 insertions(+), 4 deletions(-))
TF Conversion: Diff ( 2 files changed, 372 insertions(+))
TF OiCS: Diff ( 12 files changed, 391 insertions(+))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_compute_region_security_policy (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_region_security_policy" "primary" {
  user_defined_fields {
    base   = # value needed
    mask   = # value needed
    name   = # value needed
    offset = # value needed
    size   = # value needed
  }
}

Resource: google_compute_region_security_policy_rule (0 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_compute_region_security_policy_rule" "primary" {
  action      = # value needed
  description = # value needed
  match {
    config {
      src_ip_ranges = # value needed
    }
    versioned_expr = # value needed
  }
  network_match {
    dest_ip_ranges   = # value needed
    dest_ports       = # value needed
    ip_protocols     = # value needed
    src_asns         = # value needed
    src_ip_ranges    = # value needed
    src_ports        = # value needed
    src_region_codes = # value needed
    user_defined_fields {
      name   = # value needed
      values = # value needed
    }
  }
  preview         = # value needed
  priority        = # value needed
  region          = # value needed
  security_policy = # value needed
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2950
Passed tests 2648
Skipped tests: 302
Affected tests: 0

$\textcolor{green}{\textsf{All tests passed in REPLAYING mode.}}$
View the build log

@felipegc felipegc marked this pull request as ready for review August 15, 2023 20:41
@felipegc
Copy link
Contributor Author

@zli82016 These features has been moved to "public". Could you please continue the review?

@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 Aug 15, 2023
@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.

Terraform GA: Diff ( 4 files changed, 413 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 12 files changed, 2391 insertions(+), 4 deletions(-))
TF Conversion: Diff ( 2 files changed, 372 insertions(+))
TF OiCS: Diff ( 12 files changed, 391 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2957
Passed tests 2650
Skipped tests: 302
Affected tests: 5

Action taken

Found 5 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccBigQueryDataTable_bigtable|TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleNetworkMatchUpdate|TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleBasicUpdate|TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleMultipleRulesExample|TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleBasicExample

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccBigQueryDataTable_bigtable[Debug log]
TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleNetworkMatchUpdate[Debug log]
TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleBasicUpdate[Debug log]
TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleMultipleRulesExample[Debug log]
TestAccComputeRegionSecurityPolicyRule_regionSecurityPolicyRuleBasicExample[Debug log]

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$
View the build log or the debug log for each test

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.

@zli82016 zli82016 merged commit 0dfdbd2 into GoogleCloudPlatform:main Aug 15, 2023
nevzheng pushed a commit to nevzheng/magic-modules that referenced this pull request Aug 16, 2023
* creating first version of region security policy and adding ddos protection config

* adding rules field in region security policy

* creating resource network_edge_security_service and their scenarios of test

* adding patch operation and fixing id, import_format and self_link

* added fields in the region_security_policy, and fixed the scenario tests for network_edge_security_service

* removed duplicated field for region_security_policy

* adding ddos_protection_config field in region_security_policy

* cleanups

* adding self_link field back and removing uncessary fields

* adding docs for ddosProtection

* making new resources only availabe in beta downstream

* fixing eof

* adding region security policy rule and basic scenario

* code experiments cleanups

* adding preconfiguredWafConfig object and some inner fields in region security policy rule

* adding mapping for network_match object in region security policy rule

* adding rateLimitOptions mapping

* adding ruleNumber field to region security policy

* adding basic update for region security policy rule

* adding network_match and preconfigured_waf scenarios for region sec policy rules

* wip - adding user_defined_fields in region security policy

* fixing yaml linter issues

* fixing review comments

* removing validate_only field

* fixing comments in region_security_policy_rule test

* fixing userDefinedFields and adding tests for regionSecPolicyRule

* adding user_defined_fields update test for regionSecPolicy

* removing rule_number from regionSecPolicyRule

* removing preconfiguredWaf from regionSecPolicyRule because it is not finished yet

* removing rateLimitOptions from RegionSecPolicyRule because it is not finished yet

* small cleanups

* fixing yamllint issues on the worked resources

* prevent that netwrokt_match test fails due paralellism

* adding new test for multiple rules

* fixing code review comments

* removing harcoded project from tests

* moving network_edge_security_service basic test to another region

* fixing code review issues

* fixing import cycle issue in downstream repo

* updating with upstream and change regions

---------

Co-authored-by: diogoEsteves <diogoesteves@ciandt.com>
ron-gal pushed a commit to ron-gal/magic-modules that referenced this pull request Aug 17, 2023
* creating first version of region security policy and adding ddos protection config

* adding rules field in region security policy

* creating resource network_edge_security_service and their scenarios of test

* adding patch operation and fixing id, import_format and self_link

* added fields in the region_security_policy, and fixed the scenario tests for network_edge_security_service

* removed duplicated field for region_security_policy

* adding ddos_protection_config field in region_security_policy

* cleanups

* adding self_link field back and removing uncessary fields

* adding docs for ddosProtection

* making new resources only availabe in beta downstream

* fixing eof

* adding region security policy rule and basic scenario

* code experiments cleanups

* adding preconfiguredWafConfig object and some inner fields in region security policy rule

* adding mapping for network_match object in region security policy rule

* adding rateLimitOptions mapping

* adding ruleNumber field to region security policy

* adding basic update for region security policy rule

* adding network_match and preconfigured_waf scenarios for region sec policy rules

* wip - adding user_defined_fields in region security policy

* fixing yaml linter issues

* fixing review comments

* removing validate_only field

* fixing comments in region_security_policy_rule test

* fixing userDefinedFields and adding tests for regionSecPolicyRule

* adding user_defined_fields update test for regionSecPolicy

* removing rule_number from regionSecPolicyRule

* removing preconfiguredWaf from regionSecPolicyRule because it is not finished yet

* removing rateLimitOptions from RegionSecPolicyRule because it is not finished yet

* small cleanups

* fixing yamllint issues on the worked resources

* prevent that netwrokt_match test fails due paralellism

* adding new test for multiple rules

* fixing code review comments

* removing harcoded project from tests

* moving network_edge_security_service basic test to another region

* fixing code review issues

* fixing import cycle issue in downstream repo

* updating with upstream and change regions

---------

Co-authored-by: diogoEsteves <diogoesteves@ciandt.com>
rainshen49 pushed a commit to rainshen49/magic-modules that referenced this pull request Aug 21, 2023
* creating first version of region security policy and adding ddos protection config

* adding rules field in region security policy

* creating resource network_edge_security_service and their scenarios of test

* adding patch operation and fixing id, import_format and self_link

* added fields in the region_security_policy, and fixed the scenario tests for network_edge_security_service

* removed duplicated field for region_security_policy

* adding ddos_protection_config field in region_security_policy

* cleanups

* adding self_link field back and removing uncessary fields

* adding docs for ddosProtection

* making new resources only availabe in beta downstream

* fixing eof

* adding region security policy rule and basic scenario

* code experiments cleanups

* adding preconfiguredWafConfig object and some inner fields in region security policy rule

* adding mapping for network_match object in region security policy rule

* adding rateLimitOptions mapping

* adding ruleNumber field to region security policy

* adding basic update for region security policy rule

* adding network_match and preconfigured_waf scenarios for region sec policy rules

* wip - adding user_defined_fields in region security policy

* fixing yaml linter issues

* fixing review comments

* removing validate_only field

* fixing comments in region_security_policy_rule test

* fixing userDefinedFields and adding tests for regionSecPolicyRule

* adding user_defined_fields update test for regionSecPolicy

* removing rule_number from regionSecPolicyRule

* removing preconfiguredWaf from regionSecPolicyRule because it is not finished yet

* removing rateLimitOptions from RegionSecPolicyRule because it is not finished yet

* small cleanups

* fixing yamllint issues on the worked resources

* prevent that netwrokt_match test fails due paralellism

* adding new test for multiple rules

* fixing code review comments

* removing harcoded project from tests

* moving network_edge_security_service basic test to another region

* fixing code review issues

* fixing import cycle issue in downstream repo

* updating with upstream and change regions

---------

Co-authored-by: diogoEsteves <diogoesteves@ciandt.com>
joelkattapuram pushed a commit to joelkattapuram/magic-modules that referenced this pull request Sep 20, 2023
* creating first version of region security policy and adding ddos protection config

* adding rules field in region security policy

* creating resource network_edge_security_service and their scenarios of test

* adding patch operation and fixing id, import_format and self_link

* added fields in the region_security_policy, and fixed the scenario tests for network_edge_security_service

* removed duplicated field for region_security_policy

* adding ddos_protection_config field in region_security_policy

* cleanups

* adding self_link field back and removing uncessary fields

* adding docs for ddosProtection

* making new resources only availabe in beta downstream

* fixing eof

* adding region security policy rule and basic scenario

* code experiments cleanups

* adding preconfiguredWafConfig object and some inner fields in region security policy rule

* adding mapping for network_match object in region security policy rule

* adding rateLimitOptions mapping

* adding ruleNumber field to region security policy

* adding basic update for region security policy rule

* adding network_match and preconfigured_waf scenarios for region sec policy rules

* wip - adding user_defined_fields in region security policy

* fixing yaml linter issues

* fixing review comments

* removing validate_only field

* fixing comments in region_security_policy_rule test

* fixing userDefinedFields and adding tests for regionSecPolicyRule

* adding user_defined_fields update test for regionSecPolicy

* removing rule_number from regionSecPolicyRule

* removing preconfiguredWaf from regionSecPolicyRule because it is not finished yet

* removing rateLimitOptions from RegionSecPolicyRule because it is not finished yet

* small cleanups

* fixing yamllint issues on the worked resources

* prevent that netwrokt_match test fails due paralellism

* adding new test for multiple rules

* fixing code review comments

* removing harcoded project from tests

* moving network_edge_security_service basic test to another region

* fixing code review issues

* fixing import cycle issue in downstream repo

* updating with upstream and change regions

---------

Co-authored-by: diogoEsteves <diogoesteves@ciandt.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants