Class Image
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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.imagebuilder.alpha.IImage
IImage.Jsii$Default, IImage.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedImage(software.amazon.jsii.JsiiObjectRef objRef) Image(software.constructs.Construct scope, String id, ImageProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IImagefromImageArn(software.constructs.Construct scope, String id, String imageArn) (experimental) Import an existing image given its ARN.static IImagefromImageAttributes(software.constructs.Construct scope, String id, ImageAttributes attrs) (experimental) Import an existing image by providing its attributes.static IImagefromImageName(software.constructs.Construct scope, String id, String imageName) (experimental) Import an existing image given its name.(experimental) The execution role used for the image build.(experimental) The ARN of the image.(experimental) The AMI ID of the EC2 AMI, or URI for the container.(experimental) The name of the image.(experimental) The version of the image.(experimental) The infrastructure configuration used for the image build.grant(IGrantable grantee, String... actions) (experimental) Grant custom actions to the given grantee for the image.(experimental) Grants the default permissions for building an image to the provided execution role.grantRead(IGrantable grantee) (experimental) Grant read permissions to the given grantee for the image.static Boolean(experimental) Return whether the given object is an Image.(experimental) Converts the image to a BaseImage, to use as the parent image in an image recipe.(experimental) Converts the image to a ContainerBaseImage, to use as the parent image in a container recipe.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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
(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]
-
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:
grantDefaultExecutionRolePermissionsin interfaceIImage- Parameters:
grantee- The execution role used for the image build. This parameter is required.
-
grantRead
(experimental) Grant read permissions to the given grantee for the image.[disable-awslint:no-grants]
-
toBaseImage
(experimental) Converts the image to a BaseImage, to use as the parent image in an image recipe.- Specified by:
toBaseImagein interfaceIImage
-
toContainerBaseImage
(experimental) Converts the image to a ContainerBaseImage, to use as the parent image in a container recipe.- Specified by:
toContainerBaseImagein interfaceIImage
-
getImageArn
(experimental) The ARN of the image.- Specified by:
getImageArnin interfaceIImage
-
getImageId
(experimental) The AMI ID of the EC2 AMI, or URI for the container. -
getImageName
(experimental) The name of the image.- Specified by:
getImageNamein interfaceIImage
-
getImageVersion
(experimental) The version of the image.- Specified by:
getImageVersionin interfaceIImage
-
getInfrastructureConfiguration
@Stability(Experimental) @NotNull public IInfrastructureConfiguration getInfrastructureConfiguration()(experimental) The infrastructure configuration used for the image build. -
getExecutionRole
(experimental) The execution role used for the image build.
-