Class EcsOptimizedImage
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ecs.EcsOptimizedImage
- All Implemented Interfaces:
IMachineImage
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-27T16:50:57.007Z")
@Stability(Stable)
public class EcsOptimizedImage
extends software.amazon.jsii.JsiiObject
implements IMachineImage
Construct a Linux or Windows machine image from the latest ECS Optimized AMI published in SSM.
Example:
Vpc vpc; Cluster cluster = Cluster.Builder.create(this, "Cluster") .vpc(vpc) .build(); // Either add default capacity cluster.addCapacity("DefaultAutoScalingGroupCapacity", AddCapacityOptions.builder() .instanceType(new InstanceType("t2.xlarge")) .desiredCapacity(3) .build()); // Or add customized capacity. Be sure to start the Amazon ECS-optimized AMI. AutoScalingGroup autoScalingGroup = AutoScalingGroup.Builder.create(this, "ASG") .vpc(vpc) .instanceType(new InstanceType("t2.xlarge")) .machineImage(EcsOptimizedImage.amazonLinux()) // Or use Amazon ECS-Optimized Amazon Linux 2 AMI // machineImage: EcsOptimizedImage.amazonLinux2(), .desiredCapacity(3) .build(); AsgCapacityProvider capacityProvider = AsgCapacityProvider.Builder.create(this, "AsgCapacityProvider") .autoScalingGroup(autoScalingGroup) .build(); cluster.addAsgCapacityProvider(capacityProvider);
-
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
EcsOptimizedImage
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
EcsOptimizedImage
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic EcsOptimizedImage
Construct an Amazon Linux AMI image from the latest ECS Optimized AMI published in SSM.static EcsOptimizedImage
amazonLinux
(EcsOptimizedImageOptions options) Construct an Amazon Linux AMI image from the latest ECS Optimized AMI published in SSM.static EcsOptimizedImage
Construct an Amazon Linux 2 image from the latest ECS Optimized AMI published in SSM.static EcsOptimizedImage
amazonLinux2
(AmiHardwareType hardwareType) Construct an Amazon Linux 2 image from the latest ECS Optimized AMI published in SSM.static EcsOptimizedImage
amazonLinux2
(AmiHardwareType hardwareType, EcsOptimizedImageOptions options) Construct an Amazon Linux 2 image from the latest ECS Optimized AMI published in SSM.static EcsOptimizedImage
Construct an Amazon Linux 2023 image from the latest ECS Optimized AMI published in SSM.static EcsOptimizedImage
amazonLinux2023
(AmiHardwareType hardwareType) Construct an Amazon Linux 2023 image from the latest ECS Optimized AMI published in SSM.static EcsOptimizedImage
amazonLinux2023
(AmiHardwareType hardwareType, EcsOptimizedImageOptions options) Construct an Amazon Linux 2023 image from the latest ECS Optimized AMI published in SSM.getImage
(software.constructs.Construct scope) Return the correct image.static EcsOptimizedImage
windows
(WindowsOptimizedVersion windowsVersion) Construct a Windows image from the latest ECS Optimized AMI published in SSM.static EcsOptimizedImage
windows
(WindowsOptimizedVersion windowsVersion, EcsOptimizedImageOptions options) Construct a Windows image from the latest ECS Optimized AMI published in SSM.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
-
EcsOptimizedImage
protected EcsOptimizedImage(software.amazon.jsii.JsiiObjectRef objRef) -
EcsOptimizedImage
protected EcsOptimizedImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
amazonLinux
@Stability(Stable) @NotNull public static EcsOptimizedImage amazonLinux(@Nullable EcsOptimizedImageOptions options) Construct an Amazon Linux AMI image from the latest ECS Optimized AMI published in SSM.- Parameters:
options
-
-
amazonLinux
Construct an Amazon Linux AMI image from the latest ECS Optimized AMI published in SSM. -
amazonLinux2
@Stability(Stable) @NotNull public static EcsOptimizedImage amazonLinux2(@Nullable AmiHardwareType hardwareType, @Nullable EcsOptimizedImageOptions options) Construct an Amazon Linux 2 image from the latest ECS Optimized AMI published in SSM.- Parameters:
hardwareType
- ECS-optimized AMI variant to use.options
-
-
amazonLinux2
@Stability(Stable) @NotNull public static EcsOptimizedImage amazonLinux2(@Nullable AmiHardwareType hardwareType) Construct an Amazon Linux 2 image from the latest ECS Optimized AMI published in SSM.- Parameters:
hardwareType
- ECS-optimized AMI variant to use.
-
amazonLinux2
Construct an Amazon Linux 2 image from the latest ECS Optimized AMI published in SSM. -
amazonLinux2023
@Stability(Stable) @NotNull public static EcsOptimizedImage amazonLinux2023(@Nullable AmiHardwareType hardwareType, @Nullable EcsOptimizedImageOptions options) Construct an Amazon Linux 2023 image from the latest ECS Optimized AMI published in SSM.- Parameters:
hardwareType
- ECS-optimized AMI variant to use.options
-
-
amazonLinux2023
@Stability(Stable) @NotNull public static EcsOptimizedImage amazonLinux2023(@Nullable AmiHardwareType hardwareType) Construct an Amazon Linux 2023 image from the latest ECS Optimized AMI published in SSM.- Parameters:
hardwareType
- ECS-optimized AMI variant to use.
-
amazonLinux2023
Construct an Amazon Linux 2023 image from the latest ECS Optimized AMI published in SSM. -
windows
@Stability(Stable) @NotNull public static EcsOptimizedImage windows(@NotNull WindowsOptimizedVersion windowsVersion, @Nullable EcsOptimizedImageOptions options) Construct a Windows image from the latest ECS Optimized AMI published in SSM.- Parameters:
windowsVersion
- Windows Version to use. This parameter is required.options
-
-
windows
@Stability(Stable) @NotNull public static EcsOptimizedImage windows(@NotNull WindowsOptimizedVersion windowsVersion) Construct a Windows image from the latest ECS Optimized AMI published in SSM.- Parameters:
windowsVersion
- Windows Version to use. This parameter is required.
-
getImage
@Stability(Stable) @NotNull public MachineImageConfig getImage(@NotNull software.constructs.Construct scope) Return the correct image.- Specified by:
getImage
in interfaceIMachineImage
- Parameters:
scope
- This parameter is required.
-