3
votes

I've been able to create a Compute Environment, a Job Queue and about a dozen Job Definitions using CloudFormation. Great!

Unless I'm missing something, there doesn't seem to be an element to actually submit my Job Definitions using CloudFormation. :(

At first, I thought I had it figured out because you can create CloudWatch Events that trigger a Job Submission. However, I notice that the Event Rule in CloudFormation does not have support for Batch like the CLI/SDK does. Lame!

Anyone else deploying Batch with CloudFormation? How are you submitting jobs? I guess I can create a Custom Resource, but that seems harder than it should be.

2

2 Answers

1
votes

Does https://docs.aws.amazon.com/batch/latest/userguide/batch-cwe-target.html solve your problem?

AWS Batch jobs are available as CloudWatch Events targets. Using simple rules that you can quickly set up, you can match events and submit AWS Batch jobs in response to them.

When you create a new rule, add the batch job as a target.

0
votes

The easiest way would be to create a Lambda function. You can create it via CF and capture your requirement in the function code.

Or like you mentioned, you can create a custom resource.