Fails to update existing ECS non-loadbalanced service when adding to load balancer
See original GitHub issueDescribe the bug
When there is an existing ECS service which is not initially configured with a load balancer, and a change is made to add this service to a target group for an ALB, the CFN change performed is an UPDATE. However this is not possible since ALB assignment can only be done to an ECS service during creation.
Expected Behavior
In this scenario the change should recreate the service resource rather than update it.
Current Behavior
Update fails with the following message:
Resource handler returned message: "Invalid request provided: UpdateService error: Health check grace period is only valid for services configured to use load balancers (Service: AmazonECS; Status Code: 400; Error Code: InvalidParameterException; Request ID: xxxyyyzzz; Proxy: null)"
Reproduction Steps
- Create a
FargateService
which is not backed by a load balancer. - Deploy
- Add the service from step 1 as a target to an ALB’s listener
- Deploy
Possible Solution
Rather than making the change as an update, it should recreate the service resource in order to assign the ALB correctly.
Additional Information/Context
No response
CDK CLI Version
2.20.0 (build 738ef49)
Framework Version
No response
Node.js Version
v17.8.0
OS
Ubuntu 21.10 (5.17.0-051700-generic)
Language
Typescript
Language Version
4.6.2
Other information
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:34
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Troubleshooting service load balancers - AWS Documentation
Amazon ECS services can register tasks with an Elastic Load Balancing load balancer. Load balancer configuration errors are common causes for stopped tasks....
Read more >Spinnaker Release 1.14.2
To change this behavior for a specific application, modify the application config in the UI to explicitly add EXECUTE permissions to a group....
Read more >Updating a service using the new console - 亚马逊云科技
Amazon ECS does not automatically update the security groups associated with Elastic Load Balancing load balancers or Amazon ECS container instances.
Read more >aws_ecs_service | Resources | hashicorp/aws
Provides an ECS service - effectively a task that is expected to run until an ... (Optional) Seconds to ignore failing load balancer...
Read more >How to Setup AWS ECS Fargate with a Load Balancer
This is a step by step tutorial where I show you how to set up a basic Python based AWS Fargate App within...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
works for me
I’m not sure how I ran into the deployment stall after i deleted the health check from my template. Must have been an intermittent issue 😕
We should be able to support adding a load balancer to a service without requiring that users use an escape hatch to remove the property