CfnAutoScalingGroup

class aws_cdk.aws_autoscaling.CfnAutoScalingGroup(scope, id, *, max_size, min_size, auto_scaling_group_name=None, availability_zones=None, capacity_rebalance=None, context=None, cooldown=None, default_instance_warmup=None, desired_capacity=None, desired_capacity_type=None, health_check_grace_period=None, health_check_type=None, instance_id=None, launch_configuration_name=None, launch_template=None, lifecycle_hook_specification_list=None, load_balancer_names=None, max_instance_lifetime=None, metrics_collection=None, mixed_instances_policy=None, new_instances_protected_from_scale_in=None, notification_configurations=None, placement_group=None, service_linked_role_arn=None, tags=None, target_group_arns=None, termination_policies=None, vpc_zone_identifier=None)

Bases: CfnResource

A CloudFormation AWS::AutoScaling::AutoScalingGroup.

The AWS::AutoScaling::AutoScalingGroup resource defines an Amazon EC2 Auto Scaling group, which is a collection of Amazon EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management.

For more information about Amazon EC2 Auto Scaling, see the Amazon EC2 Auto Scaling User Guide . .. epigraph:

Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a launch template or a launch configuration. We strongly recommend that you do not use launch configurations. They do not provide full functionality for Amazon EC2 Auto Scaling or Amazon EC2. For more information, see `Amazon EC2 Auto Scaling will no longer add support for new EC2 features to Launch Configurations <https://docs.aws.amazon.com/compute/amazon-ec2-auto-scaling-will-no-longer-add-support-for-new-ec2-features-to-launch-configurations/>`_ on the AWS Compute Blog.
CloudformationResource

AWS::AutoScaling::AutoScalingGroup

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

cfn_auto_scaling_group = autoscaling.CfnAutoScalingGroup(self, "MyCfnAutoScalingGroup",
    max_size="maxSize",
    min_size="minSize",

    # the properties below are optional
    auto_scaling_group_name="autoScalingGroupName",
    availability_zones=["availabilityZones"],
    capacity_rebalance=False,
    context="context",
    cooldown="cooldown",
    default_instance_warmup=123,
    desired_capacity="desiredCapacity",
    desired_capacity_type="desiredCapacityType",
    health_check_grace_period=123,
    health_check_type="healthCheckType",
    instance_id="instanceId",
    launch_configuration_name="launchConfigurationName",
    launch_template=autoscaling.CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(
        version="version",

        # the properties below are optional
        launch_template_id="launchTemplateId",
        launch_template_name="launchTemplateName"
    ),
    lifecycle_hook_specification_list=[autoscaling.CfnAutoScalingGroup.LifecycleHookSpecificationProperty(
        lifecycle_hook_name="lifecycleHookName",
        lifecycle_transition="lifecycleTransition",

        # the properties below are optional
        default_result="defaultResult",
        heartbeat_timeout=123,
        notification_metadata="notificationMetadata",
        notification_target_arn="notificationTargetArn",
        role_arn="roleArn"
    )],
    load_balancer_names=["loadBalancerNames"],
    max_instance_lifetime=123,
    metrics_collection=[autoscaling.CfnAutoScalingGroup.MetricsCollectionProperty(
        granularity="granularity",

        # the properties below are optional
        metrics=["metrics"]
    )],
    mixed_instances_policy=autoscaling.CfnAutoScalingGroup.MixedInstancesPolicyProperty(
        launch_template=autoscaling.CfnAutoScalingGroup.LaunchTemplateProperty(
            launch_template_specification=autoscaling.CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(
                version="version",

                # the properties below are optional
                launch_template_id="launchTemplateId",
                launch_template_name="launchTemplateName"
            ),

            # the properties below are optional
            overrides=[autoscaling.CfnAutoScalingGroup.LaunchTemplateOverridesProperty(
                instance_requirements=autoscaling.CfnAutoScalingGroup.InstanceRequirementsProperty(
                    accelerator_count=autoscaling.CfnAutoScalingGroup.AcceleratorCountRequestProperty(
                        max=123,
                        min=123
                    ),
                    accelerator_manufacturers=["acceleratorManufacturers"],
                    accelerator_names=["acceleratorNames"],
                    accelerator_total_memory_mi_b=autoscaling.CfnAutoScalingGroup.AcceleratorTotalMemoryMiBRequestProperty(
                        max=123,
                        min=123
                    ),
                    accelerator_types=["acceleratorTypes"],
                    bare_metal="bareMetal",
                    baseline_ebs_bandwidth_mbps=autoscaling.CfnAutoScalingGroup.BaselineEbsBandwidthMbpsRequestProperty(
                        max=123,
                        min=123
                    ),
                    burstable_performance="burstablePerformance",
                    cpu_manufacturers=["cpuManufacturers"],
                    excluded_instance_types=["excludedInstanceTypes"],
                    instance_generations=["instanceGenerations"],
                    local_storage="localStorage",
                    local_storage_types=["localStorageTypes"],
                    memory_gi_bPer_vCpu=autoscaling.CfnAutoScalingGroup.MemoryGiBPerVCpuRequestProperty(
                        max=123,
                        min=123
                    ),
                    memory_mi_b=autoscaling.CfnAutoScalingGroup.MemoryMiBRequestProperty(
                        max=123,
                        min=123
                    ),
                    network_interface_count=autoscaling.CfnAutoScalingGroup.NetworkInterfaceCountRequestProperty(
                        max=123,
                        min=123
                    ),
                    on_demand_max_price_percentage_over_lowest_price=123,
                    require_hibernate_support=False,
                    spot_max_price_percentage_over_lowest_price=123,
                    total_local_storage_gb=autoscaling.CfnAutoScalingGroup.TotalLocalStorageGBRequestProperty(
                        max=123,
                        min=123
                    ),
                    v_cpu_count=autoscaling.CfnAutoScalingGroup.VCpuCountRequestProperty(
                        max=123,
                        min=123
                    )
                ),
                instance_type="instanceType",
                launch_template_specification=autoscaling.CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(
                    version="version",

                    # the properties below are optional
                    launch_template_id="launchTemplateId",
                    launch_template_name="launchTemplateName"
                ),
                weighted_capacity="weightedCapacity"
            )]
        ),

        # the properties below are optional
        instances_distribution=autoscaling.CfnAutoScalingGroup.InstancesDistributionProperty(
            on_demand_allocation_strategy="onDemandAllocationStrategy",
            on_demand_base_capacity=123,
            on_demand_percentage_above_base_capacity=123,
            spot_allocation_strategy="spotAllocationStrategy",
            spot_instance_pools=123,
            spot_max_price="spotMaxPrice"
        )
    ),
    new_instances_protected_from_scale_in=False,
    notification_configurations=[autoscaling.CfnAutoScalingGroup.NotificationConfigurationProperty(
        topic_arn="topicArn",

        # the properties below are optional
        notification_types=["notificationTypes"]
    )],
    placement_group="placementGroup",
    service_linked_role_arn="serviceLinkedRoleArn",
    tags=[autoscaling.CfnAutoScalingGroup.TagPropertyProperty(
        key="key",
        propagate_at_launch=False,
        value="value"
    )],
    target_group_arns=["targetGroupArns"],
    termination_policies=["terminationPolicies"],
    vpc_zone_identifier=["vpcZoneIdentifier"]
)

Create a new AWS::AutoScaling::AutoScalingGroup.

