terraform-aws-ecs-container-definition
terraform-aws-ecs-container-definition copied to clipboard
Log Configuration Options should be options
Found a bug? Maybe our Slack Community can help.
Describe the Bug
According to the log configuration documentation, the options section is not required. Our use case for this is a docker container with log configuration embedded in the dockerfile to allow for multiple outputs when using ECS Fargate.
If you try to create a container definition with the following setup
log_configuration = {
logDriver = "json-file"
}
You will get the following error:
Error: Invalid function argument
on .terraform/modules/fargate.container_definition/main.tf line 45, in locals:
45: options = tomap(lookup(var.log_configuration, "options"))
|----------------
| var.log_configuration is object with 1 attribute "logDriver"
Invalid value for "inputMap" parameter: the given object has no attribute
"options"
Expected Behavior
The container definition should be created with empty options.
Unfortunately every key needs to be defined
See this in our examples
https://github.com/cloudposse/terraform-aws-ecs-container-definition/blob/ec4c4a662fe3f5d9d8cf594a41d31e10e13bd8f9/examples/complete/fixtures.us-east-2.tfvars#L49-L56
For every key that is unneeded, try using null
https://github.com/cloudposse/terraform-aws-ecs-container-definition/pull/154 should resolve