Show / Hide Table of Contents

Class CfnAutoScalingGroup.MixedInstancesPolicyProperty

Use this structure to launch multiple instance types and On-Demand Instances and Spot Instances within a single Auto Scaling group.

Inheritance
object
CfnAutoScalingGroup.MixedInstancesPolicyProperty
Implements
CfnAutoScalingGroup.IMixedInstancesPolicyProperty
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.AutoScaling
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnAutoScalingGroup.MixedInstancesPolicyProperty : CfnAutoScalingGroup.IMixedInstancesPolicyProperty
Syntax (vb)
Public Class CfnAutoScalingGroup.MixedInstancesPolicyProperty Implements CfnAutoScalingGroup.IMixedInstancesPolicyProperty
Remarks

A mixed instances policy contains information that Amazon EC2 Auto Scaling can use to launch instances and help optimize your costs. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide .

You can create a mixed instances policy for new and existing Auto Scaling groups. You must use a launch template to configure the policy. You cannot use a launch configuration.

There are key differences between Spot Instances and On-Demand Instances:

    When a Spot Instance is terminated, Amazon EC2 Auto Scaling group attempts to launch a replacement instance to maintain the desired capacity for the group.

    MixedInstancesPolicy is a property of the AWS::AutoScaling::AutoScalingGroup resource.

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html

    ExampleMetadata: fixture=_generated

    Examples
    // The code below shows an example of how to instantiate this type.
                 // The values are placeholders you should change.
                 using Amazon.CDK.AWS.AutoScaling;
    
                 var mixedInstancesPolicyProperty = new MixedInstancesPolicyProperty {
                     LaunchTemplate = new LaunchTemplateProperty {
                         LaunchTemplateSpecification = new LaunchTemplateSpecificationProperty {
                             Version = "version",
    
                             // the properties below are optional
                             LaunchTemplateId = "launchTemplateId",
                             LaunchTemplateName = "launchTemplateName"
                         },
    
                         // the properties below are optional
                         Overrides = new [] { new LaunchTemplateOverridesProperty {
                             ImageId = "imageId",
                             InstanceRequirements = new InstanceRequirementsProperty {
                                 MemoryMiB = new MemoryMiBRequestProperty {
                                     Max = 123,
                                     Min = 123
                                 },
                                 VCpuCount = new VCpuCountRequestProperty {
                                     Max = 123,
                                     Min = 123
                                 },
    
                                 // the properties below are optional
                                 AcceleratorCount = new AcceleratorCountRequestProperty {
                                     Max = 123,
                                     Min = 123
                                 },
                                 AcceleratorManufacturers = new [] { "acceleratorManufacturers" },
                                 AcceleratorNames = new [] { "acceleratorNames" },
                                 AcceleratorTotalMemoryMiB = new AcceleratorTotalMemoryMiBRequestProperty {
                                     Max = 123,
                                     Min = 123
                                 },
                                 AcceleratorTypes = new [] { "acceleratorTypes" },
                                 AllowedInstanceTypes = new [] { "allowedInstanceTypes" },
                                 BareMetal = "bareMetal",
                                 BaselineEbsBandwidthMbps = new BaselineEbsBandwidthMbpsRequestProperty {
                                     Max = 123,
                                     Min = 123
                                 },
                                 BaselinePerformanceFactors = new BaselinePerformanceFactorsRequestProperty {
                                     Cpu = new CpuPerformanceFactorRequestProperty {
                                         References = new [] { new PerformanceFactorReferenceRequestProperty {
                                             InstanceFamily = "instanceFamily"
                                         } }
                                     }
                                 },
                                 BurstablePerformance = "burstablePerformance",
                                 CpuManufacturers = new [] { "cpuManufacturers" },
                                 ExcludedInstanceTypes = new [] { "excludedInstanceTypes" },
                                 InstanceGenerations = new [] { "instanceGenerations" },
                                 LocalStorage = "localStorage",
                                 LocalStorageTypes = new [] { "localStorageTypes" },
                                 MaxSpotPriceAsPercentageOfOptimalOnDemandPrice = 123,
                                 MemoryGiBPerVCpu = new MemoryGiBPerVCpuRequestProperty {
                                     Max = 123,
                                     Min = 123
                                 },
                                 NetworkBandwidthGbps = new NetworkBandwidthGbpsRequestProperty {
                                     Max = 123,
                                     Min = 123
                                 },
                                 NetworkInterfaceCount = new NetworkInterfaceCountRequestProperty {
                                     Max = 123,
                                     Min = 123
                                 },
                                 OnDemandMaxPricePercentageOverLowestPrice = 123,
                                 RequireHibernateSupport = false,
                                 SpotMaxPricePercentageOverLowestPrice = 123,
                                 TotalLocalStorageGb = new TotalLocalStorageGBRequestProperty {
                                     Max = 123,
                                     Min = 123
                                 }
                             },
                             InstanceType = "instanceType",
                             LaunchTemplateSpecification = new LaunchTemplateSpecificationProperty {
                                 Version = "version",
    
                                 // the properties below are optional
                                 LaunchTemplateId = "launchTemplateId",
                                 LaunchTemplateName = "launchTemplateName"
                             },
                             WeightedCapacity = "weightedCapacity"
                         } }
                     },
    
                     // the properties below are optional
                     InstancesDistribution = new InstancesDistributionProperty {
                         OnDemandAllocationStrategy = "onDemandAllocationStrategy",
                         OnDemandBaseCapacity = 123,
                         OnDemandPercentageAboveBaseCapacity = 123,
                         SpotAllocationStrategy = "spotAllocationStrategy",
                         SpotInstancePools = 123,
                         SpotMaxPrice = "spotMaxPrice"
                     }
                 };

    Synopsis

    Constructors

    MixedInstancesPolicyProperty()

    Use this structure to launch multiple instance types and On-Demand Instances and Spot Instances within a single Auto Scaling group.

    Properties

    InstancesDistribution

    The instances distribution.

    LaunchTemplate

    One or more launch templates and the instance types (overrides) that are used to launch EC2 instances to fulfill On-Demand and Spot capacities.

    Constructors

    MixedInstancesPolicyProperty()

    Use this structure to launch multiple instance types and On-Demand Instances and Spot Instances within a single Auto Scaling group.

    public MixedInstancesPolicyProperty()
    Remarks

    A mixed instances policy contains information that Amazon EC2 Auto Scaling can use to launch instances and help optimize your costs. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide .

    You can create a mixed instances policy for new and existing Auto Scaling groups. You must use a launch template to configure the policy. You cannot use a launch configuration.

    There are key differences between Spot Instances and On-Demand Instances:

      When a Spot Instance is terminated, Amazon EC2 Auto Scaling group attempts to launch a replacement instance to maintain the desired capacity for the group.

      MixedInstancesPolicy is a property of the AWS::AutoScaling::AutoScalingGroup resource.

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html

      ExampleMetadata: fixture=_generated

      Examples
      // The code below shows an example of how to instantiate this type.
                   // The values are placeholders you should change.
                   using Amazon.CDK.AWS.AutoScaling;
      
                   var mixedInstancesPolicyProperty = new MixedInstancesPolicyProperty {
                       LaunchTemplate = new LaunchTemplateProperty {
                           LaunchTemplateSpecification = new LaunchTemplateSpecificationProperty {
                               Version = "version",
      
                               // the properties below are optional
                               LaunchTemplateId = "launchTemplateId",
                               LaunchTemplateName = "launchTemplateName"
                           },
      
                           // the properties below are optional
                           Overrides = new [] { new LaunchTemplateOverridesProperty {
                               ImageId = "imageId",
                               InstanceRequirements = new InstanceRequirementsProperty {
                                   MemoryMiB = new MemoryMiBRequestProperty {
                                       Max = 123,
                                       Min = 123
                                   },
                                   VCpuCount = new VCpuCountRequestProperty {
                                       Max = 123,
                                       Min = 123
                                   },
      
                                   // the properties below are optional
                                   AcceleratorCount = new AcceleratorCountRequestProperty {
                                       Max = 123,
                                       Min = 123
                                   },
                                   AcceleratorManufacturers = new [] { "acceleratorManufacturers" },
                                   AcceleratorNames = new [] { "acceleratorNames" },
                                   AcceleratorTotalMemoryMiB = new AcceleratorTotalMemoryMiBRequestProperty {
                                       Max = 123,
                                       Min = 123
                                   },
                                   AcceleratorTypes = new [] { "acceleratorTypes" },
                                   AllowedInstanceTypes = new [] { "allowedInstanceTypes" },
                                   BareMetal = "bareMetal",
                                   BaselineEbsBandwidthMbps = new BaselineEbsBandwidthMbpsRequestProperty {
                                       Max = 123,
                                       Min = 123
                                   },
                                   BaselinePerformanceFactors = new BaselinePerformanceFactorsRequestProperty {
                                       Cpu = new CpuPerformanceFactorRequestProperty {
                                           References = new [] { new PerformanceFactorReferenceRequestProperty {
                                               InstanceFamily = "instanceFamily"
                                           } }
                                       }
                                   },
                                   BurstablePerformance = "burstablePerformance",
                                   CpuManufacturers = new [] { "cpuManufacturers" },
                                   ExcludedInstanceTypes = new [] { "excludedInstanceTypes" },
                                   InstanceGenerations = new [] { "instanceGenerations" },
                                   LocalStorage = "localStorage",
                                   LocalStorageTypes = new [] { "localStorageTypes" },
                                   MaxSpotPriceAsPercentageOfOptimalOnDemandPrice = 123,
                                   MemoryGiBPerVCpu = new MemoryGiBPerVCpuRequestProperty {
                                       Max = 123,
                                       Min = 123
                                   },
                                   NetworkBandwidthGbps = new NetworkBandwidthGbpsRequestProperty {
                                       Max = 123,
                                       Min = 123
                                   },
                                   NetworkInterfaceCount = new NetworkInterfaceCountRequestProperty {
                                       Max = 123,
                                       Min = 123
                                   },
                                   OnDemandMaxPricePercentageOverLowestPrice = 123,
                                   RequireHibernateSupport = false,
                                   SpotMaxPricePercentageOverLowestPrice = 123,
                                   TotalLocalStorageGb = new TotalLocalStorageGBRequestProperty {
                                       Max = 123,
                                       Min = 123
                                   }
                               },
                               InstanceType = "instanceType",
                               LaunchTemplateSpecification = new LaunchTemplateSpecificationProperty {
                                   Version = "version",
      
                                   // the properties below are optional
                                   LaunchTemplateId = "launchTemplateId",
                                   LaunchTemplateName = "launchTemplateName"
                               },
                               WeightedCapacity = "weightedCapacity"
                           } }
                       },
      
                       // the properties below are optional
                       InstancesDistribution = new InstancesDistributionProperty {
                           OnDemandAllocationStrategy = "onDemandAllocationStrategy",
                           OnDemandBaseCapacity = 123,
                           OnDemandPercentageAboveBaseCapacity = 123,
                           SpotAllocationStrategy = "spotAllocationStrategy",
                           SpotInstancePools = 123,
                           SpotMaxPrice = "spotMaxPrice"
                       }
                   };

      Properties

      InstancesDistribution

      The instances distribution.

      public object? InstancesDistribution { get; set; }
      Property Value

      object

      Remarks

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-instancesdistribution

      Type union: either IResolvable or CfnAutoScalingGroup.IInstancesDistributionProperty

      LaunchTemplate

      One or more launch templates and the instance types (overrides) that are used to launch EC2 instances to fulfill On-Demand and Spot capacities.

      public object LaunchTemplate { get; set; }
      Property Value

      object

      Remarks

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html#cfn-autoscaling-autoscalinggroup-mixedinstancespolicy-launchtemplate

      Type union: either IResolvable or CfnAutoScalingGroup.ILaunchTemplateProperty

      Implements

      CfnAutoScalingGroup.IMixedInstancesPolicyProperty
      Back to top Generated by DocFX