Parameters
  • scope (Construct) –

    • scope in which this resource is defined.

  • id (str) –

    • scoped id of the resource.

  • max_size (str) – The maximum size of the group. .. epigraph:: With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above MaxSize to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go above MaxSize by more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group).

  • min_size (str) – The minimum size of the group.

  • auto_scaling_group_name (Optional[str]) – The name of the Auto Scaling group. This name must be unique per Region per account.

  • availability_zones (Optional[Sequence[str]]) – A list of Availability Zones where instances in the Auto Scaling group can be created. Used for launching into EC2-Classic or the default VPC subnet in each Availability Zone when not using the VPCZoneIdentifier property, or for attaching a network interface when an existing network interface ID is specified in a launch template.

  • capacity_rebalance (Union[bool, IResolvable, None]) – Indicates whether Capacity Rebalancing is enabled. Otherwise, Capacity Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates an old instance. For more information, see Use Capacity Rebalancing to handle Amazon EC2 Spot Interruptions in the in the Amazon EC2 Auto Scaling User Guide .

  • context (Optional[str]) – Reserved.

  • cooldown (Optional[str]) – Only needed if you use simple scaling policies.. The amount of time, in seconds, between one scaling activity ending and another one starting due to simple scaling policies. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide . Default: 300 seconds

  • default_instance_warmup (Union[int, float, None]) – Not currently supported by CloudFormation.

  • desired_capacity (Optional[str]) – The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the capacity it attempts to maintain. It can scale beyond this capacity if you configure automatic scaling. The number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group. If you do not specify a desired capacity when creating the stack, the default is the minimum size of the group. CloudFormation marks the Auto Scaling group as successful (by setting its status to CREATE_COMPLETE) when the desired capacity is reached. However, if a maximum Spot price is set in the launch template or launch configuration that you specified, then desired capacity is not used as a criteria for success. Whether your request is fulfilled depends on Spot Instance capacity and your maximum price.

  • desired_capacity_type (Optional[str]) – The unit of measurement for the value specified for desired capacity. Amazon EC2 Auto Scaling supports DesiredCapacityType for attribute-based instance type selection only. For more information, see Creating an Auto Scaling group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User Guide . By default, Amazon EC2 Auto Scaling specifies units , which translates into number of instances. Valid values: units | vcpu | memory-mib

  • health_check_grace_period (Union[int, float, None]) – The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a failed Elastic Load Balancing or custom health check. This is useful if your instances do not immediately pass these health checks after they enter the InService state. For more information, see Health check grace period in the Amazon EC2 Auto Scaling User Guide . Default: 0 seconds

  • health_check_type (Optional[str]) – The service to use for the health checks. The valid values are EC2 (default) and ELB . If you configure an Auto Scaling group to use load balancer (ELB) health checks, it considers the instance unhealthy if it fails either the EC2 status checks or the load balancer health checks. For more information, see Health checks for Auto Scaling instances in the Amazon EC2 Auto Scaling User Guide .

  • instance_id (Optional[str]) – The ID of the instance used to base the launch configuration on. For more information, see Create an Auto Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide . If you specify LaunchTemplate , MixedInstancesPolicy , or LaunchConfigurationName , don’t specify InstanceId .

  • launch_configuration_name (Optional[str]) – The name of the launch configuration to use to launch instances. Required only if you don’t specify LaunchTemplate , MixedInstancesPolicy , or InstanceId .

  • launch_template (Union[IResolvable, LaunchTemplateSpecificationProperty, Dict[str, Any], None]) – Information used to specify the launch template and version to use to launch instances. You can alternatively associate a launch template to the Auto Scaling group by specifying a MixedInstancesPolicy . For more information about creating launch templates, see Create a launch template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide . If you omit this property, you must specify MixedInstancesPolicy , LaunchConfigurationName , or InstanceId .

  • lifecycle_hook_specification_list (Union[IResolvable, Sequence[Union[IResolvable, LifecycleHookSpecificationProperty, Dict[str, Any]]], None]) – One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.

  • load_balancer_names (Optional[Sequence[str]]) – A list of Classic Load Balancers associated with this Auto Scaling group. For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs property instead.

  • max_instance_lifetime (Union[int, float, None]) – The maximum amount of time, in seconds, that an instance can be in service. The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see Replacing Auto Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide .

  • metrics_collection (Union[IResolvable, Sequence[Union[IResolvable, MetricsCollectionProperty, Dict[str, Any]]], None]) – Enables the monitoring of group metrics of an Auto Scaling group. By default, these metrics are disabled.

  • mixed_instances_policy (Union[IResolvable, MixedInstancesPolicyProperty, Dict[str, Any], None]) – An embedded object that specifies a mixed instances policy. The policy includes properties that not only define the distribution of On-Demand Instances and Spot Instances, the maximum price to pay for Spot Instances (optional), and how the Auto Scaling group allocates instance types to fulfill On-Demand and Spot capacities, but also the properties that specify the instance configuration information—the launch template and instance types. The policy can also include a weight for each instance type and different launch templates for individual instance types. For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide .

  • new_instances_protected_from_scale_in (Union[bool, IResolvable, None]) – Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in. For more information about preventing instances from terminating on scale in, see Using instance scale-in protection in the Amazon EC2 Auto Scaling User Guide .

  • notification_configurations (Union[IResolvable, Sequence[Union[IResolvable, NotificationConfigurationProperty, Dict[str, Any]]], None]) – Configures an Auto Scaling group to send notifications when specified events take place.

  • placement_group (Optional[str]) – The name of the placement group into which to launch your instances. For more information, see Placement groups in the Amazon EC2 User Guide for Linux Instances . .. epigraph:: A cluster placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group.

  • service_linked_role_arn (Optional[str]) – The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS service on your behalf. By default, Amazon EC2 Auto Scaling uses a service-linked role named AWSServiceRoleForAutoScaling , which it creates if it does not exist. For more information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide .

  • tags (Optional[Sequence[Union[TagPropertyProperty, Dict[str, Any]]]]) – One or more tags. You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the value specified by the Auto Scaling group. For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide .

  • target_group_arns (Optional[Sequence[str]]) – The Amazon Resource Names (ARN) of the target groups to associate with the Auto Scaling group. Instances are registered as targets in a target group, and traffic is routed to the target group. For more information, see Elastic Load Balancing and Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide .

  • termination_policies (Optional[Sequence[str]]) – A policy or a list of policies that are used to select the instance to terminate. These policies are executed in the order that you list them. For more information, see Work with Amazon EC2 Auto Scaling termination policies in the Amazon EC2 Auto Scaling User Guide . Valid values: Default | AllocationStrategy | ClosestToNextInstanceHour | NewestInstance | OldestInstance | OldestLaunchConfiguration | OldestLaunchTemplate | arn:aws:lambda:region:account-id:function:my-function:my-alias

  • vpc_zone_identifier (Optional[Sequence[str]]) – A list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created. If you specify VPCZoneIdentifier with AvailabilityZones , the subnets that you specify for this property must reside in those Availability Zones. If this resource specifies public subnets and is also in a VPC that is defined in the same stack template, you must use the DependsOn attribute to declare a dependency on the VPC-gateway attachment . Conditional: If your account supports EC2-Classic and VPC, this property is required to launch instances into a VPC. .. epigraph:: When you update VPCZoneIdentifier , this retains the same Auto Scaling group and replaces old instances with new ones, according to the specified subnets. You can optionally specify how CloudFormation handles these updates by using an UpdatePolicy attribute .

Methods

add_deletion_override(path)

Syntactic sugar for addOverride(path, undefined).

Parameters

path (str) – The path of the value to delete.

Return type

None

add_depends_on(target)

Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.

This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.

Parameters

target (CfnResource) –

Return type

None

add_metadata(key, value)

Add a value to the CloudFormation Resource Metadata.

Parameters
  • key (str) –

  • value (Any) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

None

add_override(path, value)

Adds an override to the synthesized CloudFormation resource.

To add a property override, either use addPropertyOverride or prefix path with “Properties.” (i.e. Properties.TopicName).

If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.

To include a literal . in the property name, prefix with a \. In most programming languages you will need to write this as "\\." because the \ itself will need to be escaped.

For example:

cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")

would add the overrides Example:

"Properties": {
   "GlobalSecondaryIndexes": [
     {
       "Projection": {
         "NonKeyAttributes": [ "myattribute" ]
         ...
       }
       ...
     },
     {
       "ProjectionType": "INCLUDE"
       ...
     },
   ]
   ...
}

The value argument to addOverride will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.

Parameters
  • path (str) –

    • The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.

  • value (Any) –

    • The value. Could be primitive or complex.

Return type

None

add_property_deletion_override(property_path)

Adds an override that deletes the value of a property from the resource definition.

Parameters

property_path (str) – The path to the property.

Return type

None

add_property_override(property_path, value)

Adds an override to a resource property.

Syntactic sugar for addOverride("Properties.<...>", value).

Parameters
  • property_path (str) – The path of the property.

  • value (Any) – The value.

Return type

None

apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)

