Private registry authentication for jobs - Amazon Batch
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Private registry authentication for jobs

Private registry authentication for jobs using Amazon Secrets Manager enables you to store your credentials securely and then reference them in your job definition. This provides a way to reference container images that exist in private registries outside of Amazon that require authentication in your job definitions. This feature is supported by jobs hosted on Amazon EC2 instances and Fargate.

Important

If your job definition references an image that's stored in Amazon ECR, this topic doesn't apply. For more information, see Using Amazon ECR Images with Amazon ECS in the Amazon Elastic Container Registry User Guide.

For jobs hosted on Amazon EC2 instances, this feature requires version 1.19.0 or later of the container agent. However, we recommend using the latest container agent version. For information about how to check your agent version and update to the latest version, see Updating the Amazon ECS container agent in the Amazon Elastic Container Service Developer Guide.

For jobs hosted on Fargate, this feature requires platform version 1.2.0 or later. For information, see Amazon Fargate Linux platform versions in the Amazon Elastic Container Service Developer Guide.

Within your container definition, specify the repositoryCredentials object with the details of the secret that you created. The secret you reference can be from a different Amazon Web Services Region or a different account than the job using it.

Note

When using the Amazon Batch API, Amazon CLI, or Amazon SDK, if the secret exists in the same Amazon Web Services Region as the job that you're launching then you can use either the full ARN or name of the secret. If the secret exists in a different account, the full ARN of the secret must be specified. When using the Amazon Web Services Management Console, the full ARN of the secret must be specified always.

The following is a snippet of a job definition that shows the required parameters:

"containerProperties": [ { "image": "private-repo/private-image", "repositoryCredentials": { "credentialsParameter": "arn:aws-cn:secretsmanager:region:123456789012:secret:secret_name" } } ]