Skip to content

Commit 7bfc001

Browse files
authored
fix: Enabled destination_options only for VPC Flow Logs on S3 (#703)
1 parent a93c233 commit 7bfc001

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

vpc-flow-logs.tf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ resource "aws_flow_log" "this" {
2424
vpc_id = local.vpc_id
2525
max_aggregation_interval = var.flow_log_max_aggregation_interval
2626

27-
destination_options {
28-
file_format = var.flow_log_file_format
29-
hive_compatible_partitions = var.flow_log_hive_compatible_partitions
30-
per_hour_partition = var.flow_log_per_hour_partition
27+
dynamic "destination_options" {
28+
for_each = var.flow_log_destination_type == "s3" ? [true] : []
29+
30+
content {
31+
file_format = var.flow_log_file_format
32+
hive_compatible_partitions = var.flow_log_hive_compatible_partitions
33+
per_hour_partition = var.flow_log_per_hour_partition
34+
}
3135
}
3236

3337
tags = merge(var.tags, var.vpc_flow_log_tags)

0 commit comments

Comments
 (0)