Experimental
@aws-cdk/aws-imagebuilder-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
AmazonManagedImage Class
Helper class for working with Amazon-managed images.
Example
ts
// Amazon Linux 2023 AMI for x86_64
const amazonLinux2023Ami = imagebuilder.AmazonManagedImage.amazonLinux2023(this, 'AmazonLinux2023', {
imageType: imagebuilder.ImageType.AMI,
imageArchitecture: imagebuilder.ImageArchitecture.X86_64
});
// Ubuntu 22.04 AMI for ARM64
const ubuntu2204Ami = imagebuilder.AmazonManagedImage.ubuntuServer2204(this, 'Ubuntu2204', {
imageType: imagebuilder.ImageType.AMI,
imageArchitecture: imagebuilder.ImageArchitecture.ARM64
});
// Windows Server 2022 Full AMI
const windows2022Ami = imagebuilder.AmazonManagedImage.windowsServer2022Full(this, 'Windows2022', {
imageType: imagebuilder.ImageType.AMI,
imageArchitecture: imagebuilder.ImageArchitecture.X86_64
});
// Use as base image in recipe
const managedImageRecipe = new imagebuilder.ImageRecipe(this, 'ManagedImageRecipe', {
baseImage: amazonLinux2023Ami.toBaseImage()
});
python
# Amazon Linux 2023 AMI for x86_64
amazon_linux2023_ami = imagebuilder.AmazonManagedImage.amazon_linux2023(self, "AmazonLinux2023",
image_type=imagebuilder.ImageType.AMI,
image_architecture=imagebuilder.ImageArchitecture.X86_64
)
# Ubuntu 22.04 AMI for ARM64
ubuntu2204_ami = imagebuilder.AmazonManagedImage.ubuntu_server2204(self, "Ubuntu2204",
image_type=imagebuilder.ImageType.AMI,
image_architecture=imagebuilder.ImageArchitecture.ARM64
)
# Windows Server 2022 Full AMI
windows2022_ami = imagebuilder.AmazonManagedImage.windows_server2022_full(self, "Windows2022",
image_type=imagebuilder.ImageType.AMI,
image_architecture=imagebuilder.ImageArchitecture.X86_64
)
# Use as base image in recipe
managed_image_recipe = imagebuilder.ImageRecipe(self, "ManagedImageRecipe",
base_image=amazon_linux2023_ami.to_base_image()
)
java
// Amazon Linux 2023 AMI for x86_64
IImage amazonLinux2023Ami = AmazonManagedImage.amazonLinux2023(this, "AmazonLinux2023", AmazonManagedImageOptions.builder()
.imageType(ImageType.AMI)
.imageArchitecture(ImageArchitecture.X86_64)
.build());
// Ubuntu 22.04 AMI for ARM64
IImage ubuntu2204Ami = AmazonManagedImage.ubuntuServer2204(this, "Ubuntu2204", AmazonManagedImageOptions.builder()
.imageType(ImageType.AMI)
.imageArchitecture(ImageArchitecture.ARM64)
.build());
// Windows Server 2022 Full AMI
IImage windows2022Ami = AmazonManagedImage.windowsServer2022Full(this, "Windows2022", AmazonManagedImageOptions.builder()
.imageType(ImageType.AMI)
.imageArchitecture(ImageArchitecture.X86_64)
.build());
// Use as base image in recipe
ImageRecipe managedImageRecipe = ImageRecipe.Builder.create(this, "ManagedImageRecipe")
.baseImage(amazonLinux2023Ami.toBaseImage())
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.ImageBuilder.Alpha
// Amazon Linux 2023 AMI for x86_64
var amazonLinux2023Ami = AmazonManagedImage.AmazonLinux2023(this, "AmazonLinux2023", new AmazonManagedImageOptions {
ImageType = ImageType.AMI,
ImageArchitecture = ImageArchitecture.X86_64
});
// Ubuntu 22.04 AMI for ARM64
var ubuntu2204Ami = AmazonManagedImage.UbuntuServer2204(this, "Ubuntu2204", new AmazonManagedImageOptions {
ImageType = ImageType.AMI,
ImageArchitecture = ImageArchitecture.ARM64
});
// Windows Server 2022 Full AMI
var windows2022Ami = AmazonManagedImage.WindowsServer2022Full(this, "Windows2022", new AmazonManagedImageOptions {
ImageType = ImageType.AMI,
ImageArchitecture = ImageArchitecture.X86_64
});
// Use as base image in recipe
var managedImageRecipe = new ImageRecipe(this, "ManagedImageRecipe", new ImageRecipeProps {
BaseImage = amazonLinux2023Ami.ToBaseImage()
});
go
// Install: go get github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2
// Amazon Linux 2023 AMI for x86_64
amazonLinux2023Ami := imagebuilder.AmazonManagedImage_AmazonLinux2023(this, jsii.String("AmazonLinux2023"), &AmazonManagedImageOptions{
ImageType: imagebuilder.ImageType_AMI,
ImageArchitecture: imagebuilder.ImageArchitecture_X86_64,
})
// Ubuntu 22.04 AMI for ARM64
ubuntu2204Ami := imagebuilder.AmazonManagedImage_UbuntuServer2204(this, jsii.String("Ubuntu2204"), &AmazonManagedImageOptions{
ImageType: imagebuilder.ImageType_AMI,
ImageArchitecture: imagebuilder.ImageArchitecture_ARM64,
})
// Windows Server 2022 Full AMI
windows2022Ami := imagebuilder.AmazonManagedImage_WindowsServer2022Full(this, jsii.String("Windows2022"), &AmazonManagedImageOptions{
ImageType: imagebuilder.ImageType_AMI,
ImageArchitecture: imagebuilder.ImageArchitecture_X86_64,
})
// Use as base image in recipe
managedImageRecipe := imagebuilder.NewImageRecipe(this, jsii.String("ManagedImageRecipe"), &ImageRecipeProps{
BaseImage: amazonLinux2023Ami.ToBaseImage(),
})
Initializer
ts
new AmazonManagedImage()
python
AmazonManagedImage()
java
new AmazonManagedImage()
csharp
new AmazonManagedImage()
go
NewAmazonManagedImage()
Methods
amazonLinux2(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def amazon_linux2(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage amazonLinux2(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage AmazonLinux2(Construct scope, string id, AmazonManagedImageOptions opts)func AmazonLinux2(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Amazon Linux 2 Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
amazonLinux2023(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def amazon_linux2023(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage amazonLinux2023(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage AmazonLinux2023(Construct scope, string id, AmazonManagedImageOptions opts)func AmazonLinux2023(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Amazon Linux 2023 Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
fromAmazonManagedImageAttributes(scope: Construct, id: string, attrs: AmazonManagedImageAttributes): IImage@staticmethod def from_amazon_managed_image_attributes(scope: Construct, id: str, attrs: AmazonManagedImageAttributes) -> IImagepublic static IImage fromAmazonManagedImageAttributes(Construct scope, String id, AmazonManagedImageAttributes attrs)public static IImage FromAmazonManagedImageAttributes(Construct scope, string id, AmazonManagedImageAttributes attrs)func FromAmazonManagedImageAttributes(Scope Construct, Id *string, Attrs AmazonManagedImageAttributes) IImagestatic#Imports an Amazon-managed image from its attributes.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.attrsattrsattrsattrsAttrs— - The Amazon-managed image attributes.
fromAmazonManagedImageName(scope: Construct, id: string, amazonManagedImageName: string): IImage@staticmethod def from_amazon_managed_image_name(scope: Construct, id: str, amazon_managed_image_name: str) -> IImagepublic static IImage fromAmazonManagedImageName(Construct scope, String id, String amazonManagedImageName)public static IImage FromAmazonManagedImageName(Construct scope, string id, string amazonManagedImageName)func FromAmazonManagedImageName(Scope Construct, Id *string, AmazonManagedImageName *string) IImagestatic#Imports an Amazon-managed image from its name.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.amazonManagedImageNameamazon_managed_image_nameamazonManagedImageNameamazonManagedImageNameAmazonManagedImageName— - The name of the Amazon-managed image.
macOS14(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def mac_os14(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage macOS14(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage MacOS14(Construct scope, string id, AmazonManagedImageOptions opts)func MacOS14(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the macOS 14 Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
macOS15(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def mac_os15(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage macOS15(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage MacOS15(Construct scope, string id, AmazonManagedImageOptions opts)func MacOS15(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the macOS 15 Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
redHatEnterpriseLinux10(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def red_hat_enterprise_linux10(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage redHatEnterpriseLinux10(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage RedHatEnterpriseLinux10(Construct scope, string id, AmazonManagedImageOptions opts)func RedHatEnterpriseLinux10(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Red Hat Enterprise Linux 10 Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
suseLinuxEnterpriseServer15(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def suse_linux_enterprise_server15(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage suseLinuxEnterpriseServer15(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage SuseLinuxEnterpriseServer15(Construct scope, string id, AmazonManagedImageOptions opts)func SuseLinuxEnterpriseServer15(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the SUSE Linux Enterprise Server 15 Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
ubuntuServer2204(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def ubuntu_server2204(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage ubuntuServer2204(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage UbuntuServer2204(Construct scope, string id, AmazonManagedImageOptions opts)func UbuntuServer2204(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Ubuntu 22.04 Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
ubuntuServer2404(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def ubuntu_server2404(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage ubuntuServer2404(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage UbuntuServer2404(Construct scope, string id, AmazonManagedImageOptions opts)func UbuntuServer2404(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Ubuntu 24.04 Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
windowsServer2016Core(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def windows_server2016_core(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage windowsServer2016Core(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage WindowsServer2016Core(Construct scope, string id, AmazonManagedImageOptions opts)func WindowsServer2016Core(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Windows Server 2016 Core Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
windowsServer2016Full(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def windows_server2016_full(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage windowsServer2016Full(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage WindowsServer2016Full(Construct scope, string id, AmazonManagedImageOptions opts)func WindowsServer2016Full(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Windows Server 2016 Full Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
windowsServer2019Core(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def windows_server2019_core(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage windowsServer2019Core(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage WindowsServer2019Core(Construct scope, string id, AmazonManagedImageOptions opts)func WindowsServer2019Core(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Windows Server 2019 Core Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
windowsServer2019Full(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def windows_server2019_full(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage windowsServer2019Full(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage WindowsServer2019Full(Construct scope, string id, AmazonManagedImageOptions opts)func WindowsServer2019Full(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Windows Server 2019 Full Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
windowsServer2022Core(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def windows_server2022_core(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage windowsServer2022Core(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage WindowsServer2022Core(Construct scope, string id, AmazonManagedImageOptions opts)func WindowsServer2022Core(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Windows Server 2022 Core Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
windowsServer2022Full(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def windows_server2022_full(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage windowsServer2022Full(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage WindowsServer2022Full(Construct scope, string id, AmazonManagedImageOptions opts)func WindowsServer2022Full(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Windows Server 2022 Full Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
windowsServer2025Core(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def windows_server2025_core(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage windowsServer2025Core(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage WindowsServer2025Core(Construct scope, string id, AmazonManagedImageOptions opts)func WindowsServer2025Core(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Windows Server 2025 Core Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.
windowsServer2025Full(scope: Construct, id: string, opts: AmazonManagedImageOptions): IImage@staticmethod def windows_server2025_full(scope: Construct, id: str, opts: AmazonManagedImageOptions) -> IImagepublic static IImage windowsServer2025Full(Construct scope, String id, AmazonManagedImageOptions opts)public static IImage WindowsServer2025Full(Construct scope, string id, AmazonManagedImageOptions opts)func WindowsServer2025Full(Scope Construct, Id *string, Opts AmazonManagedImageOptions) IImagestatic#Imports the Windows Server 2025 Full Amazon-managed image.
3 parameters
Parameters
scopescopescopescopeScope— The construct scope.ididididId— Identifier of the construct.optsoptsoptsoptsOpts— The Amazon-managed image attributes.