Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Addresses an issue with logging configuration with improper for_each iterator #242

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions modules/vault-elb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ resource "aws_elb" "vault" {

# optional access_logs creation
dynamic "access_logs" {
for_each = var.access_logs == null ? [] : ["once"]
for_each = var.access_logs == null ? [] : [ var.access_logs ]

content {
enabled = lookup(access_logs.value, "enabled", lookup(access_logs.value, "bucket", null))
# enabled flag is optional. The user can choose to specify or not. If not specified we check if bucket param is specified and assume that
# the user wants the logging to be enabled.
enabled = lookup(access_logs.value, "enabled", false) ? lookup(access_logs.value, "enabled") : can(lookup(access_logs.value, "bucket"))
dchernivetsky marked this conversation as resolved.
Show resolved Hide resolved
bucket = lookup(access_logs.value, "bucket", null)
bucket_prefix = lookup(access_logs.value, "bucket_prefix", null)
interval = lookup(access_logs.value, "interval", null)
Expand Down