Pulling docker image from ECR using task definition


Hi, Im trying to setup my web app manually because I dont want to dive straight into Infrastructure as code or tools, if possible I want to know and play around with the AWS components.

I have this EC2:


And put it inside my ECS cluster:
I have this postgresql RDS:
This is the security group I set up for ec2 to connect to rds:
I have set up a task definition to pull docker image from my ECR:

I have run the task definition on my cluster but it always fail at the step to connect to the RDS database:

I have telnet and psql to that address from EC2 terminal and it is successful. Why am I not able to run docker image from task definition? I think it pulled from ECR correctly but when running the docker image, it is not able to connect to the db. Thanks

Update: I changed network setting of the task to awsvpc instead of bridge, and set it to security group of my EC2. It keeps running with no logs. I dont know what is happening, whether the web app is deployed or not.

preguntada hace 2 años343 visualizaciones
1 Respuesta

Turns out I look at the wrong ec2

respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas