Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch IAM role best practices #149

Closed
jkeifer opened this issue Aug 24, 2022 · 0 comments · Fixed by #150
Closed

Batch IAM role best practices #149

jkeifer opened this issue Aug 24, 2022 · 0 comments · Fixed by #150
Assignees
Milestone

Comments

@jkeifer
Copy link
Collaborator

jkeifer commented Aug 24, 2022

After some questions and testing, I have established the following best practices around batch IAM roles:

  • The service role is not required on compute environments. A default service role is created automatically when creating the first compute environment that has that role unspecified.
  • The compute environment instance role should not have any additional permissions added to it beyond those required for ECS. Strangely, it is required, and because it is passed to EC2 instances it actually requires an associated profile. We create all that in the cirrus-geo built-ins.
  • Custom permissions required by a batch job should be specified on a role specific to that batch job, and provided as the job definition job role.

The purpose of a batch job execution role is still unclear to me, and I see no reason to use it (save for with fargate tasks where it is required, but I haven't used those so I don't know what all it needs permissions-wise). Unless, of course, someone can provide an explanation what problems it can solve better than the other roles.

As a result, here are three clear action items for cirrus:

  • All the custom perms we've been stuffing into the instance role should move to a batch job role (specified on the batch job via JobRoleArn in the ContainerProperties). We can create a builtin role name BatchJobRole with the base set of permissions, but encourage users to create on role per task with the unique set of permission per task specified there.
  • We should remove the BatchServiceRole and all references to it.
  • The BatchInstanceRole should be updated to have the ECS permission set and nothing more.
@jkeifer jkeifer added this to the 0.7.0 milestone Aug 24, 2022
@jkeifer jkeifer self-assigned this Aug 24, 2022
jkeifer added a commit that referenced this issue Aug 24, 2022
@jkeifer jkeifer linked a pull request Sep 8, 2022 that will close this issue
jkeifer added a commit that referenced this issue Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant