Skip to content

Commit

Permalink
Merge pull request #12 from johanneswuerbach/fix-no-policies
Browse files Browse the repository at this point in the history
fix: role without policies
  • Loading branch information
johanneswuerbach authored Feb 9, 2024
2 parents df890d7 + 3019ff2 commit ecdbffb
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions humanitec-resource-defs/iam-role/service-account/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
locals {
co_provisioned = {
for s in var.policy_classes : "aws-policy.${s}" => {
match_dependents = true
is_dependent = false
}
}
}

resource "humanitec_resource_definition" "main" {
driver_type = "humanitec/terraform"
id = "${var.prefix}aws-workload-role"
name = "${var.prefix}aws-workload-role"
type = "aws-role"

provision = {
for s in var.policy_classes : "aws-policy.${s}" => {
match_dependents = true
is_dependent = false
}
}
provision = length(var.policy_classes) > 0 ? local.co_provisioned : null

driver_inputs = {
secrets_string = jsonencode({
Expand Down

0 comments on commit ecdbffb

Please sign in to comment.