Skip to content

Commit

Permalink
added null check
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideNale committed Feb 26, 2025
1 parent 02ce205 commit 65c640f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/sso/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ variable "managed_permission_sets" {
condition = alltrue([
for ps in var.managed_permission_sets :
ps.permissions_boundary == null ||
(ps.permissions_boundary.managed_policy_arn != null) !=
(ps.permissions_boundary.customer_managed_policy_reference != null)
(
(lookup(ps.permissions_boundary, "managed_policy_arn", null) != null) !=
(lookup(ps.permissions_boundary, "customer_managed_policy_reference", null) != null)
)
])
error_message = "When permissions_boundary is set, exactly one of managed_policy_arn or customer_managed_policy_reference must be provided."
}
Expand All @@ -45,8 +47,10 @@ variable "inline_permission_sets" {
condition = alltrue([
for ps in var.inline_permission_sets :
ps.permissions_boundary == null ||
(ps.permissions_boundary.managed_policy_arn != null) !=
(ps.permissions_boundary.customer_managed_policy_reference != null)
(
(lookup(ps.permissions_boundary, "managed_policy_arn", null) != null) !=
(lookup(ps.permissions_boundary, "customer_managed_policy_reference", null) != null)
)
])
error_message = "When permissions_boundary is set, exactly one of managed_policy_arn or customer_managed_policy_reference must be provided."
}
Expand Down

0 comments on commit 65c640f

Please sign in to comment.