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

Expose org policy parameters #2869

Merged
merged 5 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update examples and tests
  • Loading branch information
juliocc committed Feb 6, 2025
commit 3167bcbd130136b238b1b2f6cf8ffca028caa264
12 changes: 11 additions & 1 deletion modules/folder/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion modules/organization/schemas/org-policies.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
"type": "string"
}
}
},
"parameters": {
"type": "string"
}
}
}
Expand All @@ -70,4 +73,4 @@
}
}
}
}
}
12 changes: 11 additions & 1 deletion modules/project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/modules/folder/examples/org-policies.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -105,4 +105,4 @@ values:

counts:
google_folder: 1
google_org_policy_policy: 7
google_org_policy_policy: 8
4 changes: 2 additions & 2 deletions tests/modules/project/examples/org-policies.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -121,5 +121,5 @@ values:
project_id: test-project

counts:
google_org_policy_policy: 7
google_org_policy_policy: 8
google_project: 1
Loading