Interview Prep/AWS/Containers and Serverless

What is the difference between the ECS task role and the task execution role?

IntermediateConceptContainers and Serverless
Answer

The execution role is used by the ECS agent/Fargate to set up the task: pull images from ECR, write logs to CloudWatch, and fetch secrets from Secrets Manager or SSM for secrets: entries. The task role is what your application code assumes at runtime to call AWS APIs like S3 or DynamoDB.

Mixing them up is the classic cause of CannotPullContainerError (execution role) versus AccessDenied from the app (task role).

aws All AWS questions Roadmap: EKS, ECS & serverless on AWS

More on Containers and Serverless