forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for network_firewall_policy_association and region_networ…
…k_firewall_policy_association (GoogleCloudPlatform#6796) Co-authored-by: Riley Karson <[email protected]> Co-authored-by: Ghaleb Al-habian <[email protected]>
- Loading branch information
Showing
9 changed files
with
188 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
tpgtools/overrides/compute/beta/network_firewall_policy_association.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- type: CUSTOM_RESOURCE_NAME | ||
details: | ||
title: region_network_firewall_policy_association | ||
location: region | ||
- type: EXCLUDE | ||
field: location | ||
location: global | ||
- type: EXCLUDE | ||
field: region | ||
- type: CUSTOM_NAME | ||
details: | ||
name: region | ||
field: location | ||
- type: CUSTOM_ID | ||
details: | ||
id: "projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}" | ||
location: region | ||
- type: CUSTOM_ID | ||
details: | ||
id: "projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}" | ||
location: global | ||
- type: IMPORT_FORMAT | ||
details: | ||
formats: | ||
- "projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}" | ||
- "{{project}}/{{region}}/{{firewall_policy}}/{{name}}" | ||
location: region | ||
- type: IMPORT_FORMAT | ||
details: | ||
formats: | ||
- "projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}" | ||
- "{{project}}/{{firewall_policy}}/{{name}}" | ||
location: global |
33 changes: 33 additions & 0 deletions
33
tpgtools/overrides/compute/network_firewall_policy_association.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
- type: CUSTOM_RESOURCE_NAME | ||
details: | ||
title: region_network_firewall_policy_association | ||
location: region | ||
- type: EXCLUDE | ||
field: location | ||
location: global | ||
- type: EXCLUDE | ||
field: region | ||
- type: CUSTOM_NAME | ||
details: | ||
name: region | ||
field: location | ||
- type: CUSTOM_ID | ||
details: | ||
id: "projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}" | ||
location: region | ||
- type: CUSTOM_ID | ||
details: | ||
id: "projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}" | ||
location: global | ||
- type: IMPORT_FORMAT | ||
details: | ||
formats: | ||
- "projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}" | ||
- "{{project}}/{{region}}/{{firewall_policy}}/{{name}}" | ||
location: region | ||
- type: IMPORT_FORMAT | ||
details: | ||
formats: | ||
- "projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}" | ||
- "{{project}}/{{firewall_policy}}/{{name}}" | ||
location: global |
16 changes: 16 additions & 0 deletions
16
tpgtools/overrides/compute/samples/networkfirewallpolicyassociation/global.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
resource "google_compute_network_firewall_policy" "network_firewall_policy" { | ||
name = "{{policy}}" | ||
project = "{{project}}" | ||
description = "Sample global network firewall policy" | ||
} | ||
|
||
resource "google_compute_network" "network" { | ||
name = "{{network}}" | ||
} | ||
|
||
resource "google_compute_network_firewall_policy_association" "primary" { | ||
name = "{{association}}" | ||
attachment_target = google_compute_network.network.id | ||
firewall_policy = google_compute_network_firewall_policy.network_firewall_policy.name | ||
project = "{{project}}" | ||
} |
11 changes: 11 additions & 0 deletions
11
tpgtools/overrides/compute/samples/networkfirewallpolicyassociation/global.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
updates: | ||
- resource: ./global_update.tf.tmpl | ||
variables: | ||
- name: association | ||
type: resource_name | ||
- name: policy | ||
type: resource_name | ||
- name: network | ||
type: resource_name | ||
- name: project | ||
type: project |
20 changes: 20 additions & 0 deletions
20
tpgtools/overrides/compute/samples/networkfirewallpolicyassociation/global_update.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
resource "google_compute_network_firewall_policy" "network_firewall_policy" { | ||
name = "{{policy}}" | ||
project = "{{project}}" | ||
description = "Sample global network firewall policy" | ||
} | ||
|
||
resource "google_compute_network" "network" { | ||
name = "{{network}}" | ||
} | ||
|
||
resource "google_compute_network" "network2" { | ||
name = "update-{{network}}" | ||
} | ||
|
||
resource "google_compute_network_firewall_policy_association" "primary" { | ||
name = "{{association}}" | ||
attachment_target = google_compute_network.network2.id | ||
firewall_policy = google_compute_network_firewall_policy.network_firewall_policy.name | ||
project = "{{project}}" | ||
} |
22 changes: 22 additions & 0 deletions
22
tpgtools/overrides/compute/samples/networkfirewallpolicyassociation/meta.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# meta.yaml | ||
# this is a shared config file that all the tests merge with | ||
# | ||
doc_hide: | ||
- global_network_firewall_policy_association.yaml | ||
- basic_regional_network_firewall_policy_association.yaml | ||
|
||
doc_hide_conditional: | ||
- location: global | ||
file_name: regional.tf.tmpl | ||
- location: region | ||
file_name: global.tf.tmpl | ||
|
||
test_hide: | ||
- global_network_firewall_policy_association.yaml | ||
- basic_regional_network_firewall_policy_association.yaml | ||
|
||
test_hide_conditional: | ||
- location: global | ||
file_name: regional.tf.tmpl | ||
- location: region | ||
file_name: global.tf.tmpl |
18 changes: 18 additions & 0 deletions
18
tpgtools/overrides/compute/samples/networkfirewallpolicyassociation/regional.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
resource "google_compute_region_network_firewall_policy" "basic_regional_network_firewall_policy" { | ||
name = "{{policy}}" | ||
project = "{{project}}" | ||
description = "Sample global network firewall policy" | ||
region = "{{region}}" | ||
} | ||
|
||
resource "google_compute_network" "basic_network" { | ||
name = "{{network}}" | ||
} | ||
|
||
resource "google_compute_region_network_firewall_policy_association" "primary" { | ||
name = "{{association}}" | ||
attachment_target = google_compute_network.basic_network.id | ||
firewall_policy = google_compute_region_network_firewall_policy.basic_regional_network_firewall_policy.name | ||
project = "{{project}}" | ||
region = "{{region}}" | ||
} |
13 changes: 13 additions & 0 deletions
13
tpgtools/overrides/compute/samples/networkfirewallpolicyassociation/regional.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
updates: | ||
- resource: ./regional_update.tf.tmpl | ||
variables: | ||
- name: association | ||
type: resource_name | ||
- name: policy | ||
type: resource_name | ||
- name: network | ||
type: resource_name | ||
- name: project | ||
type: project | ||
- name: region | ||
type: region |
22 changes: 22 additions & 0 deletions
22
tpgtools/overrides/compute/samples/networkfirewallpolicyassociation/regional_update.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
resource "google_compute_region_network_firewall_policy" "basic_regional_network_firewall_policy" { | ||
name = "{{policy}}" | ||
project = "{{project}}" | ||
description = "Sample global network firewall policy" | ||
region = "{{region}}" | ||
} | ||
|
||
resource "google_compute_network" "basic_network" { | ||
name = "{{network}}" | ||
} | ||
|
||
resource "google_compute_network" "basic_network2" { | ||
name = "update-{{network}}" | ||
} | ||
|
||
resource "google_compute_region_network_firewall_policy_association" "primary" { | ||
name = "{{association}}" | ||
attachment_target = google_compute_network.basic_network2.id | ||
firewall_policy = google_compute_region_network_firewall_policy.basic_regional_network_firewall_policy.name | ||
project = "{{project}}" | ||
region = "{{region}}" | ||
} |