Sets the deletion policy of the resource based on the removal policy specified.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters
  • policy (Optional[RemovalPolicy]) –

  • apply_to_update_replace_policy (Optional[bool]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true

  • default (Optional[RemovalPolicy]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.

Return type

None

get_att(attribute_name)

Returns a token for an runtime attribute of this resource.

Ideally, use generated attribute accessors (e.g. resource.arn), but this can be used for future compatibility in case there is no generated attribute.

Parameters

attribute_name (str) – The name of the attribute.

Return type

Reference

get_metadata(key)

Retrieve a value value from the CloudFormation Resource Metadata.

Parameters

key (str) –

See

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html

Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.

Return type

Any

inspect(inspector)

Examines the CloudFormation resource and discloses attributes.

Parameters

inspector (TreeInspector) –

  • tree inspector to collect and process attributes.

Return type

None

override_logical_id(new_logical_id)

Overrides the auto-generated logical ID with a specific ID.

Parameters

new_logical_id (str) – The new logical ID to use for this stack element.

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Returns

a string representation of this resource

Attributes

CFN_RESOURCE_TYPE_NAME = 'AWS::AutoScaling::AutoScalingGroup'
auto_scaling_group_name

The name of the Auto Scaling group.

This name must be unique per Region per account.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-autoscaling-autoscalinggroup-autoscalinggroupname

Return type

Optional[str]

availability_zones

A list of Availability Zones where instances in the Auto Scaling group can be created.

Used for launching into EC2-Classic or the default VPC subnet in each Availability Zone when not using the VPCZoneIdentifier property, or for attaching a network interface when an existing network interface ID is specified in a launch template.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-availabilityzones

Return type

Optional[List[str]]

capacity_rebalance

Indicates whether Capacity Rebalancing is enabled.

Otherwise, Capacity Rebalancing is disabled. When you turn on Capacity Rebalancing, Amazon EC2 Auto Scaling attempts to launch a Spot Instance whenever Amazon EC2 notifies that a Spot Instance is at an elevated risk of interruption. After launching a new instance, it then terminates an old instance. For more information, see Use Capacity Rebalancing to handle Amazon EC2 Spot Interruptions in the in the Amazon EC2 Auto Scaling User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-capacityrebalance

Return type

Union[bool, IResolvable, None]

cfn_options

Options for this resource, such as condition, update policy etc.

Return type

ICfnResourceOptions

cfn_resource_type

AWS resource type.

Return type

str

context

Reserved.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-context

Return type

Optional[str]

cooldown

Only needed if you use simple scaling policies..

The amount of time, in seconds, between one scaling activity ending and another one starting due to simple scaling policies. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide .

Default: 300 seconds

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-cooldown

Return type

Optional[str]

creation_stack

return:

the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.

Return type

List[str]

default_instance_warmup

Not currently supported by CloudFormation.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-defaultinstancewarmup

Return type

Union[int, float, None]

desired_capacity

The desired capacity is the initial capacity of the Auto Scaling group at the time of its creation and the capacity it attempts to maintain.

It can scale beyond this capacity if you configure automatic scaling.

The number must be greater than or equal to the minimum size of the group and less than or equal to the maximum size of the group. If you do not specify a desired capacity when creating the stack, the default is the minimum size of the group.

CloudFormation marks the Auto Scaling group as successful (by setting its status to CREATE_COMPLETE) when the desired capacity is reached. However, if a maximum Spot price is set in the launch template or launch configuration that you specified, then desired capacity is not used as a criteria for success. Whether your request is fulfilled depends on Spot Instance capacity and your maximum price.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-desiredcapacity

Return type

Optional[str]

desired_capacity_type

The unit of measurement for the value specified for desired capacity.

Amazon EC2 Auto Scaling supports DesiredCapacityType for attribute-based instance type selection only. For more information, see Creating an Auto Scaling group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User Guide .

By default, Amazon EC2 Auto Scaling specifies units , which translates into number of instances.

Valid values: units | vcpu | memory-mib

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-desiredcapacitytype

Return type

Optional[str]

health_check_grace_period

The amount of time, in seconds, that Amazon EC2 Auto Scaling waits before checking the health status of an EC2 instance that has come into service and marking it unhealthy due to a failed Elastic Load Balancing or custom health check.

This is useful if your instances do not immediately pass these health checks after they enter the InService state. For more information, see Health check grace period in the Amazon EC2 Auto Scaling User Guide .

Default: 0 seconds

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-healthcheckgraceperiod

Return type

Union[int, float, None]

health_check_type

The service to use for the health checks.

The valid values are EC2 (default) and ELB . If you configure an Auto Scaling group to use load balancer (ELB) health checks, it considers the instance unhealthy if it fails either the EC2 status checks or the load balancer health checks. For more information, see Health checks for Auto Scaling instances in the Amazon EC2 Auto Scaling User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-healthchecktype

Return type

Optional[str]

instance_id

The ID of the instance used to base the launch configuration on.

For more information, see Create an Auto Scaling group using an EC2 instance in the Amazon EC2 Auto Scaling User Guide .

If you specify LaunchTemplate , MixedInstancesPolicy , or LaunchConfigurationName , don’t specify InstanceId .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-instanceid

Return type

Optional[str]

launch_configuration_name

The name of the launch configuration to use to launch instances.

Required only if you don’t specify LaunchTemplate , MixedInstancesPolicy , or InstanceId .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-launchconfigurationname

Return type

Optional[str]

launch_template

Information used to specify the launch template and version to use to launch instances.

You can alternatively associate a launch template to the Auto Scaling group by specifying a MixedInstancesPolicy . For more information about creating launch templates, see Create a launch template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide .

If you omit this property, you must specify MixedInstancesPolicy , LaunchConfigurationName , or InstanceId .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-launchtemplate

Return type

Union[IResolvable, LaunchTemplateSpecificationProperty, None]

lifecycle_hook_specification_list

One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-autoscaling-autoscalinggroup-lifecyclehookspecificationlist

Return type

Union[IResolvable, List[Union[IResolvable, LifecycleHookSpecificationProperty]], None]

load_balancer_names

A list of Classic Load Balancers associated with this Auto Scaling group.

For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs property instead.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-loadbalancernames

Return type

Optional[List[str]]

logical_id

The logical ID for this CloudFormation stack element.

The logical ID of the element is calculated from the path of the resource node in the construct tree.

To override this value, use overrideLogicalId(newLogicalId).

Return type

str

Returns

the logical ID as a stringified token. This value will only get resolved during synthesis.

max_instance_lifetime

The maximum amount of time, in seconds, that an instance can be in service.

The default is null. If specified, the value must be either 0 or a number equal to or greater than 86,400 seconds (1 day). For more information, see Replacing Auto Scaling instances based on maximum instance lifetime in the Amazon EC2 Auto Scaling User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-maxinstancelifetime

Return type

Union[int, float, None]

max_size

The maximum size of the group.

With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above MaxSize to meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go above MaxSize by more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-maxsize

Return type

str

metrics_collection

Enables the monitoring of group metrics of an Auto Scaling group.

By default, these metrics are disabled.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-metricscollection

Return type

Union[IResolvable, List[Union[IResolvable, MetricsCollectionProperty]], None]

min_size

The minimum size of the group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-minsize

Return type

str

mixed_instances_policy

An embedded object that specifies a mixed instances policy.

The policy includes properties that not only define the distribution of On-Demand Instances and Spot Instances, the maximum price to pay for Spot Instances (optional), and how the Auto Scaling group allocates instance types to fulfill On-Demand and Spot capacities, but also the properties that specify the instance configuration information—the launch template and instance types. The policy can also include a weight for each instance type and different launch templates for individual instance types.

For more information, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-mixedinstancespolicy

Return type

Union[IResolvable, MixedInstancesPolicyProperty, None]

new_instances_protected_from_scale_in

Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.

For more information about preventing instances from terminating on scale in, see Using instance scale-in protection in the Amazon EC2 Auto Scaling User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-newinstancesprotectedfromscalein

Return type

Union[bool, IResolvable, None]

node

The construct tree node associated with this construct.

Return type

ConstructNode

notification_configurations

Configures an Auto Scaling group to send notifications when specified events take place.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-notificationconfigurations

Return type

Union[IResolvable, List[Union[IResolvable, NotificationConfigurationProperty]], None]

placement_group

The name of the placement group into which to launch your instances.

For more information, see Placement groups in the Amazon EC2 User Guide for Linux Instances . .. epigraph:

A *cluster* placement group is a logical grouping of instances within a single Availability Zone. You cannot specify multiple Availability Zones and a cluster placement group.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-placementgroup

Return type

Optional[str]

ref

Return a string that will be resolved to a CloudFormation { Ref } for this element.

If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through Lazy.any({ produce: resource.ref }).

Return type

str

service_linked_role_arn

The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS service on your behalf.

By default, Amazon EC2 Auto Scaling uses a service-linked role named AWSServiceRoleForAutoScaling , which it creates if it does not exist. For more information, see Service-linked roles in the Amazon EC2 Auto Scaling User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-autoscaling-autoscalinggroup-servicelinkedrolearn

Return type

Optional[str]

stack

The stack in which this element is defined.

CfnElements must be defined within a stack scope (directly or indirectly).

Return type

Stack

tags

One or more tags.

You can tag your Auto Scaling group and propagate the tags to the Amazon EC2 instances it launches. Tags are not propagated to Amazon EBS volumes. To add tags to Amazon EBS volumes, specify the tags in a launch template but use caution. If the launch template specifies an instance tag with a key that is also specified for the Auto Scaling group, Amazon EC2 Auto Scaling overrides the value of that instance tag with the value specified by the Auto Scaling group. For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-tags

Return type

TagManager

target_group_arns

The Amazon Resource Names (ARN) of the target groups to associate with the Auto Scaling group.

Instances are registered as targets in a target group, and traffic is routed to the target group. For more information, see Elastic Load Balancing and Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-targetgrouparns

Return type

Optional[List[str]]

termination_policies

A policy or a list of policies that are used to select the instance to terminate.

These policies are executed in the order that you list them. For more information, see Work with Amazon EC2 Auto Scaling termination policies in the Amazon EC2 Auto Scaling User Guide .

Valid values: Default | AllocationStrategy | ClosestToNextInstanceHour | NewestInstance | OldestInstance | OldestLaunchConfiguration | OldestLaunchTemplate | arn:aws:lambda:region:account-id:function:my-function:my-alias

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-termpolicy

Return type

Optional[List[str]]

vpc_zone_identifier

A list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created.

If you specify VPCZoneIdentifier with AvailabilityZones , the subnets that you specify for this property must reside in those Availability Zones.

If this resource specifies public subnets and is also in a VPC that is defined in the same stack template, you must use the DependsOn attribute to declare a dependency on the VPC-gateway attachment .

Conditional: If your account supports EC2-Classic and VPC, this property is required to launch instances into a VPC. .. epigraph:

When you update ``VPCZoneIdentifier`` , this retains the same Auto Scaling group and replaces old instances with new ones, according to the specified subnets. You can optionally specify how CloudFormation handles these updates by using an `UpdatePolicy attribute <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html>`_ .
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#cfn-as-group-vpczoneidentifier

Return type

Optional[List[str]]

Static Methods

classmethod is_cfn_element(x)

Returns true if a construct is a stack element (i.e. part of the synthesized cloudformation template).

Uses duck-typing instead of instanceof to allow stack elements from different versions of this library to be included in the same stack.

Parameters

x (Any) –

Return type

bool

Returns

The construct as a stack element or undefined if it is not a stack element.

classmethod is_cfn_resource(construct)

Check whether the given construct is a CfnResource.

Parameters

construct (IConstruct) –

Return type

bool

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool

AcceleratorCountRequestProperty

class CfnAutoScalingGroup.AcceleratorCountRequestProperty(*, max=None, min=None)

Bases: object

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.

Parameters
  • max (Union[int, float, None]) – The maximum value.

  • min (Union[int, float, None]) – The minimum value.

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

accelerator_count_request_property = autoscaling.CfnAutoScalingGroup.AcceleratorCountRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum value.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-acceleratorcountrequest.html#cfn-autoscaling-autoscalinggroup-acceleratorcountrequest-max

Return type

Union[int, float, None]

min

The minimum value.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-acceleratorcountrequest.html#cfn-autoscaling-autoscalinggroup-acceleratorcountrequest-min

Return type

Union[int, float, None]

AcceleratorTotalMemoryMiBRequestProperty

class CfnAutoScalingGroup.AcceleratorTotalMemoryMiBRequestProperty(*, max=None, min=None)

Bases: object

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.

Parameters
  • max (Union[int, float, None]) – The memory maximum in MiB.

  • min (Union[int, float, None]) – The memory minimum in MiB.

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

accelerator_total_memory_mi_bRequest_property = autoscaling.CfnAutoScalingGroup.AcceleratorTotalMemoryMiBRequestProperty(
    max=123,
    min=123
)

Attributes

max

The memory maximum in MiB.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest.html#cfn-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-max

Return type

Union[int, float, None]

min

The memory minimum in MiB.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest.html#cfn-autoscaling-autoscalinggroup-acceleratortotalmemorymibrequest-min

Return type

Union[int, float, None]

BaselineEbsBandwidthMbpsRequestProperty

class CfnAutoScalingGroup.BaselineEbsBandwidthMbpsRequestProperty(*, max=None, min=None)

Bases: object

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.

Parameters
  • max (Union[int, float, None]) – The maximum value in Mbps.

  • min (Union[int, float, None]) – The minimum value in Mbps.

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

baseline_ebs_bandwidth_mbps_request_property = autoscaling.CfnAutoScalingGroup.BaselineEbsBandwidthMbpsRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum value in Mbps.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest.html#cfn-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-max

Return type

Union[int, float, None]

min

The minimum value in Mbps.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest.html#cfn-autoscaling-autoscalinggroup-baselineebsbandwidthmbpsrequest-min

Return type

Union[int, float, None]

InstanceRequirementsProperty

class CfnAutoScalingGroup.InstanceRequirementsProperty(*, accelerator_count=None, accelerator_manufacturers=None, accelerator_names=None, accelerator_total_memory_mib=None, accelerator_types=None, bare_metal=None, baseline_ebs_bandwidth_mbps=None, burstable_performance=None, cpu_manufacturers=None, excluded_instance_types=None, instance_generations=None, local_storage=None, local_storage_types=None, memory_gib_per_v_cpu=None, memory_mib=None, network_interface_count=None, on_demand_max_price_percentage_over_lowest_price=None, require_hibernate_support=None, spot_max_price_percentage_over_lowest_price=None, total_local_storage_gb=None, v_cpu_count=None)

Bases: object

InstanceRequirements specifies a set of requirements for the types of instances that can be launched by an AWS::AutoScaling::AutoScalingGroup resource.

InstanceRequirements is a property of the LaunchTemplateOverrides property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplate property type.

You must specify VCpuCount and MemoryMiB , but all other properties are optional. Any unspecified optional property is set to its default.

When you specify multiple properties, you get instance types that satisfy all of the specified properties. If you specify multiple values for a property, you get instance types that satisfy any of the specified values.

For an example template, see Auto scaling template snippets .

For more information, see Create an Auto Scaling group using attribute-based instance type selection in the Amazon EC2 Auto Scaling User Guide .

Parameters
  • accelerator_count (Union[IResolvable, AcceleratorCountRequestProperty, Dict[str, Any], None]) – The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) for an instance type. To exclude accelerator-enabled instance types, set Max to 0 . Default: No minimum or maximum

  • accelerator_manufacturers (Optional[Sequence[str]]) – Indicates whether instance types must have accelerators by specific manufacturers. - For instance types with NVIDIA devices, specify nvidia . - For instance types with AMD devices, specify amd . - For instance types with AWS devices, specify amazon-web-services . - For instance types with Xilinx devices, specify xilinx . Default: Any manufacturer

  • accelerator_names (Optional[Sequence[str]]) – Lists the accelerators that must be on an instance type. - For instance types with NVIDIA A100 GPUs, specify a100 . - For instance types with NVIDIA V100 GPUs, specify v100 . - For instance types with NVIDIA K80 GPUs, specify k80 . - For instance types with NVIDIA T4 GPUs, specify t4 . - For instance types with NVIDIA M60 GPUs, specify m60 . - For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520 . - For instance types with Xilinx VU9P FPGAs, specify vu9p . Default: Any accelerator

  • accelerator_total_memory_mib (Union[IResolvable, AcceleratorTotalMemoryMiBRequestProperty, Dict[str, Any], None]) – The minimum and maximum total memory size for the accelerators on an instance type, in MiB. Default: No minimum or maximum

  • accelerator_types (Optional[Sequence[str]]) – Lists the accelerator types that must be on an instance type. - For instance types with GPU accelerators, specify gpu . - For instance types with FPGA accelerators, specify fpga . - For instance types with inference accelerators, specify inference . Default: Any accelerator type

  • bare_metal (Optional[str]) – Indicates whether bare metal instance types are included, excluded, or required. Default: excluded

  • baseline_ebs_bandwidth_mbps (Union[IResolvable, BaselineEbsBandwidthMbpsRequestProperty, Dict[str, Any], None]) – The minimum and maximum baseline bandwidth performance for an instance type, in Mbps. For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide for Linux Instances . Default: No minimum or maximum

  • burstable_performance (Optional[str]) – Indicates whether burstable performance instance types are included, excluded, or required. For more information, see Burstable performance instances in the Amazon EC2 User Guide for Linux Instances . Default: excluded

  • cpu_manufacturers (Optional[Sequence[str]]) – Lists which specific CPU manufacturers to include. - For instance types with Intel CPUs, specify intel . - For instance types with AMD CPUs, specify amd . - For instance types with AWS CPUs, specify amazon-web-services . .. epigraph:: Don’t confuse the CPU hardware manufacturer with the CPU hardware architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template. Default: Any manufacturer

  • excluded_instance_types (Optional[Sequence[str]]) – Lists which instance types to exclude. You can use strings with one or more wild cards, represented by an asterisk ( * ). The following are examples: c5* , m5a.* , r* , *3* . For example, if you specify c5* , you are excluding the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , you are excluding all the M5a instance types, but not the M5n instance types. Default: No excluded instance types

  • instance_generations (Optional[Sequence[str]]) – Indicates whether current or previous generation instance types are included. - For current generation instance types, specify current . The current generation includes EC2 instance types currently recommended for use. This typically includes the latest two to three generations in each instance family. For more information, see Instance types in the Amazon EC2 User Guide for Linux Instances . - For previous generation instance types, specify previous . Default: Any current or previous generation

  • local_storage (Optional[str]) – Indicates whether instance types with instance store volumes are included, excluded, or required. For more information, see Amazon EC2 instance store in the Amazon EC2 User Guide for Linux Instances . Default: included

  • local_storage_types (Optional[Sequence[str]]) – Indicates the type of local storage that is required. - For instance types with hard disk drive (HDD) storage, specify hdd . - For instance types with solid state drive (SSD) storage, specify sdd . Default: Any local storage type

  • memory_gib_per_v_cpu (Union[IResolvable, MemoryGiBPerVCpuRequestProperty, Dict[str, Any], None]) – The minimum and maximum amount of memory per vCPU for an instance type, in GiB. Default: No minimum or maximum

  • memory_mib (Union[IResolvable, MemoryMiBRequestProperty, Dict[str, Any], None]) – The minimum and maximum instance memory size for an instance type, in MiB.

  • network_interface_count (Union[IResolvable, NetworkInterfaceCountRequestProperty, Dict[str, Any], None]) – The minimum and maximum number of network interfaces for an instance type. Default: No minimum or maximum

  • on_demand_max_price_percentage_over_lowest_price (Union[int, float, None]) – The price protection threshold for On-Demand Instances. This is the maximum you’ll pay for an On-Demand Instance, expressed as a percentage higher than the cheapest M, C, or R instance type with your specified attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price is higher than your threshold. The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as 999999 . If you set DesiredCapacityType to vcpu or memory-mib , the price protection threshold is applied based on the per vCPU or per memory price instead of the per instance price. Default: 20

  • require_hibernate_support (Union[bool, IResolvable, None]) – Indicates whether instance types must provide On-Demand Instance hibernation support. Default: false

  • spot_max_price_percentage_over_lowest_price (Union[int, float, None]) – The price protection threshold for Spot Instances. This is the maximum you’ll pay for a Spot Instance, expressed as a percentage higher than the cheapest M, C, or R instance type with your specified attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price is higher than your threshold. The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as 999999 . If you set DesiredCapacityType to vcpu or memory-mib , the price protection threshold is applied based on the per vCPU or per memory price instead of the per instance price. Default: 100

  • total_local_storage_gb (Union[IResolvable, TotalLocalStorageGBRequestProperty, Dict[str, Any], None]) – The minimum and maximum total local storage size for an instance type, in GB. Default: No minimum or maximum

  • v_cpu_count (Union[IResolvable, VCpuCountRequestProperty, Dict[str, Any], None]) – The minimum and maximum number of vCPUs for an instance type.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

instance_requirements_property = autoscaling.CfnAutoScalingGroup.InstanceRequirementsProperty(
    accelerator_count=autoscaling.CfnAutoScalingGroup.AcceleratorCountRequestProperty(
        max=123,
        min=123
    ),
    accelerator_manufacturers=["acceleratorManufacturers"],
    accelerator_names=["acceleratorNames"],
    accelerator_total_memory_mi_b=autoscaling.CfnAutoScalingGroup.AcceleratorTotalMemoryMiBRequestProperty(
        max=123,
        min=123
    ),
    accelerator_types=["acceleratorTypes"],
    bare_metal="bareMetal",
    baseline_ebs_bandwidth_mbps=autoscaling.CfnAutoScalingGroup.BaselineEbsBandwidthMbpsRequestProperty(
        max=123,
        min=123
    ),
    burstable_performance="burstablePerformance",
    cpu_manufacturers=["cpuManufacturers"],
    excluded_instance_types=["excludedInstanceTypes"],
    instance_generations=["instanceGenerations"],
    local_storage="localStorage",
    local_storage_types=["localStorageTypes"],
    memory_gi_bPer_vCpu=autoscaling.CfnAutoScalingGroup.MemoryGiBPerVCpuRequestProperty(
        max=123,
        min=123
    ),
    memory_mi_b=autoscaling.CfnAutoScalingGroup.MemoryMiBRequestProperty(
        max=123,
        min=123
    ),
    network_interface_count=autoscaling.CfnAutoScalingGroup.NetworkInterfaceCountRequestProperty(
        max=123,
        min=123
    ),
    on_demand_max_price_percentage_over_lowest_price=123,
    require_hibernate_support=False,
    spot_max_price_percentage_over_lowest_price=123,
    total_local_storage_gb=autoscaling.CfnAutoScalingGroup.TotalLocalStorageGBRequestProperty(
        max=123,
        min=123
    ),
    v_cpu_count=autoscaling.CfnAutoScalingGroup.VCpuCountRequestProperty(
        max=123,
        min=123
    )
)

Attributes

accelerator_count

The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) for an instance type.

To exclude accelerator-enabled instance types, set Max to 0 .

Default: No minimum or maximum

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratorcount

Return type

Union[IResolvable, AcceleratorCountRequestProperty, None]

accelerator_manufacturers

Indicates whether instance types must have accelerators by specific manufacturers.

  • For instance types with NVIDIA devices, specify nvidia .

  • For instance types with AMD devices, specify amd .

  • For instance types with AWS devices, specify amazon-web-services .

  • For instance types with Xilinx devices, specify xilinx .

Default: Any manufacturer

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratormanufacturers

Return type

Optional[List[str]]

accelerator_names

Lists the accelerators that must be on an instance type.

  • For instance types with NVIDIA A100 GPUs, specify a100 .

  • For instance types with NVIDIA V100 GPUs, specify v100 .

  • For instance types with NVIDIA K80 GPUs, specify k80 .

  • For instance types with NVIDIA T4 GPUs, specify t4 .

  • For instance types with NVIDIA M60 GPUs, specify m60 .

  • For instance types with AMD Radeon Pro V520 GPUs, specify radeon-pro-v520 .

  • For instance types with Xilinx VU9P FPGAs, specify vu9p .

Default: Any accelerator

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratornames

Return type

Optional[List[str]]

accelerator_total_memory_mib

The minimum and maximum total memory size for the accelerators on an instance type, in MiB.

Default: No minimum or maximum

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratortotalmemorymib

Return type

Union[IResolvable, AcceleratorTotalMemoryMiBRequestProperty, None]

accelerator_types

Lists the accelerator types that must be on an instance type.

  • For instance types with GPU accelerators, specify gpu .

  • For instance types with FPGA accelerators, specify fpga .

  • For instance types with inference accelerators, specify inference .

Default: Any accelerator type

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-acceleratortypes

Return type

Optional[List[str]]

bare_metal

Indicates whether bare metal instance types are included, excluded, or required.

Default: excluded

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-baremetal

Return type

Optional[str]

baseline_ebs_bandwidth_mbps

The minimum and maximum baseline bandwidth performance for an instance type, in Mbps.

For more information, see Amazon EBS–optimized instances in the Amazon EC2 User Guide for Linux Instances .

Default: No minimum or maximum

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-baselineebsbandwidthmbps

Return type

Union[IResolvable, BaselineEbsBandwidthMbpsRequestProperty, None]

burstable_performance

Indicates whether burstable performance instance types are included, excluded, or required.

For more information, see Burstable performance instances in the Amazon EC2 User Guide for Linux Instances .

Default: excluded

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-burstableperformance

Return type

Optional[str]

cpu_manufacturers

Lists which specific CPU manufacturers to include.

  • For instance types with Intel CPUs, specify intel .

  • For instance types with AMD CPUs, specify amd .

  • For instance types with AWS CPUs, specify amazon-web-services .

Don’t confuse the CPU hardware manufacturer with the CPU hardware architecture. Instances will be launched with a compatible CPU architecture based on the Amazon Machine Image (AMI) that you specify in your launch template.

Default: Any manufacturer

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-cpumanufacturers

Return type

Optional[List[str]]

excluded_instance_types

Lists which instance types to exclude.

You can use strings with one or more wild cards, represented by an asterisk ( * ). The following are examples: c5* , m5a.* , r* , *3* .

For example, if you specify c5* , you are excluding the entire C5 instance family, which includes all C5a and C5n instance types. If you specify m5a.* , you are excluding all the M5a instance types, but not the M5n instance types.

Default: No excluded instance types

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-excludedinstancetypes

Return type

Optional[List[str]]

instance_generations

