You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: document the minimal IAM policy for the executor
Add a "Required IAM permissions" section to docs/further.md giving the minimal
core policy the executor role needs (batch:SubmitJob/DescribeJobs/
RegisterJobDefinition/DeregisterJobDefinition/TerminateJob/DescribeJobQueues/
DescribeComputeEnvironments and iam:PassRole), plus a single tags add-on
(batch:TagResource, with an ecs:TagResource note for tag propagation). Each
permission is tied to the feature that needs it, and the register/deregister
and PassRole statements are called out as conditional (pre-existing job
definitions, and only when --aws-batch-job-role is set). Cross-linked from the
README.
A Snakemake executor plugin for submitting jobs to AWS Batch. Documentation can be found in the [Snakemake plugin catalog](https://snakemake.github.io/snakemake-plugin-catalog/plugins/executor/aws-batch.html).
4
+
5
+
For the minimal IAM policy and the tags add-on required to run the executor, see [docs/further.md — Required IAM permissions](docs/further.md#required-iam-permissions).
-`batch:DescribeJobQueues` and `batch:DescribeComputeEnvironments` detect
68
+
whether a queue is backed by EC2 or Fargate so the plugin builds a compatible
69
+
job definition. They are used only by the default register-per-job path; with
70
+
a pre-existing job definition (`--aws-batch-job-definition`) they can be
71
+
omitted too.
72
+
-`batch:RegisterJobDefinition` and `batch:DeregisterJobDefinition` are only
73
+
needed when the plugin registers a job definition per job (the default). If
74
+
you use a pre-existing job definition (`--aws-batch-job-definition`), both can
75
+
be omitted — see [Pre-existing Job Definitions](#pre-existing-job-definitions).
76
+
- The `PassJobRole` statement is required in the default (register-per-job)
77
+
mode: a job role is mandatory (`--aws-batch-job-role` /
78
+
`SNAKEMAKE_AWS_BATCH_JOB_ROLE`) and is baked into every registered job
79
+
definition, so `iam:PassRole` on that role is always exercised. It can be
80
+
omitted only when you use a pre-existing job definition
81
+
(`--aws-batch-job-definition`), where the plugin neither registers a
82
+
definition nor passes a role (the pre-existing definition carries its own
83
+
role). Scope its `Resource` to that specific job role ARN.
84
+
85
+
## Add-on: tags (`--aws-batch-tags` or `SNAKEMAKE_AWS_BATCH_JOB_TAGS`)
86
+
87
+
```json
88
+
{
89
+
"Sid": "BatchTagResource",
90
+
"Effect": "Allow",
91
+
"Action": "batch:TagResource",
92
+
"Resource": "*"
93
+
}
94
+
```
95
+
96
+
`batch:TagResource` authorizes the tag-on-create when jobs and job definitions
97
+
are submitted with tags; without it, submission fails with `AccessDenied`
98
+
whenever tags are configured. Depending on your account's ECS
99
+
tagging-authorization settings you may additionally need `ecs:TagResource` on
100
+
`*`, because AWS Batch propagates tags to the ECS resources it manages.
101
+
31
102
# Rule-Specific Container Images
32
103
33
104
By default, all jobs use the global container image specified via `--container-image`. However, you can specify a different container image for individual rules using the `aws_batch_container_image` resource parameter:
0 commit comments