EcrImage

class aws_cdk.aws_ecs.EcrImage(repository, tag)

Bases: aws_cdk.aws_ecs.ContainerImage

An image from an Amazon ECR repository.

__init__(repository, tag)

Constructs a new instance of the EcrImage class.

Parameters
Return type

None

Methods

bind(_scope, container_definition)

Called when the image is used by a ContainerDefinition.

Parameters
Return type

ContainerImageConfig

Attributes

image_name

tag or registry/repository@digest.

For example, 012345678910.dkr.ecr..amazonaws.com/:latest or 012345678910.dkr.ecr..amazonaws.com/@sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE.

Type

The image name. Images in Amazon ECR repositories can be specified by either using the full registry/repository

Return type

str

Static Methods

classmethod from_asset(directory, *, build_args=None, target=None)

Reference an image that’s constructed directly from sources on disk.

Parameters
  • directory (str) – The directory containing the Dockerfile.

  • props

  • build_args (Optional[Mapping[str, str]]) – The arguments to pass to the docker build command. Default: none

  • target (Optional[str]) – Docker target to build to. Default: none

Return type

AssetImage

classmethod from_ecr_repository(repository, tag=None)

Reference an image in an ECR repository.

Parameters
Return type

EcrImage

classmethod from_registry(name, *, credentials=None)

Reference an image on DockerHub or another online registry.

Parameters
  • name (str) –

  • props

  • credentials (Optional[ISecret]) – The secret to expose to the container that contains the credentials for the image repository. The supported value is the full ARN of an AWS Secrets Manager secret.

Return type

RepositoryImage