Indicates whether current or previous generation instance types are included.

  • For current generation instance types, specify current . The current generation includes EC2 instance types currently recommended for use. This typically includes the latest two to three generations in each instance family. For more information, see Instance types in the Amazon EC2 User Guide for Linux Instances .

  • For previous generation instance types, specify previous .

Default: Any current or previous generation

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-instancegenerations

Return type

Optional[List[str]]

local_storage

Indicates whether instance types with instance store volumes are included, excluded, or required.

For more information, see Amazon EC2 instance store in the Amazon EC2 User Guide for Linux Instances .

Default: included

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-localstorage

Return type

Optional[str]

local_storage_types

Indicates the type of local storage that is required.

  • For instance types with hard disk drive (HDD) storage, specify hdd .

  • For instance types with solid state drive (SSD) storage, specify sdd .

Default: Any local storage type

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-localstoragetypes

Return type

Optional[List[str]]

memory_gib_per_v_cpu

The minimum and maximum amount of memory per vCPU for an instance type, in GiB.

Default: No minimum or maximum

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-memorygibpervcpu

Return type

Union[IResolvable, MemoryGiBPerVCpuRequestProperty, None]

memory_mib

The minimum and maximum instance memory size for an instance type, in MiB.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-memorymib

Return type

Union[IResolvable, MemoryMiBRequestProperty, None]

network_interface_count

The minimum and maximum number of network interfaces for an instance type.

Default: No minimum or maximum

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-networkinterfacecount

Return type

Union[IResolvable, NetworkInterfaceCountRequestProperty, None]

on_demand_max_price_percentage_over_lowest_price

The price protection threshold for On-Demand Instances.

This is the maximum you’ll pay for an On-Demand Instance, expressed as a percentage higher than the cheapest M, C, or R instance type with your specified attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price is higher than your threshold. The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as 999999 .

If you set DesiredCapacityType to vcpu or memory-mib , the price protection threshold is applied based on the per vCPU or per memory price instead of the per instance price.

Default: 20

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-ondemandmaxpricepercentageoverlowestprice

Return type

Union[int, float, None]

require_hibernate_support

Indicates whether instance types must provide On-Demand Instance hibernation support.

Default: false

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-requirehibernatesupport

Return type

Union[bool, IResolvable, None]

spot_max_price_percentage_over_lowest_price

The price protection threshold for Spot Instances.

This is the maximum you’ll pay for a Spot Instance, expressed as a percentage higher than the cheapest M, C, or R instance type with your specified attributes. When Amazon EC2 Auto Scaling selects instance types with your attributes, we will exclude instance types whose price is higher than your threshold. The parameter accepts an integer, which Amazon EC2 Auto Scaling interprets as a percentage. To turn off price protection, specify a high value, such as 999999 .

If you set DesiredCapacityType to vcpu or memory-mib , the price protection threshold is applied based on the per vCPU or per memory price instead of the per instance price.

Default: 100

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-spotmaxpricepercentageoverlowestprice

Return type

Union[int, float, None]

total_local_storage_gb

The minimum and maximum total local storage size for an instance type, in GB.

Default: No minimum or maximum

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-totallocalstoragegb

Return type

Union[IResolvable, TotalLocalStorageGBRequestProperty, None]

v_cpu_count

The minimum and maximum number of vCPUs for an instance type.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancerequirements.html#cfn-autoscaling-autoscalinggroup-instancerequirements-vcpucount

Return type

Union[IResolvable, VCpuCountRequestProperty, None]

InstancesDistributionProperty

class CfnAutoScalingGroup.InstancesDistributionProperty(*, on_demand_allocation_strategy=None, on_demand_base_capacity=None, on_demand_percentage_above_base_capacity=None, spot_allocation_strategy=None, spot_instance_pools=None, spot_max_price=None)

Bases: object

InstancesDistribution is a property of the AWS::AutoScaling::AutoScalingGroup MixedInstancesPolicy property type that describes an instances distribution for an Auto Scaling group. All properties have a default value, which is the value that is used or assumed when the property is not specified.

The instances distribution specifies the distribution of On-Demand Instances and Spot Instances, the maximum price to pay for Spot Instances, and how the Auto Scaling group allocates instance types to fulfill On-Demand and Spot capacities.

For more information and example configurations, see Auto Scaling groups with multiple instance types and purchase options in the Amazon EC2 Auto Scaling User Guide .

Parameters
  • on_demand_allocation_strategy (Optional[str]) – The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify lowest-price , Amazon EC2 Auto Scaling uses price to determine the order, launching the lowest price first. If you specify prioritized , Amazon EC2 Auto Scaling uses the priority that you assigned to each launch template override, launching the highest priority first. If all your On-Demand capacity cannot be fulfilled using your highest priority instance, then Amazon EC2 Auto Scaling launches the remaining capacity using the second priority instance type, and so on. Default: lowest-price for Auto Scaling groups that specify InstanceRequirements in the overrides and prioritized for Auto Scaling groups that don’t. Valid values: lowest-price | prioritized

  • on_demand_base_capacity (Union[int, float, None]) – The minimum amount of the Auto Scaling group’s capacity that must be fulfilled by On-Demand Instances. This base portion is launched first as your group scales. If you specify weights for the instance types in the overrides, the base capacity is measured in the same unit of measurement as the instance types. If you specify InstanceRequirements in the overrides, the base capacity is measured in the same unit of measurement as your group’s desired capacity. Default: 0 .. epigraph:: An update to this setting means a gradual replacement of instances to adjust the current On-Demand Instance levels. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the previous ones.

  • on_demand_percentage_above_base_capacity (Union[int, float, None]) – Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond OnDemandBaseCapacity . Expressed as a number (for example, 20 specifies 20% On-Demand Instances, 80% Spot Instances). If set to 100, only On-Demand Instances are used. Default: 100 .. epigraph:: An update to this setting means a gradual replacement of instances to adjust the current On-Demand and Spot Instance levels for your additional capacity higher than the base capacity. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the previous ones.

  • spot_allocation_strategy (Optional[str]) – Indicates how to allocate instances across Spot Instance pools. If the allocation strategy is lowest-price , the Auto Scaling group launches instances using the Spot pools with the lowest price, and evenly allocates your instances across the number of Spot pools that you specify. If the allocation strategy is capacity-optimized (recommended), the Auto Scaling group launches instances using Spot pools that are optimally chosen based on the available Spot capacity. Alternatively, you can use capacity-optimized-prioritized and set the order of instance types in the list of launch template overrides from highest to lowest priority (from first to last in the list). Amazon EC2 Auto Scaling honors the instance type priorities on a best-effort basis but optimizes for capacity first. Default: lowest-price Valid values: lowest-price | capacity-optimized | capacity-optimized-prioritized

  • spot_instance_pools (Union[int, float, None]) – The number of Spot Instance pools across which to allocate your Spot Instances. The Spot pools are determined from the different instance types in the overrides. Valid only when the Spot allocation strategy is lowest-price . Value must be in the range of 1–20. Default: 2

  • spot_max_price (Optional[str]) – The maximum price per unit hour that you are willing to pay for a Spot Instance. If you keep the value at its default (unspecified), Amazon EC2 Auto Scaling uses the On-Demand price as the maximum Spot price. To remove a value that you previously set, include the property but specify an empty string (“”) for the value. .. epigraph:: If your maximum price is lower than the Spot price for the instance types that you selected, your Spot Instances are not launched. Valid Range: Minimum value of 0.001

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-instancesdistribution.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

instances_distribution_property = autoscaling.CfnAutoScalingGroup.InstancesDistributionProperty(
    on_demand_allocation_strategy="onDemandAllocationStrategy",
    on_demand_base_capacity=123,
    on_demand_percentage_above_base_capacity=123,
    spot_allocation_strategy="spotAllocationStrategy",
    spot_instance_pools=123,
    spot_max_price="spotMaxPrice"
)

Attributes

on_demand_allocation_strategy

The order of the launch template overrides to use in fulfilling On-Demand capacity.

If you specify lowest-price , Amazon EC2 Auto Scaling uses price to determine the order, launching the lowest price first.

If you specify prioritized , Amazon EC2 Auto Scaling uses the priority that you assigned to each launch template override, launching the highest priority first. If all your On-Demand capacity cannot be fulfilled using your highest priority instance, then Amazon EC2 Auto Scaling launches the remaining capacity using the second priority instance type, and so on.

Default: lowest-price for Auto Scaling groups that specify InstanceRequirements in the overrides and prioritized for Auto Scaling groups that don’t.

Valid values: lowest-price | prioritized

Link

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

Return type

Optional[str]

on_demand_base_capacity

The minimum amount of the Auto Scaling group’s capacity that must be fulfilled by On-Demand Instances.

This base portion is launched first as your group scales.

If you specify weights for the instance types in the overrides, the base capacity is measured in the same unit of measurement as the instance types. If you specify InstanceRequirements in the overrides, the base capacity is measured in the same unit of measurement as your group’s desired capacity.

Default: 0 .. epigraph:

An update to this setting means a gradual replacement of instances to adjust the current On-Demand Instance levels. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the previous ones.
Link

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

Return type

Union[int, float, None]

on_demand_percentage_above_base_capacity

Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond OnDemandBaseCapacity .

Expressed as a number (for example, 20 specifies 20% On-Demand Instances, 80% Spot Instances). If set to 100, only On-Demand Instances are used.

Default: 100 .. epigraph:

An update to this setting means a gradual replacement of instances to adjust the current On-Demand and Spot Instance levels for your additional capacity higher than the base capacity. When replacing instances, Amazon EC2 Auto Scaling launches new instances before terminating the previous ones.
Link

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

Return type

Union[int, float, None]

spot_allocation_strategy

Indicates how to allocate instances across Spot Instance pools.

If the allocation strategy is lowest-price , the Auto Scaling group launches instances using the Spot pools with the lowest price, and evenly allocates your instances across the number of Spot pools that you specify.

If the allocation strategy is capacity-optimized (recommended), the Auto Scaling group launches instances using Spot pools that are optimally chosen based on the available Spot capacity. Alternatively, you can use capacity-optimized-prioritized and set the order of instance types in the list of launch template overrides from highest to lowest priority (from first to last in the list). Amazon EC2 Auto Scaling honors the instance type priorities on a best-effort basis but optimizes for capacity first.

Default: lowest-price

Valid values: lowest-price | capacity-optimized | capacity-optimized-prioritized

Link

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

Return type

Optional[str]

spot_instance_pools

The number of Spot Instance pools across which to allocate your Spot Instances.

The Spot pools are determined from the different instance types in the overrides. Valid only when the Spot allocation strategy is lowest-price . Value must be in the range of 1–20.

Default: 2

Link

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

Return type

Union[int, float, None]

spot_max_price

The maximum price per unit hour that you are willing to pay for a Spot Instance.

If you keep the value at its default (unspecified), Amazon EC2 Auto Scaling uses the On-Demand price as the maximum Spot price. To remove a value that you previously set, include the property but specify an empty string (“”) for the value. .. epigraph:

