`examples/complete` -- advancedConfiguration field is required for all loadBalancers when using the linear deployment strategy
Description
On clean (new) install (terraform apply) of examples/complete, it fails with this error:
β Error: creating ECS Service (ecsdemo-frontend): operation error ECS: CreateService, https response error StatusCode: 400, RequestID: c56fde76-8bdf-4d23-8853-e225514c57cf, ClientException: advancedConfiguration field is required for all loadBalancers when using the linear deployment strategy
β
β with module.ecs.module.service["ecsdemo-frontend"].aws_ecs_service.this[0],
β on ../../modules/service/main.tf line 39, in resource "aws_ecs_service" "this":
β 39: resource "aws_ecs_service" "this" {
I think this was introduced in https://github.com/terraform-aws-modules/terraform-aws-ecs/pull/371
The following may be the correct solution, but I have not implemented it / tried it
The load_balancer block should include advanced_configuration as shown in examples/fargate/main.tf:
load_balancer = {
service = {
target_group_arn = module.alb.target_groups["ex_ecs"].arn
container_name = local.container_name
container_port = local.container_port
advanced_configuration = {
alternate_target_group_arn = module.alb.target_groups["ex_ecs_alternate"].arn
production_listener_rule = module.alb.listener_rules["ex_http/production"].arn
test_listener_rule = module.alb.listener_rules["ex_http/test"].arn
role_arn = aws_iam_role.ecs_elb_permissions.arn
}
}
}
This also requires:
-
An alternate target group in the ALB module
-
Production and test listener rules
-
IAM role with ECS ELB permissions (see examples/fargate/main.tf lines 447-475)
-
[x] β I have searched the open/closed issues and my issue is not listed.
β οΈ Note
Before you submit an issue, please perform the following first:
- Remove the local
.terraformdirectory (! ONLY if state is stored remotely, which hopefully you are following that best practice!):rm -rf .terraform/ - Re-initialize the project root to pull down modules:
terraform init - Re-attempt your terraform plan or apply and check if the issue still persists
Versions
-
Module version [Required]: 6.10.0
-
Terraform version: v1.14.2
- Provider version(s): AWS Provider: v6.26.0
cd terraform-aws-ecs/examples/complete
terraform init
terraform apply
Are you using workspaces: No
Have you cleared the local cache (see Notice section above)?: Yes