Skip to content

Commit

Permalink
Marked network scope tests as beta-only and removed network scope fro…
Browse files Browse the repository at this point in the history
…m other tests (#12970)
  • Loading branch information
melinath authored Feb 7, 2025
1 parent 32318d4 commit ba5ff4e
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions mmv1/products/compute/FirewallPolicyRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ examples:
network: 'network'
test_env_vars:
org_id: 'ORG_ID'
min_version: beta
parameters:
- name: 'firewallPolicy'
type: ResourceRef
Expand Down
2 changes: 2 additions & 0 deletions mmv1/products/compute/NetworkFirewallPolicyRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,15 @@ examples:
fw_policy: 'fw-policy'
test_env_vars:
project_name: 'PROJECT_NAME'
min_version: beta
- name: 'network_firewall_policy_rule_network_scope_ingress'
primary_resource_id: 'primary'
vars:
fw_policy: 'fw-policy'
network: 'network'
test_env_vars:
project_name: 'PROJECT_NAME'
min_version: beta
parameters:
- name: 'firewallPolicy'
type: ResourceRef
Expand Down
2 changes: 2 additions & 0 deletions mmv1/products/compute/RegionNetworkFirewallPolicyRule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ examples:
org_id: 'ORG_ID'
project_name: 'PROJECT_NAME'
region: 'REGION'
min_version: beta
- name: 'region_network_firewall_policy_rule_network_scope_ingress'
primary_resource_id: 'primary'
vars:
Expand All @@ -79,6 +80,7 @@ examples:
org_id: 'ORG_ID'
project_name: 'PROJECT_NAME'
region: 'REGION'
min_version: beta
parameters:
- name: 'firewallPolicy'
type: ResourceRef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ resource "google_compute_firewall_policy_rule" "{{$.PrimaryResourceId}}" {
dest_threat_intelligences = ["iplist-known-malicious-ips"]
src_address_groups = []
dest_address_groups = [google_network_security_address_group.basic_global_networksecurity_address_group.id]
dest_network_scope = "INTERNET"

layer4_configs {
ip_protocol = "tcp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
resource "google_folder" "folder" {
provider = google-beta
display_name = "{{index $.Vars "folder"}}"
parent = "organizations/{{index $.TestEnvVars "org_id"}}"
deletion_protection = false
}

resource "google_compute_firewall_policy" "default" {
provider = google-beta
parent = google_folder.folder.id
short_name = "{{index $.Vars "fw_policy"}}"
description = "Firewall policy"
}

resource "google_compute_firewall_policy_rule" "{{$.PrimaryResourceId}}" {
provider = google-beta
firewall_policy = google_compute_firewall_policy.default.name
description = "Firewall policy rule with network scope"
priority = 9000
Expand All @@ -36,6 +39,7 @@ resource "google_compute_firewall_policy_rule" "{{$.PrimaryResourceId}}" {
}

resource "google_compute_network" "network" {
provider = google-beta
name = "{{index $.Vars "network"}}"
auto_create_subnetworks = false
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
resource "google_compute_network_firewall_policy" "basic_network_firewall_policy" {
provider = google-beta
name = "{{index $.Vars "fw_policy"}}"
description = "Sample global network firewall policy"
project = "{{index $.TestEnvVars "project_name"}}"
}

resource "google_compute_network_firewall_policy_rule" "{{$.PrimaryResourceId}}" {
provider = google-beta
action = "allow"
description = "This is a simple rule description"
direction = "EGRESS"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
resource "google_compute_network_firewall_policy" "basic_network_firewall_policy" {
provider = google-beta
name = "{{index $.Vars "fw_policy"}}"
description = "Sample global network firewall policy"
project = "{{index $.TestEnvVars "project_name"}}"
}

resource "google_compute_network_firewall_policy_rule" "{{$.PrimaryResourceId}}" {
provider = google-beta
action = "allow"
description = "This is a simple rule description"
direction = "INGRESS"
Expand All @@ -26,5 +28,6 @@ resource "google_compute_network_firewall_policy_rule" "{{$.PrimaryResourceId}}"
}

resource "google_compute_network" "network" {
provider = google-beta
name = "{{index $.Vars "network"}}"
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
resource "google_compute_region_network_firewall_policy" "basic_regional_network_firewall_policy" {
provider = google-beta
name = "{{index $.Vars "fw_policy"}}"
description = "Sample regional network firewall policy"
project = "{{index $.TestEnvVars "project_name"}}"
region = "{{index $.TestEnvVars "region"}}"
}

resource "google_compute_region_network_firewall_policy_rule" "{{$.PrimaryResourceId}}" {
provider = google-beta
action = "allow"
description = "This is a simple rule description"
direction = "EGRESS"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
resource "google_compute_region_network_firewall_policy" "basic_regional_network_firewall_policy" {
provider = google-beta
name = "{{index $.Vars "fw_policy"}}"
description = "Sample regional network firewall policy"
project = "{{index $.TestEnvVars "project_name"}}"
region = "{{index $.TestEnvVars "region"}}"
}

resource "google_compute_region_network_firewall_policy_rule" "{{$.PrimaryResourceId}}" {
provider = google-beta
action = "allow"
description = "This is a simple rule description"
direction = "INGRESS"
Expand All @@ -28,5 +30,6 @@ resource "google_compute_region_network_firewall_policy_rule" "{{$.PrimaryResour
}

resource "google_compute_network" "network" {
provider = google-beta
name = "{{index $.Vars "network"}}"
}

0 comments on commit ba5ff4e

Please sign in to comment.