Skip to content

Commit

Permalink
fix: enclosed flow_log destination_options block inside conditional d…
Browse files Browse the repository at this point in the history
…ynamic block
  • Loading branch information
kamialie committed Oct 15, 2021
1 parent a93c233 commit 5bcc320
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions vpc-flow-logs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ resource "aws_flow_log" "this" {
vpc_id = local.vpc_id
max_aggregation_interval = var.flow_log_max_aggregation_interval

destination_options {
file_format = var.flow_log_file_format
hive_compatible_partitions = var.flow_log_hive_compatible_partitions
per_hour_partition = var.flow_log_per_hour_partition
dynamic "destination_options" {
for_each = var.flow_log_destination_type == "s3" ? [true] : []

content {
file_format = var.flow_log_file_format
hive_compatible_partitions = var.flow_log_hive_compatible_partitions
per_hour_partition = var.flow_log_per_hour_partition
}
}

tags = merge(var.tags, var.vpc_flow_log_tags)
Expand Down

0 comments on commit 5bcc320

Please sign in to comment.