java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.imagebuilder.alpha.Image
All Implemented Interfaces:
IEnvironmentAware, IResource, IImage, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.125.0 (build fdbe357)", date="2026-01-19T12:04:05.899Z") @Stability(Experimental) public class Image extends Resource implements IImage
(experimental) Represents an EC2 Image Builder Image.

Example:

 ContainerRecipe containerRecipe = ContainerRecipe.Builder.create(this, "MyContainerRecipe")
         .baseImage(BaseContainerImage.fromDockerHub("amazonlinux", "latest"))
         .targetRepository(Repository.fromEcr(Repository.fromRepositoryName(this, "Repository", "my-container-repo")))
         .build();
 Image containerImage = Image.Builder.create(this, "MyContainerImage")
         .recipe(containerRecipe)
         .build();
 

See Also:
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Experimental) public static final String PROPERTY_INJECTION_ID
      (experimental) Uniquely identifies this class.
  • Constructor Details

    • Image

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

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

      @Stability(Experimental) public Image(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ImageProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromImageArn

      @Stability(Experimental) @NotNull public static IImage fromImageArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String imageArn)
      (experimental) Import an existing image given its ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      imageArn - This parameter is required.
    • fromImageAttributes

      @Stability(Experimental) @NotNull public static IImage fromImageAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ImageAttributes attrs)
      (experimental) Import an existing image by providing its attributes.

      If the image name is provided as an attribute, it must be normalized by converting all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • fromImageName

      @Stability(Experimental) @NotNull public static IImage fromImageName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String imageName)
      (experimental) Import an existing image given its name.

      The provided name must be normalized by converting all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      imageName - This parameter is required.
    • isImage

      @Stability(Experimental) @NotNull public static Boolean isImage(@NotNull Object x)
      (experimental) Return whether the given object is an Image.

      Parameters:
      x - This parameter is required.
    • grant

      @Stability(Experimental) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions)
      (experimental) Grant custom actions to the given grantee for the image.

      [disable-awslint:no-grants]

      Specified by:
      grant in interface IImage
      Parameters:
      grantee - The principal. This parameter is required.
      actions - The list of actions. This parameter is required.
    • grantDefaultExecutionRolePermissions

      @Stability(Experimental) @NotNull public List<Grant> grantDefaultExecutionRolePermissions(@NotNull IGrantable grantee)
      (experimental) Grants the default permissions for building an image to the provided execution role.

      [disable-awslint:no-grants]

      Specified by:
      grantDefaultExecutionRolePermissions in interface IImage
      Parameters:
      grantee - The execution role used for the image build. This parameter is required.
    • grantRead

      @Stability(Experimental) @NotNull public Grant grantRead(@NotNull IGrantable grantee)
      (experimental) Grant read permissions to the given grantee for the image.

      [disable-awslint:no-grants]

      Specified by:
      grantRead in interface IImage
      Parameters:
      grantee - The principal. This parameter is required.
    • toBaseImage

      @Stability(Experimental) @NotNull public BaseImage toBaseImage()
      (experimental) Converts the image to a BaseImage, to use as the parent image in an image recipe.
      Specified by:
      toBaseImage in interface IImage
    • toContainerBaseImage

      @Stability(Experimental) @NotNull public BaseContainerImage toContainerBaseImage()
      (experimental) Converts the image to a ContainerBaseImage, to use as the parent image in a container recipe.
      Specified by:
      toContainerBaseImage in interface IImage
    • getImageArn

      @Stability(Experimental) @NotNull public String getImageArn()
      (experimental) The ARN of the image.
      Specified by:
      getImageArn in interface IImage
    • getImageId

      @Stability(Experimental) @NotNull public String getImageId()
      (experimental) The AMI ID of the EC2 AMI, or URI for the container.
    • getImageName

      @Stability(Experimental) @NotNull public String getImageName()
      (experimental) The name of the image.
      Specified by:
      getImageName in interface IImage
    • getImageVersion

      @Stability(Experimental) @NotNull public String getImageVersion()
      (experimental) The version of the image.
      Specified by:
      getImageVersion in interface IImage
    • getInfrastructureConfiguration

      @Stability(Experimental) @NotNull public IInfrastructureConfiguration getInfrastructureConfiguration()
      (experimental) The infrastructure configuration used for the image build.
    • getExecutionRole

      @Stability(Experimental) @Nullable public IRole getExecutionRole()
      (experimental) The execution role used for the image build.