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
已提问 2 年前1629 查看次数
1 回答
2
已接受的回答

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
专家
已回答 2 年前
profile picture
专家
已审核 10 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则