From 20b6822257b6eaf77135e1cd5ec27a631dc74426 Mon Sep 17 00:00:00 2001 From: Alisson Oliveira Date: Sun, 14 Aug 2022 10:00:41 +0000 Subject: [PATCH 1/2] fix: use the same role_path to policie path --- iam.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/iam.tf b/iam.tf index 8e399ae..4afc3b6 100644 --- a/iam.tf +++ b/iam.tf @@ -329,6 +329,7 @@ resource "aws_iam_policy" "additional_json" { count = local.create_role && var.attach_policy_json ? 1 : 0 name = local.role_name + path = var.role_path policy = var.policy_json } From 90286b67f6dee2ce7391d29df14fa1b8a7338bec Mon Sep 17 00:00:00 2001 From: Alisson Oliveira Date: Sun, 14 Aug 2022 10:01:10 +0000 Subject: [PATCH 2/2] fix: fix an error when importing without having all resources created --- outputs.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/outputs.tf b/outputs.tf index ef9abea..1a5e6b4 100644 --- a/outputs.tf +++ b/outputs.tf @@ -41,12 +41,12 @@ output "eventbridge_api_destination_arns" { # EventBridge Rule output "eventbridge_rule_ids" { description = "The EventBridge Rule IDs created" - value = { for k in sort(keys(var.rules)) : k => aws_cloudwatch_event_rule.this[k].id if var.create && var.create_rules } + value = { for k in sort(keys(var.rules)) : k => try(aws_cloudwatch_event_rule.this[k].id, null) if var.create && var.create_rules } } output "eventbridge_rule_arns" { description = "The EventBridge Rule ARNs created" - value = { for k in sort(keys(var.rules)) : k => aws_cloudwatch_event_rule.this[k].arn if var.create && var.create_rules } + value = { for k in sort(keys(var.rules)) : k => try(aws_cloudwatch_event_rule.this[k].arn, null) if var.create && var.create_rules } } # IAM Role