Skip to content

Commit

Permalink
Merge pull request #7 from clientIO/comment-gets-passed-to-var
Browse files Browse the repository at this point in the history
Fix #6
  • Loading branch information
DavidDurman authored May 16, 2024
2 parents 3f3b67c + 710e24d commit 112e240
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions ecs-ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,21 @@ locals {
logstash_env_container = [for k, v in module.services_configuration_merge.merged.logstash.env : { name = k, value = v }]

# ECS EC2 configuration
user_data = <<-EOT
#!/bin/bash
cat <<'EOF' >> /etc/ecs/ecs.config
ECS_CLUSTER=${module.label.id}
ECS_LOGLEVEL=debug
ECS_CONTAINER_INSTANCE_TAGS=${jsonencode(module.label.tags)}
ECS_ENABLE_TASK_IAM_ROLE=true
ECS_ENABLE_HIGH_DENSITY_ENI=true
ECS_ENABLE_SPOT_INSTANCE_DRAINING=true
ECS_ENGINE_AUTH_TYPE=dockercfg
ECS_ENGINE_AUTH_DATA=${sensitive(try(base64decode(var.ecs_registry_auth_data), ""))} # pragma: allowlist secret
EOF
EOT
user_data = join("\n", [
"#!/bin/bash",
"",
"cat <<'EOF' >> /etc/ecs/ecs.config",
"ECS_CLUSTER=${module.label.id}",
"ECS_LOGLEVEL=debug",
"ECS_CONTAINER_INSTANCE_TAGS=${jsonencode(module.label.tags)}",
"ECS_ENABLE_TASK_IAM_ROLE=true",
"ECS_ENABLE_HIGH_DENSITY_ENI=true",
"ECS_ENABLE_SPOT_INSTANCE_DRAINING=true",
"ECS_ENGINE_AUTH_TYPE=dockercfg",
"ECS_ENGINE_AUTH_DATA=${sensitive(try(base64decode(var.ecs_registry_auth_data), ""))}",
"EOF"
])
# pragma: allowlist secret
}

module "alb" {
Expand Down

0 comments on commit 112e240

Please sign in to comment.