Skip to content

Commit 9f88e2e

Browse files
committed
fix: use length on s3_check for updated role policy for s3 read access
1 parent 5dd7dc4 commit 9f88e2e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

examples/simple/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,7 @@ module "default" {
5353
kms_alias = aws_kms_alias.datadog.name
5454
dd_api_key_secret_arn = data.aws_secretsmanager_secret.datadog_api_key.arn
5555

56+
depends_on = [aws_kms_alias.datadog]
57+
5658
tags = { Environment = "test" }
5759
}

modules/log_forwarder/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ resource "aws_iam_policy" "this" {
9696
"${path.module}/policy.tmpl",
9797
{
9898
vpc_check = var.subnet_ids != null
99-
s3_check = var.s3_log_bucket_arns != []
99+
s3_check = length(var.s3_log_bucket_arns) > 0
100100
s3_log_bucket_arns = jsonencode(var.s3_log_bucket_arns)
101101
datadog_s3_bucket = "arn:aws:s3:::${local.bucket_name}"
102102
dd_api_key_secret_arn = var.dd_api_key_secret_arn

modules/vpc_flow_log_forwarder/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ resource "aws_iam_policy" "this" {
5959
"${path.module}/policy.tmpl",
6060
{
6161
vpc_check = var.subnet_ids != null
62-
s3_check = var.s3_log_bucket_arns == []
62+
s3_check = length(var.s3_log_bucket_arns) > 0
6363
s3_log_bucket_arns = jsonencode(var.s3_log_bucket_arns)
6464
kms_arn = data.aws_kms_key.this.arn
6565
}

0 commit comments

Comments
 (0)