How do I create a role for AWS Batch using the CLI


How do I create a role for AWS Batch jobs on EC2 using the CLI? The role needs to have read-write permissions to an S3 bucket, e.g. s3://mybucket234. The role will be needed for the "aws batch create-compute-environment" command.

1 Answer


You create an ECS-trusted IAM role as follows:

When using the CLI, use the create-role command.

Trust the service using AssumeRole at creation time. Please refer to the following for the method.

profile picture
answered 2 years 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