Which role do I have to use for the Fargate tasks on AWS Batch?

0

I'm running Fargate in AWS Batch. If I want to give the task S3 access, which of the following Roles should I add the policy to?

  • AWS Batch execution IAM role
  • job role

I know that Fargate uses task roles. However, there was no setting item called task role in AWS Batch.

Best regards,

SDOne
asked 2 years ago1589 views
1 Answer
2
Accepted Answer

It's job role. The Job role configuration field in the UI has this bulrb: "You can optionally specify an IAM role that provides the container in your job with permissions to use the AWS APIs. This feature uses Amazon ECS IAM roles for tasks functionality." That is what you want to use if you want to grant the process in your container access to, say, S3 (or any other AWS service).

The job execution role is assigned to the low level agent and it enables it to pull the container image from ECR, it enables it to read from Secrets Manager and pass the secrets to the containers as variable, and a few other low level infra things.

AWS
EXPERT
answered 2 years ago
profile picture
EXPERT
reviewed 9 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions