Interface LookupMachineImageProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
LookupMachineImageProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)",
date="2025-06-13T09:19:36.530Z")
@Stability(Stable)
public interface LookupMachineImageProps
extends software.amazon.jsii.JsiiSerializable
Properties for looking up an image.
Example:
// Pick the right Amazon Linux edition. All arguments shown are optional // and will default to these values when omitted. IMachineImage amznLinux = MachineImage.latestAmazonLinux(AmazonLinuxImageProps.builder() .generation(AmazonLinuxGeneration.AMAZON_LINUX) .edition(AmazonLinuxEdition.STANDARD) .virtualization(AmazonLinuxVirt.HVM) .storage(AmazonLinuxStorage.GENERAL_PURPOSE) .cpuType(AmazonLinuxCpuType.X86_64) .build()); // Pick a Windows edition to use IMachineImage windows = MachineImage.latestWindows(WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_BASE); // Read AMI id from SSM parameter store IMachineImage ssm = MachineImage.fromSsmParameter("/my/ami", SsmParameterImageOptions.builder().os(OperatingSystemType.LINUX).build()); // Look up the most recent image matching a set of AMI filters. // In this case, look up the NAT instance AMI, by using a wildcard // in the 'name' field: IMachineImage natAmi = MachineImage.lookup(LookupMachineImageProps.builder() .name("amzn-ami-vpc-nat-*") .owners(List.of("amazon")) .build()); // For other custom (Linux) images, instantiate a `GenericLinuxImage` with // a map giving the AMI to in for each region: IMachineImage linux = MachineImage.genericLinux(Map.of( "us-east-1", "ami-97785bed", "eu-west-1", "ami-12345678")); // For other custom (Windows) images, instantiate a `GenericWindowsImage` with // a map giving the AMI to in for each region: IMachineImage genericWindows = MachineImage.genericWindows(Map.of( "us-east-1", "ami-97785bed", "eu-west-1", "ami-12345678"));
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
A builder forLookupMachineImageProps
static final class
An implementation forLookupMachineImageProps
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default String
Adds an additional discriminator to thecdk.context.json
cache key.Additional filters on the AMI.getName()
Name of the image (may contain wildcards).Owner account IDs or aliases.default UserData
Custom userdata for this image.default Boolean
Look for Windows images.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getName
Name of the image (may contain wildcards). -
getAdditionalCacheKey
Adds an additional discriminator to thecdk.context.json
cache key.Default: - no additional cache key
-
getFilters
Additional filters on the AMI.Default: - No additional filters
- See Also:
-
getOwners
Owner account IDs or aliases.Default: - All owners
-
getUserData
Custom userdata for this image.Default: - Empty user data appropriate for the platform type
-
getWindows
Look for Windows images.Default: false
-
builder
- Returns:
- a
LookupMachineImageProps.Builder
ofLookupMachineImageProps
-