2 Answers
- Newest
- Most votes
- Most comments
0
Hello.
First, try creating an EC2 launch type ECS cluster by following the steps in the document below.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-ec2-cluster-console-v2.html
Also, were there any errors when you started the ECS task?
0
Currently, ECS can work on EC2, so I propose updating the solution to this issue as follows:
- Modify the AMI of Launch Templates to Amazon ECS-Optimized Amazon Linux 2023 (AL2023) x86_64 AMI instead of the commonly used Amazon Linux 2023.
- Switch to larger EC2 instances. I suspect this is related to ECS requiring additional operational resources.
- Adjust Task definitions by adding "cpu": 1024, "memory": 2048. Although I have already defined "cpu": "1024", "memory": "2048", I still need to define them again. I am unsure why this is necessary. I referred to https://docs.aws.amazon.com/zh_tw/AmazonECS/latest/developerguide/getting-started-ecs-ec2-v2.html and noticed it defines them twice. Hence, I followed suit. If anyone knows the reason behind this, please enlighten me.
answered a year ago
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
Hi, Riku I have created a cluster according to https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-ec2-cluster-console-v2.html. I haven't received any errors from ECS tasks. It's just that the status remains stuck at 'Provisioning' continuously. I'm very confused and not sure where the problem. It's worth noting that it has been in the 'Provisioning' state for 2 hours now.
Is the EC2 instance running the task started? Also, if it is running, is a public IP set to access the container image from EC2? If you do not have a public IP etc., please try using NAT Gateway etc. Please also check if any other IAM policies required for the task execution role are attached. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_execution_IAM_role.html
I have confirmed that instances are activated with public IPv4 addresses and are running in the infrastructure. There are two machines for container instances, both in an active state. Regarding permissions, it appears that both ecsTaskExecutionRole and ecsInstanceRole align with the documentation. They have been assigned the following policies: ecsTaskExecutionRole : AmazonECSTaskExecutionRolePolicy ( type : AWS managed) ecsInstanceRole: AmazonEC2ContainerServiceforEC2Role ( type: AWS managed)