Skip to content

Commit

Permalink
docs(batch): Clearer explanation on changes to the baseline AMI of th…
Browse files Browse the repository at this point in the history
…e compute resources (#9460)

Made it more clear in docs on how to update AWS Batch's underlying AMIs.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
robertd authored Aug 5, 2020
1 parent ba1427f commit 93657b7
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/@aws-cdk/aws-batch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,36 @@ Below is an example:
const computeEnv = batch.ComputeEnvironment.fromComputeEnvironmentArn(this, 'imported-compute-env', 'arn:aws:batch:us-east-1:555555555555:compute-environment/My-Compute-Env');
```

### Change the baseline AMI of the compute resources

Ocassionally, you will need to deviate from the default processing AMI.

ECS Optimized Amazon Linux 2 example:

```ts
const myComputeEnv = new batch.ComputeEnvironment(this, 'ComputeEnv', {
computeResources: {
image: new ecs.EcsOptimizedAmi({
generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2,
}),
vpc,
}
});
```

Custom based AMI example:

```ts
const myComputeEnv = new batch.ComputeEnvironment(this, 'ComputeEnv', {
computeResources: {
image: ec2.MachineImage.genericLinux({
"[aws-region]": "[ami-ID]",
})
vpc,
}
});
```

## Job Queue

Jobs are always submitted to a specific queue. This means that you have to create a queue before you can start submitting jobs. Each queue is mapped to at least one (and no more than three) compute environment. When the job is scheduled for execution, AWS Batch will select the compute environment based on ordinal priority and available capacity in each environment.
Expand Down

0 comments on commit 93657b7

Please sign in to comment.