1 Answer
- Newest
- Most votes
- Most comments
0
AMI ID: amzn2-ami-ecs-hvm-2.0.20200115-x86_64-ebs (ami-03f05a4c7314d92be)
1.
I add this role 'AmazonEC2ContainerServiceforEC2Role' to the ECS Task Executioner (Cloud Formation ECS service stack). Delete and rerun create-stack
TaskExecutionRole:
Type: AWS::IAM::Role
Properties:
Path: /
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ecs-tasks.amazonaws.com
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
- arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role
(ssh onto the instance, then)
2 install ecs and starts it
$ sudo amazon-linux-extras install -y ecs
$ sudo yum update -y ecs-init
Loaded plugins: priorities, update-motd, upgrade-helper
No packages marked for update
Note:
The way in https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-install.html to start ecs doesn't work for me.
$ service docker restart && sudo start ecs
sudo: start: command not found
3 Test launching tasks
From AWS ECS Console, I then manually launched new task like the one created & stopped by CF stack.
- The tasks stopped again.
Task failed to start
Nginx, webapp tasks does have any Cloud Watch Log. But mysql task does ping down to some settings problem, so I fixed it there.
answered 5 years ago
Relevant content
- asked 5 years ago
- asked 5 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 7 months ago