Skip to content

Instantly share code, notes, and snippets.

@monkey-codes
Last active June 17, 2020 01:07
Show Gist options
  • Select an option

  • Save monkey-codes/1b460985fbc0ff1ea426d6bbd81f1bd9 to your computer and use it in GitHub Desktop.

Select an option

Save monkey-codes/1b460985fbc0ff1ea426d6bbd81f1bd9 to your computer and use it in GitHub Desktop.
Fargate cluster task execution role
Resources:
...
ECSTaskExecutionRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
Service: [ecs-tasks.amazonaws.com]
Action: ['sts:AssumeRole']
Path: /
Policies:
- PolicyName: AmazonECSTaskExecutionRolePolicy
PolicyDocument:
Statement:
- Effect: Allow
Action:
# Allow the ECS Tasks to download images from ECR
- 'ecr:GetAuthorizationToken'
- 'ecr:BatchCheckLayerAvailability'
- 'ecr:GetDownloadUrlForLayer'
- 'ecr:BatchGetImage'
# Allow the ECS tasks to upload logs to CloudWatch
- 'logs:CreateLogStream'
- 'logs:PutLogEvents'
Resource: '*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment