Class ContainerInstanceImage
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.imagebuilder.alpha.ContainerInstanceImage
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:50.020Z")
@Stability(Experimental)
public class ContainerInstanceImage
extends software.amazon.jsii.JsiiObject
(experimental) Represents a container instance image that is used to launch the instance used for building the container for an EC2 Image Builder container build.
Example:
ContainerRecipe containerRecipe = ContainerRecipe.Builder.create(this, "InstanceConfigContainerRecipe")
.baseImage(BaseContainerImage.fromDockerHub("amazonlinux", "latest"))
.targetRepository(Repository.fromEcr(Repository.fromRepositoryName(this, "Repository", "my-container-repo")))
// Custom ECS-optimized AMI for building
.instanceImage(ContainerInstanceImage.fromSsmParameterName("/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id"))
// Additional storage for build process
.instanceBlockDevices(List.of(BlockDevice.builder()
.deviceName("/dev/xvda")
.volume(BlockDeviceVolume.ebs(50, EbsDeviceOptions.builder()
.encrypted(true)
.volumeType(EbsDeviceVolumeType.GENERAL_PURPOSE_SSD_GP3)
.build()))
.build()))
.build();
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContainerInstanceImage(String image) protectedContainerInstanceImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedContainerInstanceImage(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic ContainerInstanceImage(experimental) The AMI ID to use to launch the instance for building the container image.static ContainerInstanceImagefromSsmParameter(IStringParameter parameter) (experimental) The SSM parameter to use to launch the instance for building the container image.static ContainerInstanceImagefromSsmParameterName(String parameterName) (experimental) The ARN of the SSM parameter used to launch the instance for building the container image.static ContainerInstanceImagefromString(String containerInstanceImageString) (experimental) The string value of the container instance image to use in a container recipe.getImage()(experimental) The rendered container instance image to use.Methods 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, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ContainerInstanceImage
protected ContainerInstanceImage(software.amazon.jsii.JsiiObjectRef objRef) -
ContainerInstanceImage
protected ContainerInstanceImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ContainerInstanceImage
- Parameters:
image- This parameter is required.
-
-
Method Details
-
fromAmiId
@Stability(Experimental) @NotNull public static ContainerInstanceImage fromAmiId(@NotNull String amiId) (experimental) The AMI ID to use to launch the instance for building the container image.- Parameters:
amiId- The AMI ID to use as the container instance image. This parameter is required.
-
fromSsmParameter
@Stability(Experimental) @NotNull public static ContainerInstanceImage fromSsmParameter(@NotNull IStringParameter parameter) (experimental) The SSM parameter to use to launch the instance for building the container image.- Parameters:
parameter- The SSM parameter to use as the container instance image. This parameter is required.
-
fromSsmParameterName
@Stability(Experimental) @NotNull public static ContainerInstanceImage fromSsmParameterName(@NotNull String parameterName) (experimental) The ARN of the SSM parameter used to launch the instance for building the container image.- Parameters:
parameterName- The name of the SSM parameter used as the container instance image. This parameter is required.
-
fromString
@Stability(Experimental) @NotNull public static ContainerInstanceImage fromString(@NotNull String containerInstanceImageString) (experimental) The string value of the container instance image to use in a container recipe.This can either be:
- an SSM parameter reference, prefixed with
ssm:and followed by the parameter name or ARN - an AMI ID
- Parameters:
containerInstanceImageString- The container instance image as a direct string value. This parameter is required.
- an SSM parameter reference, prefixed with
-
getImage
(experimental) The rendered container instance image to use.
-