Skip to content

Commit 015122e

Browse files
authored
fix: Problems found when importing resources previously already created (#61)
1 parent 8728c2a commit 015122e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

iam.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ resource "aws_iam_policy" "additional_json" {
329329
count = local.create_role && var.attach_policy_json ? 1 : 0
330330

331331
name = local.role_name
332+
path = var.role_path
332333
policy = var.policy_json
333334
}
334335

outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ output "eventbridge_api_destination_arns" {
4141
# EventBridge Rule
4242
output "eventbridge_rule_ids" {
4343
description = "The EventBridge Rule IDs created"
44-
value = { for k in sort(keys(var.rules)) : k => aws_cloudwatch_event_rule.this[k].id if var.create && var.create_rules }
44+
value = { for k in sort(keys(var.rules)) : k => try(aws_cloudwatch_event_rule.this[k].id, null) if var.create && var.create_rules }
4545
}
4646

4747
output "eventbridge_rule_arns" {
4848
description = "The EventBridge Rule ARNs created"
49-
value = { for k in sort(keys(var.rules)) : k => aws_cloudwatch_event_rule.this[k].arn if var.create && var.create_rules }
49+
value = { for k in sort(keys(var.rules)) : k => try(aws_cloudwatch_event_rule.this[k].arn, null) if var.create && var.create_rules }
5050
}
5151

5252
# IAM Role

0 commit comments

Comments
 (0)