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.104.0 (build e79254c)",
date="2024-11-22T02:24:00.128Z")
@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:
IVpc vpc; LoadBalancer lb = LoadBalancer.Builder.create(this, "LB") .vpc(vpc) .internetFacing(true) .build(); // instance to add as the target for load balancer. Instance instance = Instance.Builder.create(this, "targetInstance") .vpc(vpc) .instanceType(InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.MICRO)) .machineImage(AmazonLinuxImage.Builder.create().generation(AmazonLinuxGeneration.AMAZON_LINUX_2).build()) .build(); lb.addTarget(new InstanceTarget(instance));
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ec2.IMachineImage
IMachineImage.Jsii$Default, IMachineImage.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
AmazonLinuxImage
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
AmazonLinuxImage
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptiongetImage
(software.constructs.Construct scope) Return the image to use in the given context.static String
Return the SSM parameter name that will contain the Amazon Linux image with the given attributes.static String
Return 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
getParameterName
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
@Stability(Stable) @NotNull public MachineImageConfig getImage(@NotNull software.constructs.Construct scope) Return the image to use in the given context.- Specified by:
getImage
in interfaceIMachineImage
- Overrides:
getImage
in classGenericSSMParameterImage
- Parameters:
scope
- This parameter is required.
-