If your maximum price is lower than the Spot price for the instance types that you selected, your Spot Instances are not launched.

Valid Range: Minimum value of 0.001

Link

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

Return type

Optional[str]

LaunchTemplateOverridesProperty

class CfnAutoScalingGroup.LaunchTemplateOverridesProperty(*, instance_requirements=None, instance_type=None, launch_template_specification=None, weighted_capacity=None)

Bases: object

LaunchTemplateOverrides is a property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplate property type that describes an override for a launch template.

If you supply your own instance types, 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.

Parameters
  • instance_requirements (Union[IResolvable, InstanceRequirementsProperty, Dict[str, Any], None]) – The instance requirements. When you specify instance requirements, Amazon EC2 Auto Scaling finds instance types that satisfy your requirements, and then uses your On-Demand and Spot allocation strategies to launch instances from these instance types, in the same way as when you specify a list of specific instance types. .. epigraph:: InstanceRequirements are incompatible with the InstanceType and WeightedCapacity properties.

  • instance_type (Optional[str]) –

    The instance type, such as m3.xlarge . You must use an instance type that is supported in your requested Region and Availability Zones. For more information, see Instance types in the Amazon Elastic Compute Cloud User Guide .

  • launch_template_specification (Union[IResolvable, LaunchTemplateSpecificationProperty, Dict[str, Any], None]) – Provides a launch template for the specified instance type or instance requirements. For example, some instance types might require a launch template with a different AMI. If not provided, Amazon EC2 Auto Scaling uses the launch template that’s defined for your mixed instances policy. For more information, see Specifying a different launch template for an instance type in the Amazon EC2 Auto Scaling User Guide .

  • weighted_capacity (Optional[str]) – The number of capacity units provided by the instance type specified in InstanceType in terms of virtual CPUs, memory, storage, throughput, or other relative performance characteristic. When a Spot or On-Demand Instance is provisioned, the capacity units count toward the desired capacity. Amazon EC2 Auto Scaling provisions instances until the desired capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EC2 Auto Scaling can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the desired capacity is exceeded by 3 units. For more information, see Configure instance weighting for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide . Value must be in the range of 1-999. .. epigraph:: Every Auto Scaling group has three size parameters ( DesiredCapacity , MaxSize , and MinSize ). Usually, you set these sizes based on a specific number of instances. However, if you configure a mixed instances policy that defines weights for the instance types, you must specify these sizes with the same units that you use for weighting instances.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-launchtemplateoverrides.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

launch_template_overrides_property = autoscaling.CfnAutoScalingGroup.LaunchTemplateOverridesProperty(
    instance_requirements=autoscaling.CfnAutoScalingGroup.InstanceRequirementsProperty(
        accelerator_count=autoscaling.CfnAutoScalingGroup.AcceleratorCountRequestProperty(
            max=123,
            min=123
        ),
        accelerator_manufacturers=["acceleratorManufacturers"],
        accelerator_names=["acceleratorNames"],
        accelerator_total_memory_mi_b=autoscaling.CfnAutoScalingGroup.AcceleratorTotalMemoryMiBRequestProperty(
            max=123,
            min=123
        ),
        accelerator_types=["acceleratorTypes"],
        bare_metal="bareMetal",
        baseline_ebs_bandwidth_mbps=autoscaling.CfnAutoScalingGroup.BaselineEbsBandwidthMbpsRequestProperty(
            max=123,
            min=123
        ),
        burstable_performance="burstablePerformance",
        cpu_manufacturers=["cpuManufacturers"],
        excluded_instance_types=["excludedInstanceTypes"],
        instance_generations=["instanceGenerations"],
        local_storage="localStorage",
        local_storage_types=["localStorageTypes"],
        memory_gi_bPer_vCpu=autoscaling.CfnAutoScalingGroup.MemoryGiBPerVCpuRequestProperty(
            max=123,
            min=123
        ),
        memory_mi_b=autoscaling.CfnAutoScalingGroup.MemoryMiBRequestProperty(
            max=123,
            min=123
        ),
        network_interface_count=autoscaling.CfnAutoScalingGroup.NetworkInterfaceCountRequestProperty(
            max=123,
            min=123
        ),
        on_demand_max_price_percentage_over_lowest_price=123,
        require_hibernate_support=False,
        spot_max_price_percentage_over_lowest_price=123,
        total_local_storage_gb=autoscaling.CfnAutoScalingGroup.TotalLocalStorageGBRequestProperty(
            max=123,
            min=123
        ),
        v_cpu_count=autoscaling.CfnAutoScalingGroup.VCpuCountRequestProperty(
            max=123,
            min=123
        )
    ),
    instance_type="instanceType",
    launch_template_specification=autoscaling.CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(
        version="version",

        # the properties below are optional
        launch_template_id="launchTemplateId",
        launch_template_name="launchTemplateName"
    ),
    weighted_capacity="weightedCapacity"
)

Attributes

instance_requirements

The instance requirements.

When you specify instance requirements, Amazon EC2 Auto Scaling finds instance types that satisfy your requirements, and then uses your On-Demand and Spot allocation strategies to launch instances from these instance types, in the same way as when you specify a list of specific instance types. .. epigraph:

``InstanceRequirements`` are incompatible with the ``InstanceType`` and ``WeightedCapacity`` properties.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-launchtemplateoverrides.html#cfn-as-mixedinstancespolicy-instancerequirements

Return type

Union[IResolvable, InstanceRequirementsProperty, None]

instance_type

//docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html>`_ in the Amazon Elastic Compute Cloud User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-launchtemplateoverrides.html#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-instancetype

Type

The instance type, such as m3.xlarge . You must use an instance type that is supported in your requested Region and Availability Zones. For more information, see `Instance types <https

Return type

Optional[str]

launch_template_specification

Provides a launch template for the specified instance type or instance requirements.

For example, some instance types might require a launch template with a different AMI. If not provided, Amazon EC2 Auto Scaling uses the launch template that’s defined for your mixed instances policy. For more information, see Specifying a different launch template for an instance type in the Amazon EC2 Auto Scaling User Guide .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-launchtemplateoverrides.html#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-launchtemplatespecification

Return type

Union[IResolvable, LaunchTemplateSpecificationProperty, None]

weighted_capacity

The number of capacity units provided by the instance type specified in InstanceType in terms of virtual CPUs, memory, storage, throughput, or other relative performance characteristic.

When a Spot or On-Demand Instance is provisioned, the capacity units count toward the desired capacity. Amazon EC2 Auto Scaling provisions instances until the desired capacity is totally fulfilled, even if this results in an overage. For example, if there are 2 units remaining to fulfill capacity, and Amazon EC2 Auto Scaling can only provision an instance with a WeightedCapacity of 5 units, the instance is provisioned, and the desired capacity is exceeded by 3 units. For more information, see Configure instance weighting for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide . Value must be in the range of 1-999. .. epigraph:

Every Auto Scaling group has three size parameters ( ``DesiredCapacity`` , ``MaxSize`` , and ``MinSize`` ). Usually, you set these sizes based on a specific number of instances. However, if you configure a mixed instances policy that defines weights for the instance types, you must specify these sizes with the same units that you use for weighting instances.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-launchtemplateoverrides.html#cfn-autoscaling-autoscalinggroup-launchtemplateoverrides-weightedcapacity

Return type

Optional[str]

LaunchTemplateProperty

class CfnAutoScalingGroup.LaunchTemplateProperty(*, launch_template_specification, overrides=None)

Bases: object

LaunchTemplate is a property of the AWS::AutoScaling::AutoScalingGroup MixedInstancesPolicy property type that describes a launch template and overrides. The overrides are used to override the instance type specified by the launch template with multiple instance types that can be used to launch On-Demand Instances and Spot Instances.

Parameters
  • launch_template_specification (Union[IResolvable, LaunchTemplateSpecificationProperty, Dict[str, Any]]) – The launch template to use.

  • overrides (Union[IResolvable, Sequence[Union[IResolvable, LaunchTemplateOverridesProperty, Dict[str, Any]]], None]) – Any properties that you specify override the same properties in the launch template. If not provided, Amazon EC2 Auto Scaling uses the instance type or instance type requirements specified in the launch template when it launches an instance. The overrides can include either one or more instance types or a set of instance requirements, but not both.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-launchtemplate.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

launch_template_property = autoscaling.CfnAutoScalingGroup.LaunchTemplateProperty(
    launch_template_specification=autoscaling.CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(
        version="version",

        # the properties below are optional
        launch_template_id="launchTemplateId",
        launch_template_name="launchTemplateName"
    ),

    # the properties below are optional
    overrides=[autoscaling.CfnAutoScalingGroup.LaunchTemplateOverridesProperty(
        instance_requirements=autoscaling.CfnAutoScalingGroup.InstanceRequirementsProperty(
            accelerator_count=autoscaling.CfnAutoScalingGroup.AcceleratorCountRequestProperty(
                max=123,
                min=123
            ),
            accelerator_manufacturers=["acceleratorManufacturers"],
            accelerator_names=["acceleratorNames"],
            accelerator_total_memory_mi_b=autoscaling.CfnAutoScalingGroup.AcceleratorTotalMemoryMiBRequestProperty(
                max=123,
                min=123
            ),
            accelerator_types=["acceleratorTypes"],
            bare_metal="bareMetal",
            baseline_ebs_bandwidth_mbps=autoscaling.CfnAutoScalingGroup.BaselineEbsBandwidthMbpsRequestProperty(
                max=123,
                min=123
            ),
            burstable_performance="burstablePerformance",
            cpu_manufacturers=["cpuManufacturers"],
            excluded_instance_types=["excludedInstanceTypes"],
            instance_generations=["instanceGenerations"],
            local_storage="localStorage",
            local_storage_types=["localStorageTypes"],
            memory_gi_bPer_vCpu=autoscaling.CfnAutoScalingGroup.MemoryGiBPerVCpuRequestProperty(
                max=123,
                min=123
            ),
            memory_mi_b=autoscaling.CfnAutoScalingGroup.MemoryMiBRequestProperty(
                max=123,
                min=123
            ),
            network_interface_count=autoscaling.CfnAutoScalingGroup.NetworkInterfaceCountRequestProperty(
                max=123,
                min=123
            ),
            on_demand_max_price_percentage_over_lowest_price=123,
            require_hibernate_support=False,
            spot_max_price_percentage_over_lowest_price=123,
            total_local_storage_gb=autoscaling.CfnAutoScalingGroup.TotalLocalStorageGBRequestProperty(
                max=123,
                min=123
            ),
            v_cpu_count=autoscaling.CfnAutoScalingGroup.VCpuCountRequestProperty(
                max=123,
                min=123
            )
        ),
        instance_type="instanceType",
        launch_template_specification=autoscaling.CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(
            version="version",

            # the properties below are optional
            launch_template_id="launchTemplateId",
            launch_template_name="launchTemplateName"
        ),
        weighted_capacity="weightedCapacity"
    )]
)

Attributes

launch_template_specification

The launch template to use.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-launchtemplate.html#cfn-as-group-launchtemplate

Return type

Union[IResolvable, LaunchTemplateSpecificationProperty]

overrides

Any properties that you specify override the same properties in the launch template.

If not provided, Amazon EC2 Auto Scaling uses the instance type or instance type requirements specified in the launch template when it launches an instance.

The overrides can include either one or more instance types or a set of instance requirements, but not both.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-mixedinstancespolicy-launchtemplate.html#cfn-as-mixedinstancespolicy-overrides

Return type

Union[IResolvable, List[Union[IResolvable, LaunchTemplateOverridesProperty]], None]

LaunchTemplateSpecificationProperty

class CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(*, version, launch_template_id=None, launch_template_name=None)

Bases: object

LaunchTemplateSpecification specifies a launch template and version for the LaunchTemplate property of the AWS::AutoScaling::AutoScalingGroup resource. It is also a property of the AWS::AutoScaling::AutoScalingGroup LaunchTemplate and AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides property types.

The launch template that is specified must be configured for use with an Auto Scaling group. For information about creating a launch template, see Create a launch template for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide .

For examples of launch templates, see Auto scaling template snippets and the Examples section in the AWS::EC2::LaunchTemplate resource.

Parameters
  • version (str) –

    The version number. CloudFormation does not support specifying $Latest, or $Default for the template version number. However, you can specify LatestVersionNumber or DefaultVersionNumber using the Fn::GetAtt function. .. epigraph:: For an example of using the Fn::GetAtt function, see the Examples section of the AWS::AutoScaling::AutoScalingGroup reference.

  • launch_template_id (Optional[str]) – The ID of the AWS::EC2::LaunchTemplate . You must specify either a LaunchTemplateName or a LaunchTemplateId .

  • launch_template_name (Optional[str]) –

    The name of the AWS::EC2::LaunchTemplate . You must specify either a LaunchTemplateName or a LaunchTemplateId .

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

launch_template_specification_property = autoscaling.CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(
    version="version",

    # the properties below are optional
    launch_template_id="launchTemplateId",
    launch_template_name="launchTemplateName"
)

Attributes

launch_template_id

//docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html>`_ . You must specify either a LaunchTemplateName or a LaunchTemplateId .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification.html#cfn-autoscaling-autoscalinggroup-launchtemplatespecification-launchtemplateid

