Show / Hide Table of Contents

Namespace Amazon.CDK.AWS.AutoScaling

Amazon EC2 Auto Scaling Construct Library

--- End-of-Support
AWS CDK v1 has reached End-of-Support on 2023-06-01.
This package is no longer being updated, and users should migrate to AWS CDK v2.

For more information on how to migrate, see the Migrating to AWS CDK v2 guide.


This module is part of the AWS Cloud Development Kit project.

Auto Scaling Group

An AutoScalingGroup represents a number of instances on which you run your code. You pick the size of the fleet, the instance type and the OS image:

Vpc vpc;


new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
    Vpc = vpc,
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.MICRO),
    MachineImage = new AmazonLinuxImage()
});

NOTE: AutoScalingGroup has an property called allowAllOutbound (allowing the instances to contact the internet) which is set to true by default. Be sure to set this to false if you don't want your instances to be able to start arbitrary connections. Alternatively, you can specify an existing security group to attach to the instances that are launched, rather than have the group create a new one.

Vpc vpc;


var mySecurityGroup = new SecurityGroup(this, "SecurityGroup", new SecurityGroupProps { Vpc = vpc });
new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
    Vpc = vpc,
    InstanceType = InstanceType.Of(InstanceClass.BURSTABLE2, InstanceSize.MICRO),
    MachineImage = new AmazonLinuxImage(),
    SecurityGroup = mySecurityGroup
});

Alternatively you can create an AutoScalingGroup from a LaunchTemplate:

Vpc vpc;
LaunchTemplate launchTemplate;


new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
    Vpc = vpc,
    LaunchTemplate = launchTemplate
});

To launch a mixture of Spot and on-demand instances, and/or with multiple instance types, you can create an AutoScalingGroup from a MixedInstancesPolicy:

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 } }
    }
});

Machine Images (AMIs)

AMIs control the OS that gets launched when you start your EC2 instance. The EC2 library contains constructs to select the AMI you want to use.

Depending on the type of AMI, you select it a different way.

The latest version of Amazon Linux and Microsoft Windows images are selectable by instantiating one of these classes:

// Pick a Windows edition to use
var windows = new WindowsImage(WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_BASE);

// Pick the right Amazon Linux edition. All arguments shown are optional
// and will default to these values when omitted.
var amznLinux = new AmazonLinuxImage(new AmazonLinuxImageProps {
    Generation = AmazonLinuxGeneration.AMAZON_LINUX,
    Edition = AmazonLinuxEdition.STANDARD,
    Virtualization = AmazonLinuxVirt.HVM,
    Storage = AmazonLinuxStorage.GENERAL_PURPOSE
});

// For other custom (Linux) images, instantiate a `GenericLinuxImage` with
// a map giving the AMI to in for each region:

var linux = new GenericLinuxImage(new Dictionary<string, string> {
    { "us-east-1", "ami-97785bed" },
    { "eu-west-1", "ami-12345678" }
});
NOTE: The Amazon Linux images selected will be cached in your <code>cdk.json</code>, so that your
AutoScalingGroups don&apos;t automatically change out from under you when you&apos;re making unrelated
changes. To update to the latest version of Amazon Linux, remove the cache entry from the <code>context</code>
section of your <code>cdk.json</code>.

We will add command-line options to make this step easier in the future.

AutoScaling Instance Counts

AutoScalingGroups make it possible to raise and lower the number of instances in the group, in response to (or in advance of) changes in workload.

When you create your AutoScalingGroup, you specify a minCapacity and a maxCapacity. AutoScaling policies that respond to metrics will never go higher or lower than the indicated capacity (but scheduled scaling actions might, see below).

