AutoScalingGroupProps

class aws_cdk.aws_autoscaling.AutoScalingGroupProps(*, allow_all_outbound=None, associate_public_ip_address=None, cooldown=None, desired_capacity=None, health_check=None, ignore_unmodified_size_properties=None, key_name=None, max_capacity=None, min_capacity=None, notifications_topic=None, replacing_update_min_successful_instances_percent=None, resource_signal_count=None, resource_signal_timeout=None, rolling_update_configuration=None, spot_price=None, update_type=None, vpc_subnets=None, instance_type, machine_image, vpc, block_devices=None, role=None, user_data=None)

Bases: aws_cdk.aws_autoscaling.CommonAutoScalingGroupProps

__init__(*, allow_all_outbound=None, associate_public_ip_address=None, cooldown=None, desired_capacity=None, health_check=None, ignore_unmodified_size_properties=None, key_name=None, max_capacity=None, min_capacity=None, notifications_topic=None, replacing_update_min_successful_instances_percent=None, resource_signal_count=None, resource_signal_timeout=None, rolling_update_configuration=None, spot_price=None, update_type=None, vpc_subnets=None, instance_type, machine_image, vpc, block_devices=None, role=None, user_data=None)

Properties of a Fleet.

Parameters
  • allow_all_outbound (Optional[bool]) – Whether the instances can initiate connections to anywhere by default. Default: true

  • associate_public_ip_address (Optional[bool]) – Whether instances in the Auto Scaling Group should have public IP addresses associated with them. Default: - Use subnet setting.

  • cooldown (Optional[Duration]) – Default scaling cooldown for this AutoScalingGroup. Default: Duration.minutes(5)

  • desired_capacity (Union[int, float, None]) – Initial amount of instances in the fleet. Default: 1

  • health_check (Optional[HealthCheck]) – Configuration for health checks. Default: - HealthCheck.ec2 with no grace period

  • ignore_unmodified_size_properties (Optional[bool]) – If the ASG has scheduled actions, don’t reset unchanged group sizes. Only used if the ASG has scheduled actions (which may scale your ASG up or down regardless of cdk deployments). If true, the size of the group will only be reset if it has been changed in the CDK app. If false, the sizes will always be changed back to what they were in the CDK app on deployment. Default: true

  • key_name (Optional[str]) – Name of SSH keypair to grant access to instances. Default: - No SSH access will be possible.

  • max_capacity (Union[int, float, None]) – Maximum number of instances in the fleet. Default: desiredCapacity

  • min_capacity (Union[int, float, None]) – Minimum number of instances in the fleet. Default: 1

  • notifications_topic (Optional[ITopic]) – SNS topic to send notifications about fleet changes. Default: - No fleet change notifications will be sent.

  • replacing_update_min_successful_instances_percent (Union[int, float, None]) – Configuration for replacing updates. Only used if updateType == UpdateType.ReplacingUpdate. Specifies how many instances must signal success for the update to succeed. Default: minSuccessfulInstancesPercent

  • resource_signal_count (Union[int, float, None]) – How many ResourceSignal calls CloudFormation expects before the resource is considered created. Default: 1

  • resource_signal_timeout (Optional[Duration]) – The length of time to wait for the resourceSignalCount. The maximum value is 43200 (12 hours). Default: Duration.minutes(5)

  • rolling_update_configuration (Optional[RollingUpdateConfiguration]) – Configuration for rolling updates. Only used if updateType == UpdateType.RollingUpdate. Default: - RollingUpdateConfiguration with defaults.

  • spot_price (Optional[str]) – The maximum hourly price (in USD) to be paid for any Spot Instance launched to fulfill the request. Spot Instances are launched when the price you specify exceeds the current Spot market price. Default: none

  • update_type (Optional[UpdateType]) – What to do when an AutoScalingGroup’s instance configuration is changed. This is applied when any of the settings on the ASG are changed that affect how the instances should be created (VPC, instance type, startup scripts, etc.). It indicates how the existing instances should be replaced with new instances matching the new config. By default, nothing is done and only new instances are launched with the new config. Default: UpdateType.None

  • vpc_subnets (Optional[SubnetSelection]) – Where to place instances within the VPC. Default: - All Private subnets.

  • instance_type (InstanceType) – Type of instance to launch.

  • machine_image (IMachineImage) – AMI to launch.

  • vpc (IVpc) – VPC to launch these instances in.

  • block_devices (Optional[List[BlockDevice]]) – Specifies how block devices are exposed to the instance. You can specify virtual devices and EBS volumes. Each instance that is launched has an associated root device volume, either an Amazon EBS volume or an instance store volume. You can use block device mappings to specify additional EBS volumes or instance store volumes to attach to an instance when it is launched. Default: - Uses the block device mapping of the AMI

  • role (Optional[IRole]) – An IAM role to associate with the instance profile assigned to this Auto Scaling Group. The role must be assumable by the service principal ec2.amazonaws.com: Default: A role will automatically be created, it can be accessed via the role property

  • user_data (Optional[UserData]) – Specific UserData to use. The UserData may still be mutated after creation. Default: - A UserData object appropriate for the MachineImage’s Operating System is created.

