I want to create jobs in AWS Batch that vary on the image that is used to launch the container. I'd like to do this without creating a different Job Definition for each image. Is it possible to parameterize the image property using job definition parameters? If not, what's the best way to achieve this or do I have to just create job definitions on the fly in my application?
I would really love this functionality as well. Sadly, it appears the current answer is no.
Batch allows parameters
, but they're only for the command
.
You may be able to find a workaround be using a :latest
tag, but then you're buying a ticket to :latest
hell.
My current solution is to use my CI pipeline to update all dev
job definitions using the aws cli (describe-job-definitions
then register-job-definition)
on each tagged commit.
To keep my infrastructure-as-code consistent, I've moved the version for batch job definitions into an environment variable that I retrieve before running any terraform commands.
Typically you make a job definition for a docker image. However that job definition and docker can certainly do anything you've programmed it to do so it can be multi-purpose and you pass in whatever parameter or command line you would like to execute.
You can override most of the parameters in a Job definition when you submit the job.
Image
property dynamically –
Kylstra © 2022 - 2024 — McMap. All rights reserved.