Skip to content

Commit ee4f5dc

Browse files
Feat: add excluded projects and folders examples in google compute organization security policy association resource (GoogleCloudPlatform#17511)
1 parent 1d01f16 commit ee4f5dc

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

mmv1/products/compute/OrganizationSecurityPolicyAssociation.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ examples:
4848
short_name: "my-short-name"
4949
test_env_vars:
5050
org_id: 'ORG_TARGET'
51+
- name: 'organization_security_policy_association_excluded'
52+
primary_resource_id: 'policy'
53+
vars:
54+
short_name: "my-short-name-excluded"
55+
test_env_vars:
56+
org_id: 'ORG_TARGET'
5157
parameters:
5258
- name: 'policyId'
5359
type: String
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
resource "google_folder" "security_policy_target" {
2+
display_name = "tf-test-secpol-%{random_suffix}"
3+
parent = "organizations/{{index $.TestEnvVars "org_id"}}"
4+
deletion_protection = false
5+
}
6+
7+
resource "google_compute_organization_security_policy" "policy" {
8+
short_name = "tf-test%{random_suffix}"
9+
parent = google_folder.security_policy_target.name
10+
type = "CLOUD_ARMOR"
11+
}
12+
13+
resource "google_compute_organization_security_policy_association" "{{$.PrimaryResourceId}}" {
14+
name = "tf-test%{random_suffix}"
15+
attachment_id = "organizations/{{index $.TestEnvVars "org_id"}}"
16+
policy_id = google_compute_organization_security_policy.policy.id
17+
18+
excluded_projects = [
19+
"projects/2000000002",
20+
"projects/3000000003"
21+
]
22+
excluded_folders = [
23+
"folders/4000000004",
24+
"folders/5000000005"
25+
]
26+
}

0 commit comments

Comments
 (0)