Learn
2 min readJul 8, 2022

Notes from bringing up an application in ECS through CloudFormation

HTTP error code standardization helps

502 Bad gateway error
The HyperText Transfer Protocol (HTTP) 502 Bad Gateway server error response code indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server.

On attempting to access the application through the ALB(Application Load Balancer), got a 502 error. Error code description points to an upstream server. In the context of ALB setup for ECS, the target group is the upstream server the ALB is communicating with. Hence, ensure that the target group is in a healthy state before attempting to access the application throught the ALB again.

CloudFormation stack rollback takes a long time

Sometimes, you need to rollback a cloudformation stack. And the rollback takes a while. One way this can be speeded up is to set the number of instances in the target group to zero from the AWS UI.

Use full path in entry point script

It helps to have full path reference for the jars and config files that are being referenced from your entry point script to ensure that the files would be picked up accurately.

AWS CLI is handy

AWS CLI is pretty easy to use and can potentially be wired up in shell scripts pretty easily if required. Responses are in JSON format, which programs can read through as required and make subsequent cals to AWS CLI if required.

Learn
Learn

Written by Learn

On a continuing learning journey..

No responses yet