How to use named ECR Image AWS::Batch::JobDefinition

I’ve successfully used the serverless to build ECR images under provider:ecr:images:imagename:path and then referencing the image by name in a function. But I’d like to let serverless manage the heavy lifting (building, updating, deploying and referencing the digest) the image when it changes and then reference the path in an AWS Batch JobDefinition defined in my serverless.yaml files resources section.

I’ve got 2 problems -

  1. Unless I make a function and reference the image, it doesn’t get built.
  2. I can’t figure out how to reference the image path in the resources section. I’ve tried Image: "${self:provider:ecr:images:image-name}", but it throws an error saying it expected a string.

Any ideas? Is this even possible?