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.

질문됨 2년 전346회 조회
1개 답변

Turns out I look at the wrong ec2

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