Show / Hide Table of Contents

Interface IMixedInstancesPolicy

MixedInstancesPolicy allows you to configure a group that diversifies across On-Demand Instances and Spot Instances of multiple instance types.

Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.AWS.AutoScaling.dll
Syntax (csharp)
public interface IMixedInstancesPolicy
Syntax (vb)
Public Interface IMixedInstancesPolicy
Remarks

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

ExampleMetadata: infused

Examples
Vpc vpc;
LaunchTemplate launchTemplate1;
LaunchTemplate launchTemplate2;


new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
    Vpc = vpc,
    MixedInstancesPolicy = new MixedInstancesPolicy {
        InstancesDistribution = new InstancesDistribution {
            OnDemandPercentageAboveBaseCapacity = 50
        },
        LaunchTemplate = launchTemplate1,
        LaunchTemplateOverrides = new [] { new LaunchTemplateOverrides { InstanceType = new InstanceType("t3.micro") }, new LaunchTemplateOverrides { InstanceType = new InstanceType("t3a.micro") }, new LaunchTemplateOverrides { InstanceType = new InstanceType("t4g.micro"), LaunchTemplate = launchTemplate2 } }
    }
});

Synopsis

Properties

InstancesDistribution

InstancesDistribution to use.

LaunchTemplate

Launch template to use.

LaunchTemplateOverrides

Launch template overrides.

Properties

InstancesDistribution

InstancesDistribution to use.

virtual IInstancesDistribution InstancesDistribution { get; }
Property Value

IInstancesDistribution

Remarks

Default: - The value for each property in it uses a default value.

LaunchTemplate

Launch template to use.

ILaunchTemplate LaunchTemplate { get; }
Property Value

ILaunchTemplate

LaunchTemplateOverrides

Launch template overrides.

virtual ILaunchTemplateOverrides[] LaunchTemplateOverrides { get; }
Property Value

ILaunchTemplateOverrides[]

Remarks

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

Back to top Generated by DocFX