Class EcrImage

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ecs.ContainerImage
software.amazon.awscdk.services.ecs.EcrImage
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:47.298Z") @Stability(Stable) public class EcrImage extends ContainerImage
An image from an Amazon ECR repository.

Example:

 import software.amazon.awscdk.services.ecr.*;
 IRepository repo = Repository.fromRepositoryName(this, "batch-job-repo", "todo-list");
 JobDefinition.Builder.create(this, "batch-job-def-from-ecr")
         .container(JobDefinitionContainer.builder()
                 .image(new EcrImage(repo, "latest"))
                 .build())
         .build();
 
  • Constructor Details

    • EcrImage

      protected EcrImage(software.amazon.jsii.JsiiObjectRef objRef)
    • EcrImage

      protected EcrImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • EcrImage

      @Stability(Stable) public EcrImage(@NotNull IRepository repository, @NotNull String tagOrDigest)
      Constructs a new instance of the EcrImage class.

      Parameters:
      repository - This parameter is required.
      tagOrDigest - This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public ContainerImageConfig bind(@NotNull Construct _scope, @NotNull ContainerDefinition containerDefinition)
      Called when the image is used by a ContainerDefinition.

      Specified by:
      bind in class ContainerImage
      Parameters:
      _scope - This parameter is required.
      containerDefinition - This parameter is required.
    • getImageName

      @Stability(Stable) @NotNull public String getImageName()
      The image name. Images in Amazon ECR repositories can be specified by either using the full registry/repository:tag or registry/repository@digest.

      For example, 012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>:latest or 012345678910.dkr.ecr.<region-name>.amazonaws.com/<repository-name>@sha256:94afd1f2e64d908bc90dbca0035a5b567EXAMPLE.