-
-
Notifications
You must be signed in to change notification settings - Fork 615
Open
Description
Description
If I provide the container definition for a fluent bit sidecar and I set enable_cloudwatch_logging
and create_cloudwatch_log_group
to false, aws throws an error saying logDriver is required. This only started happening in v6. This is because of this diff in logConfiguration I believe(no longer defaulting to null whenever there is no logConfiguration).

- [x ] ✋ I have searched the open/closed issues and my issue is not listed.
Versions
-
Module version [Required]:
-
Terraform version: v6
- Provider version(s): v6
Reproduction Code
module "ecs" {
source = "terraform-aws-modules/ecs/aws"
...others
services = {
ecsdemo-frontend = {
...others
container_definitions = {
fluent-bit = {
cpu = 512
memory = 1024
essential = true
image = "906394416424.dkr.ecr.us-west-2.amazonaws.com/aws-for-fluent-bit:stable"
firelensConfiguration = {
type = "fluentbit"
}
create_cloudwatch_log_group = false
memoryReservation = 50
}
...others
}
}
Steps to reproduce the behavior:
- Ensure create_cloudwatch_log_group is set to false and no logConfiguration is defined
- Run the terraform code
- It throws an error in aws
Expected behavior
It didnt throw an error before v6 so I dont expect it to throw either. I expect logConfiguration to just be defaulted(in aws) to whatever it usually was.
Actual behavior
It threw an error
Error: creating ECS Task Definition (app1-staging-api): operation error ECS: RegisterTaskDefinition, 1 validation error(s) found.
│ - missing required field, RegisterTaskDefinitionInput.ContainerDefinitions[1].LogConfiguration.LogDriver.
│
│
│ with module.ecs_service["app1-staging-api"].aws_ecs_task_definition.this[0],
│ on .terraform/modules/ecs_service/modules/service/main.tf line 769, in resource "aws_ecs_task_definition" "this":
│ 769: resource "aws_ecs_task_definition" "this" {
│
╵
╷
│ Error: creating ECS Task Definition (app2-staging-api): operation error ECS: RegisterTaskDefinition, 1 validation error(s) found.
│ - missing required field, RegisterTaskDefinitionInput.ContainerDefinitions[1].LogConfiguration.LogDriver.
│
│
│ with module.ecs_service["app2-staging-api"].aws_ecs_task_definition.this[0],
│ on .terraform/modules/ecs_service/modules/service/main.tf line 769, in resource "aws_ecs_task_definition" "this":
│ 769: resource "aws_ecs_task_definition" "this" {
│
╵
Metadata
Metadata
Assignees
Labels
No labels