Class AmazonLinuxImage
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.GenericSSMParameterImage
software.amazon.awscdk.services.ec2.AmazonLinuxImage
- All Implemented Interfaces:
IMachineImage,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:38.378Z")
@Stability(Stable)
public class AmazonLinuxImage
extends GenericSSMParameterImage
Selects the latest version of Amazon Linux.
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.
The AMI ID is selected using the values published to the SSM parameter store.
Example:
// Pick a Windows edition to use
WindowsImage windows = new WindowsImage(WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_BASE);
// Pick the right Amazon Linux edition. All arguments shown are optional
// and will default to these values when omitted.
AmazonLinuxImage amznLinux = AmazonLinuxImage.Builder.create()
.generation(AmazonLinuxGeneration.AMAZON_LINUX)
.edition(AmazonLinuxEdition.STANDARD)
.virtualization(AmazonLinuxVirt.HVM)
.storage(AmazonLinuxStorage.GENERAL_PURPOSE)
.build();
// For other custom (Linux) images, instantiate a `GenericLinuxImage` with
// a map giving the AMI to in for each region:
GenericLinuxImage linux = new GenericLinuxImage(Map.of(
"us-east-1", "ami-97785bed",
"eu-west-1", "ami-12345678"));
-
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.amazon.awscdk.services.ec2.IMachineImage
IMachineImage.Jsii$Default, IMachineImage.Jsii$Proxy -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAmazonLinuxImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedAmazonLinuxImage(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionReturn the image to use in the given context.static StringReturn the SSM parameter name that will contain the Amazon Linux image with the given attributes.static StringReturn the SSM parameter name that will contain the Amazon Linux image with the given attributes.Methods inherited from class software.amazon.awscdk.services.ec2.GenericSSMParameterImage
getParameterNameMethods 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
-
AmazonLinuxImage
protected AmazonLinuxImage(software.amazon.jsii.JsiiObjectRef objRef) -
AmazonLinuxImage
protected AmazonLinuxImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
AmazonLinuxImage
- Parameters:
props-
-
AmazonLinuxImage
@Stability(Stable) public AmazonLinuxImage()
-
-
Method Details
-
ssmParameterName
@Stability(Stable) @NotNull public static String ssmParameterName(@Nullable AmazonLinuxImageProps props) Return the SSM parameter name that will contain the Amazon Linux image with the given attributes.- Parameters:
props-
-
ssmParameterName
Return the SSM parameter name that will contain the Amazon Linux image with the given attributes. -
getImage
Return the image to use in the given context.- Specified by:
getImagein interfaceIMachineImage- Overrides:
getImagein classGenericSSMParameterImage- Parameters:
scope- This parameter is required.
-