Type

The ID of the `AWS::EC2::LaunchTemplate <https

Return type

Optional[str]

launch_template_name

//docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html>`_ . You must specify either a LaunchTemplateName or a LaunchTemplateId .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification.html#cfn-autoscaling-autoscalinggroup-launchtemplatespecification-launchtemplatename

Type

The name of the `AWS::EC2::LaunchTemplate <https

Return type

Optional[str]

version

The version number.

CloudFormation does not support specifying $Latest, or $Default for the template version number. However, you can specify LatestVersionNumber or DefaultVersionNumber using the Fn::GetAtt function. .. epigraph:

For an example of using the ``Fn::GetAtt`` function, see the `Examples <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html#aws-properties-as-group--examples>`_ section of the ``AWS::AutoScaling::AutoScalingGroup`` reference.
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplatespecification.html#cfn-autoscaling-autoscalinggroup-launchtemplatespecification-version

Return type

str

LifecycleHookSpecificationProperty

class CfnAutoScalingGroup.LifecycleHookSpecificationProperty(*, lifecycle_hook_name, lifecycle_transition, default_result=None, heartbeat_timeout=None, notification_metadata=None, notification_target_arn=None, role_arn=None)

Bases: object

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.

For more information, see Amazon EC2 Auto Scaling lifecycle hooks in the Amazon EC2 Auto Scaling User Guide . You can find a sample template snippet in the Examples section of the AWS::AutoScaling::LifecycleHook resource.

Parameters
  • lifecycle_hook_name (str) – The name of the lifecycle hook.

  • lifecycle_transition (str) – The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions. - To create a lifecycle hook for scale-out events, specify autoscaling:EC2_INSTANCE_LAUNCHING . - To create a lifecycle hook for scale-in events, specify autoscaling:EC2_INSTANCE_TERMINATING .

  • default_result (Optional[str]) – The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is ABANDON . Valid values: CONTINUE | ABANDON

  • heartbeat_timeout (Union[int, float, None]) – The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from 30 to 7200 seconds. The default value is 3600 seconds (1 hour).

  • notification_metadata (Optional[str]) – Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.

  • notification_target_arn (Optional[str]) – The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS queue.

  • role_arn (Optional[str]) – The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For information about creating this role, see Configure a notification target for a lifecycle hook in the Amazon EC2 Auto Scaling User Guide . Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

lifecycle_hook_specification_property = autoscaling.CfnAutoScalingGroup.LifecycleHookSpecificationProperty(
    lifecycle_hook_name="lifecycleHookName",
    lifecycle_transition="lifecycleTransition",

    # the properties below are optional
    default_result="defaultResult",
    heartbeat_timeout=123,
    notification_metadata="notificationMetadata",
    notification_target_arn="notificationTargetArn",
    role_arn="roleArn"
)

Attributes

default_result

The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.

The default value is ABANDON .

Valid values: CONTINUE | ABANDON

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification.html#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-defaultresult

Return type

Optional[str]

heartbeat_timeout

The maximum time, in seconds, that can elapse before the lifecycle hook times out.

The range is from 30 to 7200 seconds. The default value is 3600 seconds (1 hour).

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification.html#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-heartbeattimeout

Return type

Union[int, float, None]

lifecycle_hook_name

The name of the lifecycle hook.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification.html#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-lifecyclehookname

Return type

str

lifecycle_transition

The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.

  • To create a lifecycle hook for scale-out events, specify autoscaling:EC2_INSTANCE_LAUNCHING .

  • To create a lifecycle hook for scale-in events, specify autoscaling:EC2_INSTANCE_TERMINATING .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification.html#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-lifecycletransition

Return type

str

notification_metadata

Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification.html#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-notificationmetadata

Return type

Optional[str]

notification_target_arn

The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook.

You can specify an Amazon SNS topic or an Amazon SQS queue.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification.html#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-notificationtargetarn

Return type

Optional[str]

role_arn

The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.

For information about creating this role, see Configure a notification target for a lifecycle hook in the Amazon EC2 Auto Scaling User Guide .

Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-lifecyclehookspecification.html#cfn-autoscaling-autoscalinggroup-lifecyclehookspecification-rolearn

Return type

Optional[str]

MemoryGiBPerVCpuRequestProperty

class CfnAutoScalingGroup.MemoryGiBPerVCpuRequestProperty(*, max=None, min=None)

Bases: object

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.

Parameters
  • max (Union[int, float, None]) – The memory maximum in GiB.

  • min (Union[int, float, None]) – The memory minimum in GiB.

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

memory_gi_bPer_vCpu_request_property = autoscaling.CfnAutoScalingGroup.MemoryGiBPerVCpuRequestProperty(
    max=123,
    min=123
)

Attributes

max

The memory maximum in GiB.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-memorygibpervcpurequest.html#cfn-autoscaling-autoscalinggroup-memorygibpervcpurequest-max

Return type

Union[int, float, None]

min

The memory minimum in GiB.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-memorygibpervcpurequest.html#cfn-autoscaling-autoscalinggroup-memorygibpervcpurequest-min

Return type

Union[int, float, None]

MemoryMiBRequestProperty

class CfnAutoScalingGroup.MemoryMiBRequestProperty(*, max=None, min=None)

Bases: object

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.

Parameters
  • max (Union[int, float, None]) – The memory maximum in MiB.

  • min (Union[int, float, None]) – The memory minimum in MiB.

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

memory_mi_bRequest_property = autoscaling.CfnAutoScalingGroup.MemoryMiBRequestProperty(
    max=123,
    min=123
)

Attributes

max

The memory maximum in MiB.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-memorymibrequest.html#cfn-autoscaling-autoscalinggroup-memorymibrequest-max

Return type

Union[int, float, None]

min

The memory minimum in MiB.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-memorymibrequest.html#cfn-autoscaling-autoscalinggroup-memorymibrequest-min

Return type

Union[int, float, None]

MetricsCollectionProperty

class CfnAutoScalingGroup.MetricsCollectionProperty(*, granularity, metrics=None)

Bases: object

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.

For more information, see Monitor CloudWatch metrics for your Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide . You can find a sample template snippet in the Examples section of the AWS::AutoScaling::AutoScalingGroup resource.

Parameters
  • granularity (str) – The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch. The only valid value is 1Minute .

  • metrics (Optional[Sequence[str]]) – Specifies which group-level metrics to start collecting. You can specify one or more of the following metrics:. - GroupMinSize - GroupMaxSize - GroupDesiredCapacity - GroupInServiceInstances - GroupPendingInstances - GroupStandbyInstances - GroupTerminatingInstances - GroupTotalInstances The instance weighting feature supports the following additional metrics: - GroupInServiceCapacity - GroupPendingCapacity - GroupStandbyCapacity - GroupTerminatingCapacity - GroupTotalCapacity The warm pools feature supports the following additional metrics: - WarmPoolDesiredCapacity - WarmPoolWarmedCapacity - WarmPoolPendingCapacity - WarmPoolTerminatingCapacity - WarmPoolTotalCapacity - GroupAndWarmPoolDesiredCapacity - GroupAndWarmPoolTotalCapacity If you specify Granularity and don’t specify any metrics, all metrics are enabled.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-metricscollection.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

metrics_collection_property = autoscaling.CfnAutoScalingGroup.MetricsCollectionProperty(
    granularity="granularity",

    # the properties below are optional
    metrics=["metrics"]
)

Attributes

granularity

The frequency at which Amazon EC2 Auto Scaling sends aggregated data to CloudWatch.

The only valid value is 1Minute .

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-metricscollection.html#cfn-as-metricscollection-granularity

Return type

str

metrics

.

  • GroupMinSize

  • GroupMaxSize

  • GroupDesiredCapacity

  • GroupInServiceInstances

  • GroupPendingInstances

  • GroupStandbyInstances

  • GroupTerminatingInstances

  • GroupTotalInstances

The instance weighting feature supports the following additional metrics:

  • GroupInServiceCapacity

  • GroupPendingCapacity

  • GroupStandbyCapacity

  • GroupTerminatingCapacity

  • GroupTotalCapacity

The warm pools feature supports the following additional metrics:

  • WarmPoolDesiredCapacity

  • WarmPoolWarmedCapacity

  • WarmPoolPendingCapacity

  • WarmPoolTerminatingCapacity

  • WarmPoolTotalCapacity

  • GroupAndWarmPoolDesiredCapacity

  • GroupAndWarmPoolTotalCapacity

