Interface MixedInstancesPolicy
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
MixedInstancesPolicy.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:45.397Z")
@Stability(Stable)
public interface MixedInstancesPolicy
extends software.amazon.jsii.JsiiSerializable
MixedInstancesPolicy allows you to configure a group that diversifies across On-Demand Instances and Spot Instances of multiple instance types.
For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide:
https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html
Example:
Vpc vpc; LaunchTemplate launchTemplate1; LaunchTemplate launchTemplate2; AutoScalingGroup.Builder.create(this, "ASG") .vpc(vpc) .mixedInstancesPolicy(MixedInstancesPolicy.builder() .instancesDistribution(InstancesDistribution.builder() .onDemandPercentageAboveBaseCapacity(50) .build()) .launchTemplate(launchTemplate1) .launchTemplateOverrides(List.of(LaunchTemplateOverrides.builder().instanceType(new InstanceType("t3.micro")).build(), LaunchTemplateOverrides.builder().instanceType(new InstanceType("t3a.micro")).build(), LaunchTemplateOverrides.builder().instanceType(new InstanceType("t4g.micro")).launchTemplate(launchTemplate2).build())) .build()) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forMixedInstancesPolicy
static final class
An implementation forMixedInstancesPolicy
-
Method Summary
Modifier and TypeMethodDescriptionstatic MixedInstancesPolicy.Builder
builder()
default InstancesDistribution
InstancesDistribution to use.Launch template to use.default List<LaunchTemplateOverrides>
Launch template overrides.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getLaunchTemplate
Launch template to use. -
getInstancesDistribution
InstancesDistribution to use.Default: - The value for each property in it uses a default value.
-
getLaunchTemplateOverrides
Launch template overrides.The maximum number of instance types that can be associated with an Auto Scaling group is 40.
The maximum number of distinct launch templates you can define for an Auto Scaling group is 20.
Default: - Do not provide any overrides
-
builder
- Returns:
- a
MixedInstancesPolicy.Builder
ofMixedInstancesPolicy
-