Skip to content

Commit fa452b8

Browse files
authored
Merge pull request #11 from olhado/fixing-null-arn
Fixing null arn
2 parents a8be8cc + 134dd94 commit fa452b8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

aws_iam_role.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ data "template_file" "aws_iam_role_policy" {
1616
# This checks to see if a new bucket exists (null check)
1717
# If it is null, just give a null so coalesce skips it
1818
# If not null, return the arn of the bucket, which is what we really need
19-
s3_resource = coalesce((length(aws_s3_bucket.bucket) > 0 ? aws_s3_bucket.bucket[0].arn : ""), var.existing_cloudtrail.s3_bucket_arn)
19+
s3_resource = coalesce((length(aws_s3_bucket.bucket) > 0 ? aws_s3_bucket.bucket[0].arn : ""), (var.existing_cloudtrail != null ? var.existing_cloudtrail.s3_bucket_arn : ""))
2020
}
2121
}
2222

outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ output "s3_bucket_id" {
3939
}
4040

4141
output "s3_bucket_arn" {
42-
value = coalesce((length(aws_s3_bucket.bucket) > 0 ? aws_s3_bucket.bucket[0].arn : ""), var.existing_cloudtrail.s3_bucket_arn)
42+
value = coalesce((length(aws_s3_bucket.bucket) > 0 ? aws_s3_bucket.bucket[0].arn : ""), (var.existing_cloudtrail != null ? var.existing_cloudtrail.s3_bucket_arn : ""))
4343
}
4444

4545
output "iam_role_name" {

0 commit comments

Comments
 (0)