If you specify Granularity and don’t specify any metrics, all metrics are enabled.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-metricscollection.html#cfn-as-metricscollection-metrics

Type

Specifies which group-level metrics to start collecting. You can specify one or more of the following metrics

Return type

Optional[List[str]]

MixedInstancesPolicyProperty

class CfnAutoScalingGroup.MixedInstancesPolicyProperty(*, launch_template, instances_distribution=None)

Bases: object

MixedInstancesPolicy is a property of the AWS::AutoScaling::AutoScalingGroup resource. It 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 .

You can create a mixed instances policy for a new Auto Scaling group, or you can create it for an existing group by updating the group to specify MixedInstancesPolicy as the top-level property instead of a launch template or launch configuration. If you specify a MixedInstancesPolicy , you must specify a launch template as a property of the policy. You cannot specify a launch configuration for the policy.

Parameters
Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-group-mixedinstancespolicy.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

mixed_instances_policy_property = autoscaling.CfnAutoScalingGroup.MixedInstancesPolicyProperty(
    launch_template=autoscaling.CfnAutoScalingGroup.LaunchTemplateProperty(
        launch_template_specification=autoscaling.CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(
            version="version",

            # the properties below are optional
            launch_template_id="launchTemplateId",
            launch_template_name="launchTemplateName"
        ),

        # the properties below are optional
        overrides=[autoscaling.CfnAutoScalingGroup.LaunchTemplateOverridesProperty(
            instance_requirements=autoscaling.CfnAutoScalingGroup.InstanceRequirementsProperty(
                accelerator_count=autoscaling.CfnAutoScalingGroup.AcceleratorCountRequestProperty(
                    max=123,
                    min=123
                ),
                accelerator_manufacturers=["acceleratorManufacturers"],
                accelerator_names=["acceleratorNames"],
                accelerator_total_memory_mi_b=autoscaling.CfnAutoScalingGroup.AcceleratorTotalMemoryMiBRequestProperty(
                    max=123,
                    min=123
                ),
                accelerator_types=["acceleratorTypes"],
                bare_metal="bareMetal",
                baseline_ebs_bandwidth_mbps=autoscaling.CfnAutoScalingGroup.BaselineEbsBandwidthMbpsRequestProperty(
                    max=123,
                    min=123
                ),
                burstable_performance="burstablePerformance",
                cpu_manufacturers=["cpuManufacturers"],
                excluded_instance_types=["excludedInstanceTypes"],
                instance_generations=["instanceGenerations"],
                local_storage="localStorage",
                local_storage_types=["localStorageTypes"],
                memory_gi_bPer_vCpu=autoscaling.CfnAutoScalingGroup.MemoryGiBPerVCpuRequestProperty(
                    max=123,
                    min=123
                ),
                memory_mi_b=autoscaling.CfnAutoScalingGroup.MemoryMiBRequestProperty(
                    max=123,
                    min=123
                ),
                network_interface_count=autoscaling.CfnAutoScalingGroup.NetworkInterfaceCountRequestProperty(
                    max=123,
                    min=123
                ),
                on_demand_max_price_percentage_over_lowest_price=123,
                require_hibernate_support=False,
                spot_max_price_percentage_over_lowest_price=123,
                total_local_storage_gb=autoscaling.CfnAutoScalingGroup.TotalLocalStorageGBRequestProperty(
                    max=123,
                    min=123
                ),
                v_cpu_count=autoscaling.CfnAutoScalingGroup.VCpuCountRequestProperty(
                    max=123,
                    min=123
                )
            ),
            instance_type="instanceType",
            launch_template_specification=autoscaling.CfnAutoScalingGroup.LaunchTemplateSpecificationProperty(
                version="version",

                # the properties below are optional
                launch_template_id="launchTemplateId",
                launch_template_name="launchTemplateName"
            ),
            weighted_capacity="weightedCapacity"
        )]
    ),

    # the properties below are optional
    instances_distribution=autoscaling.CfnAutoScalingGroup.InstancesDistributionProperty(
        on_demand_allocation_strategy="onDemandAllocationStrategy",
        on_demand_base_capacity=123,
        on_demand_percentage_above_base_capacity=123,
        spot_allocation_strategy="spotAllocationStrategy",
        spot_instance_pools=123,
        spot_max_price="spotMaxPrice"
    )
)

Attributes

instances_distribution

The instances distribution.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-group-mixedinstancespolicy.html#cfn-as-mixedinstancespolicy-instancesdistribution

Return type

Union[IResolvable, InstancesDistributionProperty, None]

launch_template

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

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-group-mixedinstancespolicy.html#cfn-as-mixedinstancespolicy-launchtemplate

Return type

Union[IResolvable, LaunchTemplateProperty]

NetworkInterfaceCountRequestProperty

class CfnAutoScalingGroup.NetworkInterfaceCountRequestProperty(*, max=None, min=None)

Bases: object

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.

Parameters
  • max (Union[int, float, None]) – The maximum number of network interfaces.

  • min (Union[int, float, None]) – The minimum number of network interfaces.

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

network_interface_count_request_property = autoscaling.CfnAutoScalingGroup.NetworkInterfaceCountRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum number of network interfaces.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-networkinterfacecountrequest.html#cfn-autoscaling-autoscalinggroup-networkinterfacecountrequest-max

Return type

Union[int, float, None]

min

The minimum number of network interfaces.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-networkinterfacecountrequest.html#cfn-autoscaling-autoscalinggroup-networkinterfacecountrequest-min

Return type

Union[int, float, None]

NotificationConfigurationProperty

class CfnAutoScalingGroup.NotificationConfigurationProperty(*, topic_arn, notification_types=None)

Bases: object

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

For an example template snippet, see Auto scaling template snippets .

For more information, see Get Amazon SNS notifications when your Auto Scaling group scales in the Amazon EC2 Auto Scaling User Guide .

Parameters
  • topic_arn (str) – The Amazon Resource Name (ARN) of the Amazon SNS topic.

  • notification_types (Optional[Sequence[str]]) – A list of event types that send a notification. Event types can include any of the following types. Allowed values : - autoscaling:EC2_INSTANCE_LAUNCH - autoscaling:EC2_INSTANCE_LAUNCH_ERROR - autoscaling:EC2_INSTANCE_TERMINATE - autoscaling:EC2_INSTANCE_TERMINATE_ERROR - autoscaling:TEST_NOTIFICATION

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-notificationconfigurations.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

notification_configuration_property = autoscaling.CfnAutoScalingGroup.NotificationConfigurationProperty(
    topic_arn="topicArn",

    # the properties below are optional
    notification_types=["notificationTypes"]
)

Attributes

notification_types

A list of event types that send a notification. Event types can include any of the following types.

Allowed values :

  • autoscaling:EC2_INSTANCE_LAUNCH

  • autoscaling:EC2_INSTANCE_LAUNCH_ERROR

  • autoscaling:EC2_INSTANCE_TERMINATE

  • autoscaling:EC2_INSTANCE_TERMINATE_ERROR

  • autoscaling:TEST_NOTIFICATION

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-notificationconfigurations.html#cfn-as-group-notificationconfigurations-notificationtypes

Return type

Optional[List[str]]

topic_arn

The Amazon Resource Name (ARN) of the Amazon SNS topic.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-notificationconfigurations.html#cfn-autoscaling-autoscalinggroup-notificationconfigurations-topicarn

Return type

str

TagPropertyProperty

class CfnAutoScalingGroup.TagPropertyProperty(*, key, propagate_at_launch, value)

Bases: object

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

For more information, see Tag Auto Scaling groups and instances in the Amazon EC2 Auto Scaling User Guide . You can find a sample template snippet in the Examples section of the AWS::AutoScaling::AutoScalingGroup resource.

CloudFormation adds the following tags to all Auto Scaling groups and associated instances:

  • aws:cloudformation:stack-name

  • aws:cloudformation:stack-id

  • aws:cloudformation:logical-id

Parameters
  • key (str) – The tag key.

  • propagate_at_launch (Union[bool, IResolvable]) – Set to true if you want CloudFormation to copy the tag to EC2 instances that are launched as part of the Auto Scaling group. Set to false if you want the tag attached only to the Auto Scaling group and not copied to any instances launched as part of the Auto Scaling group.

  • value (str) – The tag value.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-tags.html

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

tag_property_property = autoscaling.CfnAutoScalingGroup.TagPropertyProperty(
    key="key",
    propagate_at_launch=False,
    value="value"
)

Attributes

key

The tag key.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-tags.html#cfn-as-tags-Key

Return type

str

propagate_at_launch

Set to true if you want CloudFormation to copy the tag to EC2 instances that are launched as part of the Auto Scaling group.

Set to false if you want the tag attached only to the Auto Scaling group and not copied to any instances launched as part of the Auto Scaling group.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-tags.html#cfn-as-tags-PropagateAtLaunch

Return type

Union[bool, IResolvable]

value

The tag value.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-tags.html#cfn-as-tags-Value

Return type

str

TotalLocalStorageGBRequestProperty

class CfnAutoScalingGroup.TotalLocalStorageGBRequestProperty(*, max=None, min=None)

Bases: object

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.

Parameters
  • max (Union[int, float, None]) – The storage maximum in GB.

  • min (Union[int, float, None]) – The storage minimum in GB.

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

total_local_storage_gBRequest_property = autoscaling.CfnAutoScalingGroup.TotalLocalStorageGBRequestProperty(
    max=123,
    min=123
)

Attributes

max

The storage maximum in GB.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-totallocalstoragegbrequest.html#cfn-autoscaling-autoscalinggroup-totallocalstoragegbrequest-max

Return type

Union[int, float, None]

min

The storage minimum in GB.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-totallocalstoragegbrequest.html#cfn-autoscaling-autoscalinggroup-totallocalstoragegbrequest-min

Return type

Union[int, float, None]

VCpuCountRequestProperty

class CfnAutoScalingGroup.VCpuCountRequestProperty(*, max=None, min=None)

Bases: object

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.

Parameters
  • max (Union[int, float, None]) – The maximum number of vCPUs.

  • min (Union[int, float, None]) – The minimum number of vCPUs.

Link

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

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_autoscaling as autoscaling

v_cpu_count_request_property = autoscaling.CfnAutoScalingGroup.VCpuCountRequestProperty(
    max=123,
    min=123
)

Attributes

max

The maximum number of vCPUs.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-vcpucountrequest.html#cfn-autoscaling-autoscalinggroup-vcpucountrequest-max

Return type

Union[int, float, None]

min

The minimum number of vCPUs.

Link

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-vcpucountrequest.html#cfn-autoscaling-autoscalinggroup-vcpucountrequest-min

Return type

Union[int, float, None]