Skip to content

Commit 8ef6e1f

Browse files
authored
fix: specify rules variable type in org_policy_v2 (#73)
1 parent 3a2fe0b commit 8ef6e1f

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

modules/org_policy_v2/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ To control module's behavior, change variables' values regarding the following:
9898
| policy\_root | Resource hierarchy node to apply the policy to: can be one of `organization`, `folder`, or `project`. | `string` | `"organization"` | no |
9999
| policy\_root\_id | The policy root id, either of organization\_id, folder\_id or project\_id | `string` | `null` | no |
100100
| policy\_type | The constraint type to work with (either 'boolean' or 'list') | `string` | `"list"` | no |
101-
| rules | List of rules per policy. Upto 10. | `list(any)` | n/a | yes |
101+
| rules | List of rules per policy. Up to 10. | <pre>list(object(<br> {<br> enforcement = bool<br> allow = list(string)<br> deny = list(string)<br> conditions = list(object(<br> {<br> description = string<br> expression = string<br> title = string<br> location = string<br> }<br> ))<br> }<br> ))</pre> | n/a | yes |
102102

103103
## Outputs
104104

modules/org_policy_v2/variables.tf

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ variable "policy_type" {
5050
}
5151

5252
variable "rules" {
53-
description = "List of rules per policy. Upto 10."
54-
type = list(any)
53+
description = "List of rules per policy. Up to 10."
54+
type = list(object(
55+
{
56+
enforcement = bool
57+
allow = list(string)
58+
deny = list(string)
59+
conditions = list(object(
60+
{
61+
description = string
62+
expression = string
63+
title = string
64+
location = string
65+
}
66+
))
67+
}
68+
))
5569
}

0 commit comments

Comments
 (0)