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.

gefragt vor 2 Jahren348 Aufrufe
1 Antwort

Turns out I look at the wrong ec2

beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen