@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-05-19T23:09:26.373Z") @Stability(value=Stable) public abstract class MachineImage extends software.amazon.jsii.JsiiObject
Example:
Vpc vpc; LaunchTemplate template = LaunchTemplate.Builder.create(this, "LaunchTemplate") .machineImage(MachineImage.latestAmazonLinux()) .securityGroup(SecurityGroup.Builder.create(this, "LaunchTemplateSG") .vpc(vpc) .build()) .build();
Modifier | Constructor and Description |
---|---|
protected |
MachineImage() |
protected |
MachineImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
MachineImage(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static IMachineImage |
fromSsmParameter(String parameterName)
An image specified in SSM parameter store.
|
static IMachineImage |
fromSSMParameter(String parameterName,
OperatingSystemType os)
Deprecated.
Use `MachineImage.fromSsmParameter()` instead
|
static IMachineImage |
fromSSMParameter(String parameterName,
OperatingSystemType os,
UserData userData)
Deprecated.
Use `MachineImage.fromSsmParameter()` instead
|
static IMachineImage |
fromSsmParameter(String parameterName,
SsmParameterImageOptions options)
An image specified in SSM parameter store.
|
static IMachineImage |
genericLinux(Map<String,String> amiMap)
A Linux image where you specify the AMI ID for every region.
|
static IMachineImage |
genericLinux(Map<String,String> amiMap,
GenericLinuxImageProps props)
A Linux image where you specify the AMI ID for every region.
|
static IMachineImage |
genericWindows(Map<String,String> amiMap)
A Windows image where you specify the AMI ID for every region.
|
static IMachineImage |
genericWindows(Map<String,String> amiMap,
GenericWindowsImageProps props)
A Windows image where you specify the AMI ID for every region.
|
static IMachineImage |
latestAmazonLinux()
An Amazon Linux image that is automatically kept up-to-date.
|
static IMachineImage |
latestAmazonLinux(AmazonLinuxImageProps props)
An Amazon Linux image that is automatically kept up-to-date.
|
static IMachineImage |
latestWindows(WindowsVersion version)
A Windows image that is automatically kept up-to-date.
|
static IMachineImage |
latestWindows(WindowsVersion version,
WindowsImageProps props)
A Windows image that is automatically kept up-to-date.
|
static IMachineImage |
lookup(LookupMachineImageProps props)
Look up a shared Machine Image using DescribeImages.
|
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
protected MachineImage(software.amazon.jsii.JsiiObjectRef objRef)
protected MachineImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable) protected MachineImage()
@Stability(value=Stable) @NotNull public static IMachineImage fromSsmParameter(@NotNull String parameterName, @Nullable SsmParameterImageOptions options)
By default, the SSM parameter is refreshed at every deployment, causing your instances to be replaced whenever a new version of the AMI is released.
Pass { cachedInContext: true }
to keep the AMI ID stable. If you do, you
will have to remember to periodically invalidate the context to refresh
to the newest AMI ID.
parameterName
- This parameter is required.options
- @Stability(value=Stable) @NotNull public static IMachineImage fromSsmParameter(@NotNull String parameterName)
By default, the SSM parameter is refreshed at every deployment, causing your instances to be replaced whenever a new version of the AMI is released.
Pass { cachedInContext: true }
to keep the AMI ID stable. If you do, you
will have to remember to periodically invalidate the context to refresh
to the newest AMI ID.
parameterName
- This parameter is required.@Stability(value=Deprecated) @Deprecated @NotNull public static IMachineImage fromSSMParameter(@NotNull String parameterName, @NotNull OperatingSystemType os, @Nullable UserData userData)
This Machine Image automatically updates to the latest version on every deployment. Be aware this will cause your instances to be replaced when a new version of the image becomes available. Do not store stateful information on the instance if you are using this image.
parameterName
- The name of SSM parameter containing the AMi id. This parameter is required.os
- The operating system type of the AMI. This parameter is required.userData
- optional user data for the given image.@Stability(value=Deprecated) @Deprecated @NotNull public static IMachineImage fromSSMParameter(@NotNull String parameterName, @NotNull OperatingSystemType os)
This Machine Image automatically updates to the latest version on every deployment. Be aware this will cause your instances to be replaced when a new version of the image becomes available. Do not store stateful information on the instance if you are using this image.
parameterName
- The name of SSM parameter containing the AMi id. This parameter is required.os
- The operating system type of the AMI. This parameter is required.@Stability(value=Stable) @NotNull public static IMachineImage genericLinux(@NotNull Map<String,String> amiMap, @Nullable GenericLinuxImageProps props)
amiMap
- For every region where you are deploying the stack, specify the AMI ID for that region. This parameter is required.props
- Customize the image by supplying additional props.@Stability(value=Stable) @NotNull public static IMachineImage genericLinux(@NotNull Map<String,String> amiMap)
amiMap
- For every region where you are deploying the stack, specify the AMI ID for that region. This parameter is required.@Stability(value=Stable) @NotNull public static IMachineImage genericWindows(@NotNull Map<String,String> amiMap, @Nullable GenericWindowsImageProps props)
amiMap
- For every region where you are deploying the stack, specify the AMI ID for that region. This parameter is required.props
- Customize the image by supplying additional props.@Stability(value=Stable) @NotNull public static IMachineImage genericWindows(@NotNull Map<String,String> amiMap)
amiMap
- For every region where you are deploying the stack, specify the AMI ID for that region. This parameter is required.@Stability(value=Stable) @NotNull public static IMachineImage latestAmazonLinux(@Nullable AmazonLinuxImageProps props)
This Machine Image automatically updates to the latest version on every deployment. Be aware this will cause your instances to be replaced when a new version of the image becomes available. Do not store stateful information on the instance if you are using this image.
props
- @Stability(value=Stable) @NotNull public static IMachineImage latestAmazonLinux()
This Machine Image automatically updates to the latest version on every deployment. Be aware this will cause your instances to be replaced when a new version of the image becomes available. Do not store stateful information on the instance if you are using this image.
@Stability(value=Stable) @NotNull public static IMachineImage latestWindows(@NotNull WindowsVersion version, @Nullable WindowsImageProps props)
This Machine Image automatically updates to the latest version on every deployment. Be aware this will cause your instances to be replaced when a new version of the image becomes available. Do not store stateful information on the instance if you are using this image.
version
- This parameter is required.props
- @Stability(value=Stable) @NotNull public static IMachineImage latestWindows(@NotNull WindowsVersion version)
This Machine Image automatically updates to the latest version on every deployment. Be aware this will cause your instances to be replaced when a new version of the image becomes available. Do not store stateful information on the instance if you are using this image.
version
- This parameter is required.@Stability(value=Stable) @NotNull public static IMachineImage lookup(@NotNull LookupMachineImageProps props)
The most recent, available, launchable image matching the given filter criteria will be used. Looking up AMIs may take a long time; specify as many filter criteria as possible to narrow down the search.
The AMI selected will be cached in cdk.context.json
and the same value
will be used on future runs. To refresh the AMI lookup, you will have to
evict the value from the cache using the cdk context
command. See
https://docs.aws.amazon.com/cdk/latest/guide/context.html for more information.
This function can not be used in environment-agnostic stacks.
props
- This parameter is required.Copyright © 2023. All rights reserved.