PrefectHQ / prefect-recipes

Snippets and templates representing common Customer Success patterns
https://PrefectHQ.github.io/prefect-recipes/
Apache License 2.0
238 stars 29 forks source link

Adds permissions for ECS agent to run ECSTasks #189

Closed EmilRex closed 1 year ago

EmilRex commented 1 year ago

Description

This PR changes the default behavior of the agent_task_role_arn variable. If the variable is set, everything behaves as before, in that the provided role is set as the Prefect agent service's task role. However, if the variable is not set, then we will now create a default task role that includes all permissions necessary for the agent to be able to use the ECSTask infrastructure type. Specifically,

ec2:DescribeSubnets
ec2:DescribeVpcs
ecr:BatchCheckLayerAvailability
ecr:BatchGetImage
ecr:GetAuthorizationToken
ecr:GetDownloadUrlForLayer
ecs:DeregisterTaskDefinition
ecs:DescribeTasks
ecs:RegisterTaskDefinition
ecs:RunTask
iam:PassRole
logs:CreateLogGroup
logs:CreateLogStream
logs:GetLogEvents
logs:PutLogEvents

Type of change

New Recipe Checklist