Attributes

allow_all_outbound

Whether the instances can initiate connections to anywhere by default.

default :default: true

Return type

Optional[bool]

associate_public_ip_address

Whether instances in the Auto Scaling Group should have public IP addresses associated with them.

default :default: - Use subnet setting.

Return type

Optional[bool]

block_devices

Specifies how block devices are exposed to the instance. You can specify virtual devices and EBS volumes.

Each instance that is launched has an associated root device volume, either an Amazon EBS volume or an instance store volume. You can use block device mappings to specify additional EBS volumes or instance store volumes to attach to an instance when it is launched.

default :default: - Uses the block device mapping of the AMI

see :see: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html

Return type

Optional[List[BlockDevice]]

cooldown

Default scaling cooldown for this AutoScalingGroup.

default :default: Duration.minutes(5)

Return type

Optional[Duration]

desired_capacity

Initial amount of instances in the fleet.

default :default: 1

Return type

Union[int, float, None]

health_check

Configuration for health checks.

default :default: - HealthCheck.ec2 with no grace period

Return type

Optional[HealthCheck]

ignore_unmodified_size_properties

If the ASG has scheduled actions, don’t reset unchanged group sizes.

Only used if the ASG has scheduled actions (which may scale your ASG up or down regardless of cdk deployments). If true, the size of the group will only be reset if it has been changed in the CDK app. If false, the sizes will always be changed back to what they were in the CDK app on deployment.

default :default: true

Return type

Optional[bool]

instance_type

Type of instance to launch.

Return type

InstanceType

key_name

Name of SSH keypair to grant access to instances.

default :default: - No SSH access will be possible.

Return type

Optional[str]

machine_image

AMI to launch.

Return type

IMachineImage

max_capacity

Maximum number of instances in the fleet.

default :default: desiredCapacity

Return type

Union[int, float, None]

min_capacity

Minimum number of instances in the fleet.

default :default: 1

Return type

Union[int, float, None]

notifications_topic

SNS topic to send notifications about fleet changes.

default :default: - No fleet change notifications will be sent.

Return type

Optional[ITopic]

replacing_update_min_successful_instances_percent

Configuration for replacing updates.

Only used if updateType == UpdateType.ReplacingUpdate. Specifies how many instances must signal success for the update to succeed.

default :default: minSuccessfulInstancesPercent

Return type

Union[int, float, None]

resource_signal_count

How many ResourceSignal calls CloudFormation expects before the resource is considered created.

default :default: 1

Return type

Union[int, float, None]

resource_signal_timeout

The length of time to wait for the resourceSignalCount.

The maximum value is 43200 (12 hours).

default :default: Duration.minutes(5)

Return type

Optional[Duration]

role

An IAM role to associate with the instance profile assigned to this Auto Scaling Group.

The role must be assumable by the service principal ec2.amazonaws.com:

default :default: A role will automatically be created, it can be accessed via the role property

Example::

# Example automatically generated. See https://github.com/aws/jsii/issues/826 role = iam.Role(self, “MyRole”,

assumed_by=iam.ServicePrincipal(“ec2.amazonaws.com”)

)

Return type

Optional[IRole]

rolling_update_configuration

Configuration for rolling updates.

Only used if updateType == UpdateType.RollingUpdate.

default :default: - RollingUpdateConfiguration with defaults.

Return type

Optional[RollingUpdateConfiguration]

spot_price

The maximum hourly price (in USD) to be paid for any Spot Instance launched to fulfill the request.

Spot Instances are launched when the price you specify exceeds the current Spot market price.

default :default: none

Return type

Optional[str]

update_type

What to do when an AutoScalingGroup’s instance configuration is changed.

This is applied when any of the settings on the ASG are changed that affect how the instances should be created (VPC, instance type, startup scripts, etc.). It indicates how the existing instances should be replaced with new instances matching the new config. By default, nothing is done and only new instances are launched with the new config.

default :default: UpdateType.None

Return type

Optional[UpdateType]

user_data

Specific UserData to use.

The UserData may still be mutated after creation.

default :default:

  • A UserData object appropriate for the MachineImage’s Operating System is created.

Return type

Optional[UserData]

vpc

VPC to launch these instances in.

Return type

IVpc

vpc_subnets

Where to place instances within the VPC.

default :default: - All Private subnets.

Return type

Optional[SubnetSelection]