From 8edf6aa4285d42f9a047716fc04e1bbfe9a76567 Mon Sep 17 00:00:00 2001 From: Psycho Mantys Date: Tue, 22 Oct 2024 20:00:01 -0300 Subject: [PATCH] Add version 18 --- _variables.tf | 4 ++-- iam.tf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_variables.tf b/_variables.tf index d40c906..680ec48 100644 --- a/_variables.tf +++ b/_variables.tf @@ -80,8 +80,8 @@ variable "create_iam_eks_role" { } variable "extra_custom_policy" { - type = string - default = "{}" + type = any + default = false } variable "cors_rules" { diff --git a/iam.tf b/iam.tf index e16f3bf..7f859db 100644 --- a/iam.tf +++ b/iam.tf @@ -35,14 +35,14 @@ resource "aws_iam_policy" "bucket_rw" { // Extra custom policy resource "aws_iam_user_policy_attachment" "extra_custom_policy" { - count = var.create && var.create_iam_user ? 1 : 0 + count = var.create && var.create_iam_user && var.create_iam_user ? 1 : 0 user = aws_iam_user.bucket_user[0].name policy_arn = aws_iam_policy.extra_custom_policy[0].arn } resource "aws_iam_policy" "extra_custom_policy" { - count = var.create && (var.create_iam_user || length(var.create_iam_eks_role) > 0) ? 1 : 0 + count = var.create && var.create_iam_user && (var.create_iam_user || length(var.create_iam_eks_role) > 0) ? 1 : 0 name = "${var.bucket_name}-extra-custom-policy" policy = try(