ECS task definitions, roles and launch types

The essentials in 30 seconds

before you dive into the details
Picture this

An employee badge and a delivery pass

The employee does the work

Task role → application API calls

The employee badge permits business operations.

The courier prepares the workplace

Execution role → ECS startup calls

The delivery pass permits preparing the workplace.

Where the analogy stops: Both are IAM roles, but the application does not inherit execution-role permissions. Network access is still required.
01Picture this

The employee badge permits business operations. The delivery pass permits preparing the workplace.

02Decision

Separate application permissions from ECS startup permissions before choosing the role.

03In your code

Use taskRoleArn for app calls and executionRoleArn for supported agent operations.

Exam trap

Image-pull permissions in the execution role do not authorize application S3 calls.

One sentence to remember

Separate application permissions from ECS startup permissions before choosing the role.

2 media items5 rule steps5 scenarios6 flashcards

Focus mode