There are three ways to scale your capacity:

    The general pattern of autoscaling will look like this:

    Vpc vpc;
    InstanceType instanceType;
    IMachineImage machineImage;
    
    
    var autoScalingGroup = new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
        Vpc = vpc,
        InstanceType = instanceType,
        MachineImage = machineImage,
    
        MinCapacity = 5,
        MaxCapacity = 100
    });

    Step Scaling

    This type of scaling scales in and out in deterministics steps that you configure, in response to metric values. For example, your scaling strategy to scale in response to a metric that represents your average worker pool usage might look like this:

     Scaling        -1          (no change)          +1       +3
                │        │                       │        │        │
                ├────────┼───────────────────────┼────────┼────────┤
                │        │                       │        │        │
    Worker use  0%      10%                     50%       70%     100%

    (Note that this is not necessarily a recommended scaling strategy, but it's a possible one. You will have to determine what thresholds are right for you).

    Note that in order to set up this scaling strategy, you will have to emit a metric representing your worker utilization from your instances. After that, you would configure the scaling something like this:

    AutoScalingGroup autoScalingGroup;
    
    
    var workerUtilizationMetric = new Metric(new MetricProps {
        Namespace = "MyService",
        MetricName = "WorkerUtilization"
    });
    
    autoScalingGroup.ScaleOnMetric("ScaleToCPU", new BasicStepScalingPolicyProps {
        Metric = workerUtilizationMetric,
        ScalingSteps = new [] { new ScalingInterval { Upper = 10, Change = -1 }, new ScalingInterval { Lower = 50, Change = +1 }, new ScalingInterval { Lower = 70, Change = +3 } },
    
        // Change this to AdjustmentType.PERCENT_CHANGE_IN_CAPACITY to interpret the
        // 'change' numbers before as percentages instead of capacity counts.
        AdjustmentType = AdjustmentType.CHANGE_IN_CAPACITY
    });

    The AutoScaling construct library will create the required CloudWatch alarms and AutoScaling policies for you.

    Target Tracking Scaling

    This type of scaling scales in and out in order to keep a metric around a value you prefer. There are four types of predefined metrics you can track, or you can choose to track a custom metric. If you do choose to track a custom metric, be aware that the metric has to represent instance utilization in some way (AutoScaling will scale out if the metric is higher than the target, and scale in if the metric is lower than the target).

    If you configure multiple target tracking policies, AutoScaling will use the one that yields the highest capacity.

    The following example scales to keep the CPU usage of your instances around 50% utilization:

    AutoScalingGroup autoScalingGroup;
    
    
    autoScalingGroup.ScaleOnCpuUtilization("KeepSpareCPU", new CpuUtilizationScalingProps {
        TargetUtilizationPercent = 50
    });

    To scale on average network traffic in and out of your instances:

    AutoScalingGroup autoScalingGroup;
    
    
    autoScalingGroup.ScaleOnIncomingBytes("LimitIngressPerInstance", new NetworkUtilizationScalingProps {
        TargetBytesPerSecond = 10 * 1024 * 1024
    });
    autoScalingGroup.ScaleOnOutgoingBytes("LimitEgressPerInstance", new NetworkUtilizationScalingProps {
        TargetBytesPerSecond = 10 * 1024 * 1024
    });

    To scale on the average request count per instance (only works for AutoScalingGroups that have been attached to Application Load Balancers):

    AutoScalingGroup autoScalingGroup;
    
    
    autoScalingGroup.ScaleOnRequestCount("LimitRPS", new RequestCountScalingProps {
        TargetRequestsPerSecond = 1000
    });

    Scheduled Scaling

    This type of scaling is used to change capacities based on time. It works by changing minCapacity, maxCapacity and desiredCapacity of the AutoScalingGroup, and so can be used for two purposes:

      A schedule is expressed as a cron expression. The Schedule class has a cron method to help build cron expressions.

      The following example scales the fleet out in the morning, going back to natural scaling (all the way down to 1 instance if necessary) at night:

      AutoScalingGroup autoScalingGroup;
      
      
      autoScalingGroup.ScaleOnSchedule("PrescaleInTheMorning", new BasicScheduledActionProps {
          Schedule = Schedule.Cron(new CronOptions { Hour = "8", Minute = "0" }),
          MinCapacity = 20
      });
      
      autoScalingGroup.ScaleOnSchedule("AllowDownscalingAtNight", new BasicScheduledActionProps {
          Schedule = Schedule.Cron(new CronOptions { Hour = "20", Minute = "0" }),
          MinCapacity = 1
      });

      Configuring Instances using CloudFormation Init

      It is possible to use the CloudFormation Init mechanism to configure the instances in the AutoScalingGroup. You can write files to it, run commands, start services, etc. See the documentation of AWS::CloudFormation::Init and the documentation of CDK's aws-ec2 library for more information.

      When you specify a CloudFormation Init configuration for an AutoScalingGroup:

        Here's an example of using CloudFormation Init to write a file to the instance hosts on startup:

        Vpc vpc;
        InstanceType instanceType;
        IMachineImage machineImage;
        
        
        new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
            Vpc = vpc,
            InstanceType = instanceType,
            MachineImage = machineImage,
        
            // ...
        
            Init = CloudFormationInit.FromElements(InitFile.FromString("/etc/my_instance", "This got written during instance startup")),
            Signals = Signals.WaitForAll(new SignalsOptions {
                Timeout = Duration.Minutes(10)
            })
        });

        Signals

        In normal operation, CloudFormation will send a Create or Update command to an AutoScalingGroup and proceed with the rest of the deployment without waiting for the instances in the AutoScalingGroup.

        Configure signals to tell CloudFormation to wait for a specific number of instances in the AutoScalingGroup to have been started (or failed to start) before moving on. An instance is supposed to execute the cfn-signal program as part of its startup to indicate whether it was started successfully or not.

        If you use CloudFormation Init support (described in the previous section), the appropriate call to cfn-signal is automatically added to the AutoScalingGroup's UserData. If you don't use the signals directly, you are responsible for adding such a call yourself.

        The following type of Signals are available:

          There are two options you can configure:

            Update Policy

            The update policy describes what should happen to running instances when the definition of the AutoScalingGroup is changed. For example, if you add a command to the UserData of an AutoScalingGroup, do the existing instances get replaced with new instances that have executed the new UserData? Or do the "old" instances just keep on running?

            It is recommended to always use an update policy, otherwise the current state of your instances also depends the previous state of your instances, rather than just on your source code. This degrades the reproducibility of your deployments.

            The following update policies are available:

              Allowing Connections

              See the documentation of the @aws-cdk/aws-ec2 package for more information about allowing connections between resources backed by instances.

              Max Instance Lifetime

              To enable the max instance lifetime support, specify maxInstanceLifetime property for the AutoscalingGroup resource. The value must be between 7 and 365 days(inclusive). To clear a previously set value, leave this property undefined.

              Instance Monitoring

              To disable detailed instance monitoring, specify instanceMonitoring property for the AutoscalingGroup resource as Monitoring.BASIC. Otherwise detailed monitoring will be enabled.

              Monitoring Group Metrics

              Group metrics are used to monitor group level properties; they describe the group rather than any of its instances (e.g GroupMaxSize, the group maximum size). To enable group metrics monitoring, use the groupMetrics property. All group metrics are reported in a granularity of 1 minute at no additional charge.

              See EC2 docs for a list of all available group metrics.

              To enable group metrics monitoring using the groupMetrics property:

              Vpc vpc;
              InstanceType instanceType;
              IMachineImage machineImage;
              
              
              // Enable monitoring of all group metrics
              // Enable monitoring of all group metrics
              new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
                  Vpc = vpc,
                  InstanceType = instanceType,
                  MachineImage = machineImage,
              
                  // ...
              
                  GroupMetrics = new [] { GroupMetrics.All() }
              });
              
              // Enable monitoring for a subset of group metrics
              // Enable monitoring for a subset of group metrics
              new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
                  Vpc = vpc,
                  InstanceType = instanceType,
                  MachineImage = machineImage,
              
                  // ...
              
                  GroupMetrics = new [] { new GroupMetrics(GroupMetric.MIN_SIZE, GroupMetric.MAX_SIZE) }
              });

              Termination policies

              Auto Scaling uses termination policies to determine which instances it terminates first during scale-in events. You can specify one or more termination policies with the terminationPolicies property:

              Vpc vpc;
              InstanceType instanceType;
              IMachineImage machineImage;
              
              
              new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
                  Vpc = vpc,
                  InstanceType = instanceType,
                  MachineImage = machineImage,
              
                  // ...
              
                  TerminationPolicies = new [] { TerminationPolicy.OLDEST_INSTANCE, TerminationPolicy.DEFAULT }
              });

              Protecting new instances from being terminated on scale-in

              By default, Auto Scaling can terminate an instance at any time after launch when scaling in an Auto Scaling Group, subject to the group's termination policy.

              However, you may wish to protect newly-launched instances from being scaled in if they are going to run critical applications that should not be prematurely terminated. EC2 Capacity Providers for Amazon ECS requires this attribute be set to true.

              Vpc vpc;
              InstanceType instanceType;
              IMachineImage machineImage;
              
              
              new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
                  Vpc = vpc,
                  InstanceType = instanceType,
                  MachineImage = machineImage,
              
                  // ...
              
                  NewInstancesProtectedFromScaleIn = true
              });

              Configuring Instance Metadata Service (IMDS)

              Toggling IMDSv1

              You can configure EC2 Instance Metadata Service options to either allow both IMDSv1 and IMDSv2 or enforce IMDSv2 when interacting with the IMDS.

              To do this for a single AutoScalingGroup, you can use set the requireImdsv2 property. The example below demonstrates IMDSv2 being required on a single AutoScalingGroup:

              Vpc vpc;
              InstanceType instanceType;
              IMachineImage machineImage;
              
              
              new AutoScalingGroup(this, "ASG", new AutoScalingGroupProps {
                  Vpc = vpc,
                  InstanceType = instanceType,
                  MachineImage = machineImage,
              
                  // ...
              
                  RequireImdsv2 = true
              });

              You can also use AutoScalingGroupRequireImdsv2Aspect to apply the operation to multiple AutoScalingGroups. The example below demonstrates the AutoScalingGroupRequireImdsv2Aspect being used to require IMDSv2 for all AutoScalingGroups in a stack:

              var aspect = new AutoScalingGroupRequireImdsv2Aspect();
              
              Aspects.Of(this).Add(aspect);

              Warm Pool

              Auto Scaling offers a warm pool which gives an ability to decrease latency for applications that have exceptionally long boot times. You can create a warm pool with default parameters as below:

              AutoScalingGroup autoScalingGroup;
              
              
              autoScalingGroup.AddWarmPool();

              You can also customize a warm pool by configuring parameters:

              AutoScalingGroup autoScalingGroup;
              
              
              autoScalingGroup.AddWarmPool(new WarmPoolOptions {
                  MinSize = 1,
                  ReuseOnScaleIn = true
              });

              Future work

                Classes

                AdjustmentTier

                An adjustment.

                AdjustmentType

                How adjustment numbers are interpreted.

                ApplyCloudFormationInitOptions

                Options for applying CloudFormation init to an instance or instance group.

                AutoScalingGroup

                A Fleet represents a managed set of EC2 instances.

                AutoScalingGroupProps

                Properties of a Fleet.

                AutoScalingGroupRequireImdsv2Aspect

                Aspect that makes IMDSv2 required on instances deployed by AutoScalingGroups.

                BaseTargetTrackingProps

                Base interface for target tracking props.

                BasicLifecycleHookProps

                Basic properties for a lifecycle hook.

                BasicScheduledActionProps

                Properties for a scheduled scaling action.

                BasicStepScalingPolicyProps
                BasicTargetTrackingScalingPolicyProps

                Properties for a Target Tracking policy that include the metric but exclude the target.

                BindHookTargetOptions

                Options needed to bind a target to a lifecycle hook.

                BlockDevice

                Block device.

                BlockDeviceVolume

                Describes a block device mapping for an EC2 instance or Auto Scaling group.

                CfnAutoScalingGroup

                A CloudFormation AWS::AutoScaling::AutoScalingGroup.

                CfnAutoScalingGroup.AcceleratorCountRequestProperty

                AcceleratorCountRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum number of accelerators for an instance type.

                CfnAutoScalingGroup.AcceleratorTotalMemoryMiBRequestProperty

                AcceleratorTotalMemoryMiBRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum total memory size for the accelerators for an instance type, in MiB.

                CfnAutoScalingGroup.BaselineEbsBandwidthMbpsRequestProperty

                BaselineEbsBandwidthMbpsRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum baseline bandwidth performance for an instance type, in Mbps.

                CfnAutoScalingGroup.InstanceRequirementsProperty

                The attributes for the instance types for a mixed instances policy.

                CfnAutoScalingGroup.InstancesDistributionProperty

                Use this structure to specify the distribution of On-Demand Instances and Spot Instances and the allocation strategies used to fulfill On-Demand and Spot capacities for a mixed instances policy.

                CfnAutoScalingGroup.LaunchTemplateOverridesProperty

                Use this structure to let Amazon EC2 Auto Scaling do the following when the Auto Scaling group has a mixed instances policy: - Override the instance type that is specified in the launch template.

                CfnAutoScalingGroup.LaunchTemplateProperty

                Use this structure to specify the launch templates and instance types (overrides) for a mixed instances policy.

                CfnAutoScalingGroup.LaunchTemplateSpecificationProperty

                Specifies a launch template to use when provisioning EC2 instances for an Auto Scaling group.

                CfnAutoScalingGroup.LifecycleHookSpecificationProperty

                LifecycleHookSpecification specifies a lifecycle hook for the LifecycleHookSpecificationList property of the AWS::AutoScaling::AutoScalingGroup resource. A lifecycle hook specifies actions to perform when Amazon EC2 Auto Scaling launches or terminates instances.

                CfnAutoScalingGroup.MemoryGiBPerVCpuRequestProperty

                MemoryGiBPerVCpuRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum amount of memory per vCPU for an instance type, in GiB.

                CfnAutoScalingGroup.MemoryMiBRequestProperty

                MemoryMiBRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum instance memory size for an instance type, in MiB.

                CfnAutoScalingGroup.MetricsCollectionProperty

                MetricsCollection is a property of the AWS::AutoScaling::AutoScalingGroup resource that describes the group metrics that an Amazon EC2 Auto Scaling group sends to Amazon CloudWatch. These metrics describe the group rather than any of its instances.

                CfnAutoScalingGroup.MixedInstancesPolicyProperty

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

                CfnAutoScalingGroup.NetworkBandwidthGbpsRequestProperty

                NetworkBandwidthGbpsRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum network bandwidth for an instance type, in Gbps.

                CfnAutoScalingGroup.NetworkInterfaceCountRequestProperty

                NetworkInterfaceCountRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum number of network interfaces for an instance type.

                CfnAutoScalingGroup.NotificationConfigurationProperty

                A structure that specifies an Amazon SNS notification configuration for the NotificationConfigurations property of the AWS::AutoScaling::AutoScalingGroup resource.

                CfnAutoScalingGroup.TagPropertyProperty

                A structure that specifies a tag for the Tags property of AWS::AutoScaling::AutoScalingGroup resource.

                CfnAutoScalingGroup.TotalLocalStorageGBRequestProperty

                TotalLocalStorageGBRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum total local storage size for an instance type, in GB.

                CfnAutoScalingGroup.VCpuCountRequestProperty

                VCpuCountRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum number of vCPUs for an instance type.

                CfnAutoScalingGroupProps

                Properties for defining a CfnAutoScalingGroup.

                CfnLaunchConfiguration

                A CloudFormation AWS::AutoScaling::LaunchConfiguration.

                CfnLaunchConfiguration.BlockDeviceMappingProperty

                BlockDeviceMapping specifies a block device mapping for the BlockDeviceMappings property of the AWS::AutoScaling::LaunchConfiguration resource.

                CfnLaunchConfiguration.BlockDeviceProperty

                BlockDevice is a property of the EBS property of the AWS::AutoScaling::LaunchConfiguration BlockDeviceMapping property type that describes an Amazon EBS volume.

                CfnLaunchConfiguration.MetadataOptionsProperty

                MetadataOptions is a property of AWS::AutoScaling::LaunchConfiguration that describes metadata options for the instances.

                CfnLaunchConfigurationProps

                Properties for defining a CfnLaunchConfiguration.

                CfnLifecycleHook

                A CloudFormation AWS::AutoScaling::LifecycleHook.

                CfnLifecycleHookProps

                Properties for defining a CfnLifecycleHook.

                CfnScalingPolicy

                A CloudFormation AWS::AutoScaling::ScalingPolicy.

                CfnScalingPolicy.CustomizedMetricSpecificationProperty

                Contains customized metric specification information for a target tracking scaling policy for Amazon EC2 Auto Scaling.

                CfnScalingPolicy.MetricDataQueryProperty

                The metric data to return.

                CfnScalingPolicy.MetricDimensionProperty

                MetricDimension specifies a name/value pair that is part of the identity of a CloudWatch metric for the Dimensions property of the AWS::AutoScaling::ScalingPolicy CustomizedMetricSpecification property type. Duplicate dimensions are not allowed.

                CfnScalingPolicy.MetricProperty

                Represents a specific metric.

                CfnScalingPolicy.MetricStatProperty

                MetricStat is a property of the AWS::AutoScaling::ScalingPolicy MetricDataQuery property type.

                CfnScalingPolicy.PredefinedMetricSpecificationProperty

                Contains predefined metric specification information for a target tracking scaling policy for Amazon EC2 Auto Scaling.

                CfnScalingPolicy.PredictiveScalingConfigurationProperty

                PredictiveScalingConfiguration is a property of the AWS::AutoScaling::ScalingPolicy resource that specifies a predictive scaling policy for Amazon EC2 Auto Scaling.

                CfnScalingPolicy.PredictiveScalingCustomizedCapacityMetricProperty

                Contains capacity metric information for the CustomizedCapacityMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.PredictiveScalingCustomizedLoadMetricProperty

                Contains load metric information for the CustomizedLoadMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.PredictiveScalingCustomizedScalingMetricProperty

                Contains scaling metric information for the CustomizedScalingMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.PredictiveScalingMetricSpecificationProperty

                A structure that specifies a metric specification for the MetricSpecifications property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingConfiguration property type.

                CfnScalingPolicy.PredictiveScalingPredefinedLoadMetricProperty

                Contains load metric information for the PredefinedLoadMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.PredictiveScalingPredefinedMetricPairProperty

                Contains metric pair information for the PredefinedMetricPairSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.PredictiveScalingPredefinedScalingMetricProperty

                Contains scaling metric information for the PredefinedScalingMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.StepAdjustmentProperty

                StepAdjustment specifies a step adjustment for the StepAdjustments property of the AWS::AutoScaling::ScalingPolicy resource.

                CfnScalingPolicy.TargetTrackingConfigurationProperty

                TargetTrackingConfiguration is a property of the AWS::AutoScaling::ScalingPolicy resource that specifies a target tracking scaling policy configuration for Amazon EC2 Auto Scaling.

                CfnScalingPolicyProps

                Properties for defining a CfnScalingPolicy.

                CfnScheduledAction

                A CloudFormation AWS::AutoScaling::ScheduledAction.

                CfnScheduledActionProps

                Properties for defining a CfnScheduledAction.

                CfnWarmPool

                A CloudFormation AWS::AutoScaling::WarmPool.

                CfnWarmPool.InstanceReusePolicyProperty

                A structure that specifies an instance reuse policy for the InstanceReusePolicy property of the AWS::AutoScaling::WarmPool resource.

                CfnWarmPoolProps

                Properties for defining a CfnWarmPool.

                CommonAutoScalingGroupProps

                Basic properties of an AutoScalingGroup, except the exact machines to run and where they should run.

                CpuUtilizationScalingProps

                Properties for enabling scaling based on CPU utilization.

                CronOptions

                Options to configure a cron expression.

                DefaultResult
                EbsDeviceOptions

                Block device options for an EBS volume.

                EbsDeviceOptionsBase

                Base block device options for an EBS volume.

                EbsDeviceProps

                Properties of an EBS block device.

                EbsDeviceSnapshotOptions

                Block device options for an EBS volume created from a snapshot.

                EbsDeviceVolumeType

                Supported EBS volume types for blockDevices.

                Ec2HealthCheckOptions

                EC2 Heath check options.

                ElbHealthCheckOptions

                ELB Heath check options.

                GroupMetric

                Group metrics that an Auto Scaling group sends to Amazon CloudWatch.

                GroupMetrics

                A set of group metrics.

                HealthCheck

                Health check settings.

                InstancesDistribution

                InstancesDistribution is a subproperty of MixedInstancesPolicy that describes an instances distribution for an Auto Scaling group.

                LaunchTemplateOverrides

                LaunchTemplateOverrides is a subproperty of LaunchTemplate that describes an override for a launch template.

                LifecycleHook

                Define a life cycle hook.

                LifecycleHookProps

                Properties for a Lifecycle hook.

                LifecycleHookTargetConfig

                Result of binding a lifecycle hook to a target.

                LifecycleTransition

                What instance transition to attach the hook to.

                MetricAggregationType

                How the scaling metric is going to be aggregated.

                MetricTargetTrackingProps

                Properties for enabling tracking of an arbitrary metric.

                MixedInstancesPolicy

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

                Monitoring

                The monitoring mode for instances launched in an autoscaling group.

                NetworkUtilizationScalingProps

                Properties for enabling scaling based on network utilization.

                NotificationConfiguration

                AutoScalingGroup fleet change notifications configurations.

                OnDemandAllocationStrategy

                Indicates how to allocate instance types to fulfill On-Demand capacity.

                PoolState

                The instance state in the warm pool.

                PredefinedMetric

                One of the predefined autoscaling metrics.

                RenderSignalsOptions

                Input for Signals.renderCreationPolicy.

                RequestCountScalingProps

                Properties for enabling scaling based on request/second.

                RollingUpdateConfiguration

                (deprecated) Additional settings when a rolling update is selected.

                RollingUpdateOptions

                Options for customizing the rolling update.

                ScalingEvent

                Fleet scaling events.

                ScalingEvents

                A list of ScalingEvents, you can use one of the predefined lists, such as ScalingEvents.ERRORS or create a custom group by instantiating a NotificationTypes object, e.g: new NotificationTypes(NotificationType.INSTANCE_LAUNCH).

                ScalingInterval

                A range of metric values in which to apply a certain scaling operation.

                ScalingProcess
                Schedule

                Schedule for scheduled scaling actions.

                ScheduledAction

                Define a scheduled scaling action.

                ScheduledActionProps

                Properties for a scheduled action on an AutoScalingGroup.

                Signals

                Configure whether the AutoScalingGroup waits for signals.

                SignalsOptions

                Customization options for Signal handling.

                SpotAllocationStrategy

                Indicates how to allocate instance types to fulfill Spot capacity.

                StepScalingAction

                Define a step scaling action.

                StepScalingActionProps

                Properties for a scaling policy.

                StepScalingPolicy

                Define a acaling strategy which scales depending on absolute values of some metric.

                StepScalingPolicyProps
                TargetTrackingScalingPolicy
                TargetTrackingScalingPolicyProps

                Properties for a concrete TargetTrackingPolicy.

                TerminationPolicy

                Specifies the termination criteria to apply before Amazon EC2 Auto Scaling chooses an instance for termination.

                UpdatePolicy

                How existing instances should be updated.

                UpdateType

                (deprecated) The type of update to perform on instances in this AutoScalingGroup.

                WarmPool

                Define a warm pool.

                WarmPoolOptions

                Options for a warm pool.

                WarmPoolProps

                Properties for a warm pool.

                Interfaces

                CfnAutoScalingGroup.IAcceleratorCountRequestProperty

                AcceleratorCountRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum number of accelerators for an instance type.

                CfnAutoScalingGroup.IAcceleratorTotalMemoryMiBRequestProperty

                AcceleratorTotalMemoryMiBRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum total memory size for the accelerators for an instance type, in MiB.

                CfnAutoScalingGroup.IBaselineEbsBandwidthMbpsRequestProperty

                BaselineEbsBandwidthMbpsRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum baseline bandwidth performance for an instance type, in Mbps.

                CfnAutoScalingGroup.IInstanceRequirementsProperty

                The attributes for the instance types for a mixed instances policy.

                CfnAutoScalingGroup.IInstancesDistributionProperty

                Use this structure to specify the distribution of On-Demand Instances and Spot Instances and the allocation strategies used to fulfill On-Demand and Spot capacities for a mixed instances policy.

                CfnAutoScalingGroup.ILaunchTemplateOverridesProperty

                Use this structure to let Amazon EC2 Auto Scaling do the following when the Auto Scaling group has a mixed instances policy: - Override the instance type that is specified in the launch template.

                CfnAutoScalingGroup.ILaunchTemplateProperty

                Use this structure to specify the launch templates and instance types (overrides) for a mixed instances policy.

                CfnAutoScalingGroup.ILaunchTemplateSpecificationProperty

                Specifies a launch template to use when provisioning EC2 instances for an Auto Scaling group.

                CfnAutoScalingGroup.ILifecycleHookSpecificationProperty

                LifecycleHookSpecification specifies a lifecycle hook for the LifecycleHookSpecificationList property of the AWS::AutoScaling::AutoScalingGroup resource. A lifecycle hook specifies actions to perform when Amazon EC2 Auto Scaling launches or terminates instances.

                CfnAutoScalingGroup.IMemoryGiBPerVCpuRequestProperty

                MemoryGiBPerVCpuRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum amount of memory per vCPU for an instance type, in GiB.

                CfnAutoScalingGroup.IMemoryMiBRequestProperty

                MemoryMiBRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum instance memory size for an instance type, in MiB.

                CfnAutoScalingGroup.IMetricsCollectionProperty

                MetricsCollection is a property of the AWS::AutoScaling::AutoScalingGroup resource that describes the group metrics that an Amazon EC2 Auto Scaling group sends to Amazon CloudWatch. These metrics describe the group rather than any of its instances.

                CfnAutoScalingGroup.IMixedInstancesPolicyProperty

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

                CfnAutoScalingGroup.INetworkBandwidthGbpsRequestProperty

                NetworkBandwidthGbpsRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum network bandwidth for an instance type, in Gbps.

                CfnAutoScalingGroup.INetworkInterfaceCountRequestProperty

                NetworkInterfaceCountRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum number of network interfaces for an instance type.

                CfnAutoScalingGroup.INotificationConfigurationProperty

                A structure that specifies an Amazon SNS notification configuration for the NotificationConfigurations property of the AWS::AutoScaling::AutoScalingGroup resource.

                CfnAutoScalingGroup.ITagPropertyProperty

                A structure that specifies a tag for the Tags property of AWS::AutoScaling::AutoScalingGroup resource.

                CfnAutoScalingGroup.ITotalLocalStorageGBRequestProperty

                TotalLocalStorageGBRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum total local storage size for an instance type, in GB.

                CfnAutoScalingGroup.IVCpuCountRequestProperty

                VCpuCountRequest is a property of the InstanceRequirements property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property type that describes the minimum and maximum number of vCPUs for an instance type.

                CfnLaunchConfiguration.IBlockDeviceMappingProperty

                BlockDeviceMapping specifies a block device mapping for the BlockDeviceMappings property of the AWS::AutoScaling::LaunchConfiguration resource.

                CfnLaunchConfiguration.IBlockDeviceProperty

                BlockDevice is a property of the EBS property of the AWS::AutoScaling::LaunchConfiguration BlockDeviceMapping property type that describes an Amazon EBS volume.

                CfnLaunchConfiguration.IMetadataOptionsProperty

                MetadataOptions is a property of AWS::AutoScaling::LaunchConfiguration that describes metadata options for the instances.

                CfnScalingPolicy.ICustomizedMetricSpecificationProperty

                Contains customized metric specification information for a target tracking scaling policy for Amazon EC2 Auto Scaling.

                CfnScalingPolicy.IMetricDataQueryProperty

                The metric data to return.

                CfnScalingPolicy.IMetricDimensionProperty

                MetricDimension specifies a name/value pair that is part of the identity of a CloudWatch metric for the Dimensions property of the AWS::AutoScaling::ScalingPolicy CustomizedMetricSpecification property type. Duplicate dimensions are not allowed.

                CfnScalingPolicy.IMetricProperty

                Represents a specific metric.

                CfnScalingPolicy.IMetricStatProperty

                MetricStat is a property of the AWS::AutoScaling::ScalingPolicy MetricDataQuery property type.

                CfnScalingPolicy.IPredefinedMetricSpecificationProperty

                Contains predefined metric specification information for a target tracking scaling policy for Amazon EC2 Auto Scaling.

                CfnScalingPolicy.IPredictiveScalingConfigurationProperty

                PredictiveScalingConfiguration is a property of the AWS::AutoScaling::ScalingPolicy resource that specifies a predictive scaling policy for Amazon EC2 Auto Scaling.

                CfnScalingPolicy.IPredictiveScalingCustomizedCapacityMetricProperty

                Contains capacity metric information for the CustomizedCapacityMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.IPredictiveScalingCustomizedLoadMetricProperty

                Contains load metric information for the CustomizedLoadMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.IPredictiveScalingCustomizedScalingMetricProperty

                Contains scaling metric information for the CustomizedScalingMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.IPredictiveScalingMetricSpecificationProperty

                A structure that specifies a metric specification for the MetricSpecifications property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingConfiguration property type.

                CfnScalingPolicy.IPredictiveScalingPredefinedLoadMetricProperty

                Contains load metric information for the PredefinedLoadMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.IPredictiveScalingPredefinedMetricPairProperty

                Contains metric pair information for the PredefinedMetricPairSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.IPredictiveScalingPredefinedScalingMetricProperty

                Contains scaling metric information for the PredefinedScalingMetricSpecification property of the AWS::AutoScaling::ScalingPolicy PredictiveScalingMetricSpecification property type.

                CfnScalingPolicy.IStepAdjustmentProperty

                StepAdjustment specifies a step adjustment for the StepAdjustments property of the AWS::AutoScaling::ScalingPolicy resource.

                CfnScalingPolicy.ITargetTrackingConfigurationProperty

                TargetTrackingConfiguration is a property of the AWS::AutoScaling::ScalingPolicy resource that specifies a target tracking scaling policy configuration for Amazon EC2 Auto Scaling.

                CfnWarmPool.IInstanceReusePolicyProperty

                A structure that specifies an instance reuse policy for the InstanceReusePolicy property of the AWS::AutoScaling::WarmPool resource.

                IAdjustmentTier

                An adjustment.

                IApplyCloudFormationInitOptions

                Options for applying CloudFormation init to an instance or instance group.

                IAutoScalingGroup

                An AutoScalingGroup.

                IAutoScalingGroupProps

                Properties of a Fleet.

                IBaseTargetTrackingProps

                Base interface for target tracking props.

                IBasicLifecycleHookProps

                Basic properties for a lifecycle hook.

                IBasicScheduledActionProps

                Properties for a scheduled scaling action.

                IBasicStepScalingPolicyProps
                IBasicTargetTrackingScalingPolicyProps

                Properties for a Target Tracking policy that include the metric but exclude the target.

                IBindHookTargetOptions

                Options needed to bind a target to a lifecycle hook.

                IBlockDevice

                Block device.

                ICfnAutoScalingGroupProps

                Properties for defining a CfnAutoScalingGroup.

                ICfnLaunchConfigurationProps

                Properties for defining a CfnLaunchConfiguration.

                ICfnLifecycleHookProps

                Properties for defining a CfnLifecycleHook.

                ICfnScalingPolicyProps

                Properties for defining a CfnScalingPolicy.

                ICfnScheduledActionProps

                Properties for defining a CfnScheduledAction.

                ICfnWarmPoolProps

                Properties for defining a CfnWarmPool.

                ICommonAutoScalingGroupProps

                Basic properties of an AutoScalingGroup, except the exact machines to run and where they should run.

                ICpuUtilizationScalingProps

                Properties for enabling scaling based on CPU utilization.

                ICronOptions

                Options to configure a cron expression.

                IEbsDeviceOptions

                Block device options for an EBS volume.

                IEbsDeviceOptionsBase

                Base block device options for an EBS volume.

                IEbsDeviceProps

                Properties of an EBS block device.

                IEbsDeviceSnapshotOptions

                Block device options for an EBS volume created from a snapshot.

                IEc2HealthCheckOptions

                EC2 Heath check options.

                IElbHealthCheckOptions

                ELB Heath check options.

                IInstancesDistribution

                InstancesDistribution is a subproperty of MixedInstancesPolicy that describes an instances distribution for an Auto Scaling group.

                ILaunchTemplateOverrides

                LaunchTemplateOverrides is a subproperty of LaunchTemplate that describes an override for a launch template.

                ILifecycleHook

                A basic lifecycle hook object.

                ILifecycleHookProps

                Properties for a Lifecycle hook.

                ILifecycleHookTarget

                Interface for autoscaling lifecycle hook targets.

                ILifecycleHookTargetConfig

                Result of binding a lifecycle hook to a target.

                IMetricTargetTrackingProps

                Properties for enabling tracking of an arbitrary metric.

                IMixedInstancesPolicy

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

                INetworkUtilizationScalingProps

                Properties for enabling scaling based on network utilization.

                INotificationConfiguration

                AutoScalingGroup fleet change notifications configurations.

                IRenderSignalsOptions

                Input for Signals.renderCreationPolicy.

                IRequestCountScalingProps

                Properties for enabling scaling based on request/second.

                IRollingUpdateConfiguration

                (deprecated) Additional settings when a rolling update is selected.

                IRollingUpdateOptions

                Options for customizing the rolling update.

                IScalingInterval

                A range of metric values in which to apply a certain scaling operation.

                IScheduledActionProps

                Properties for a scheduled action on an AutoScalingGroup.

                ISignalsOptions

                Customization options for Signal handling.

                IStepScalingActionProps

                Properties for a scaling policy.

                IStepScalingPolicyProps
                ITargetTrackingScalingPolicyProps

                Properties for a concrete TargetTrackingPolicy.

                IWarmPoolOptions

                Options for a warm pool.

                IWarmPoolProps

                Properties for a warm pool.

                Back to top Generated by DocFX