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.

demandé il y a 2 ans346 vues
1 réponse

Turns out I look at the wrong ec2

répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions