diff --git a/modules/folder/README.md b/modules/folder/README.md index d39f996e7..cda006011 100644 --- a/modules/folder/README.md +++ b/modules/folder/README.md @@ -139,9 +139,19 @@ module "folder" { "compute.vmExternalIpAccess" = { rules = [{ deny = { all = true } }] } + "essentialcontacts.managed.allowedContactDomains" = { + rules = [ + { + enforce = true + parameters = jsonencode({ + allowedDomains = ["@example.com"] + }) + } + ] + } } } -# tftest modules=1 resources=8 inventory=org-policies.yaml e2e +# tftest modules=1 resources=9 inventory=org-policies.yaml e2e ``` ### Organization Policy Factory diff --git a/modules/organization/schemas/org-policies.schema.json b/modules/organization/schemas/org-policies.schema.json index 7353ddfb2..7a97c499a 100644 --- a/modules/organization/schemas/org-policies.schema.json +++ b/modules/organization/schemas/org-policies.schema.json @@ -46,6 +46,9 @@ "type": "string" } } + }, + "parameters": { + "type": "string" } } } @@ -70,4 +73,4 @@ } } } -} \ No newline at end of file +} diff --git a/modules/project/README.md b/modules/project/README.md index 0754dd092..e60f1d3df 100644 --- a/modules/project/README.md +++ b/modules/project/README.md @@ -517,9 +517,19 @@ module "project" { "compute.vmExternalIpAccess" = { rules = [{ deny = { all = true } }] } + "essentialcontacts.managed.allowedContactDomains" = { + rules = [ + { + enforce = true + parameters = jsonencode({ + allowedDomains = ["@example.com"] + }) + } + ] + } } } -# tftest modules=1 resources=8 inventory=org-policies.yaml e2e +# tftest modules=1 resources=9 inventory=org-policies.yaml e2e ``` ### Organization Policy Factory diff --git a/tests/modules/folder/examples/org-policies.yaml b/tests/modules/folder/examples/org-policies.yaml index 6bfe6fcdb..671c5b014 100644 --- a/tests/modules/folder/examples/org-policies.yaml +++ b/tests/modules/folder/examples/org-policies.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -105,4 +105,4 @@ values: counts: google_folder: 1 - google_org_policy_policy: 7 + google_org_policy_policy: 8 diff --git a/tests/modules/project/examples/org-policies.yaml b/tests/modules/project/examples/org-policies.yaml index 6539c32c4..98cdd9781 100644 --- a/tests/modules/project/examples/org-policies.yaml +++ b/tests/modules/project/examples/org-policies.yaml @@ -1,4 +1,4 @@ -# Copyright 2023 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -121,5 +121,5 @@ values: project_id: test-project counts: - google_org_policy_policy: 7 + google_org_policy_policy: 8 google_project: 1