@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:36.729Z") @Stability(value=Stable) public class CfnAutoScalingGroup extends CfnResource implements IInspectable
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 .
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 on the AWS Compute Blog.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.autoscaling.*;
CfnAutoScalingGroup cfnAutoScalingGroup = CfnAutoScalingGroup.Builder.create(this, "MyCfnAutoScalingGroup")
.maxSize("maxSize")
.minSize("minSize")
// the properties below are optional
.autoScalingGroupName("autoScalingGroupName")
.availabilityZones(List.of("availabilityZones"))
.capacityRebalance(false)
.context("context")
.cooldown("cooldown")
.defaultInstanceWarmup(123)
.desiredCapacity("desiredCapacity")
.desiredCapacityType("desiredCapacityType")
.healthCheckGracePeriod(123)
.healthCheckType("healthCheckType")
.instanceId("instanceId")
.launchConfigurationName("launchConfigurationName")
.launchTemplate(LaunchTemplateSpecificationProperty.builder()
.version("version")
// the properties below are optional
.launchTemplateId("launchTemplateId")
.launchTemplateName("launchTemplateName")
.build())
.lifecycleHookSpecificationList(List.of(LifecycleHookSpecificationProperty.builder()
.lifecycleHookName("lifecycleHookName")
.lifecycleTransition("lifecycleTransition")
// the properties below are optional
.defaultResult("defaultResult")
.heartbeatTimeout(123)
.notificationMetadata("notificationMetadata")
.notificationTargetArn("notificationTargetArn")
.roleArn("roleArn")
.build()))
.loadBalancerNames(List.of("loadBalancerNames"))
.maxInstanceLifetime(123)
.metricsCollection(List.of(MetricsCollectionProperty.builder()
.granularity("granularity")
// the properties below are optional
.metrics(List.of("metrics"))
.build()))
.mixedInstancesPolicy(MixedInstancesPolicyProperty.builder()
.launchTemplate(LaunchTemplateProperty.builder()
.launchTemplateSpecification(LaunchTemplateSpecificationProperty.builder()
.version("version")
// the properties below are optional
.launchTemplateId("launchTemplateId")
.launchTemplateName("launchTemplateName")
.build())
// the properties below are optional
.overrides(List.of(LaunchTemplateOverridesProperty.builder()
.instanceRequirements(InstanceRequirementsProperty.builder()
.acceleratorCount(AcceleratorCountRequestProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorManufacturers(List.of("acceleratorManufacturers"))
.acceleratorNames(List.of("acceleratorNames"))
.acceleratorTotalMemoryMiB(AcceleratorTotalMemoryMiBRequestProperty.builder()
.max(123)
.min(123)
.build())
.acceleratorTypes(List.of("acceleratorTypes"))
.bareMetal("bareMetal")
.baselineEbsBandwidthMbps(BaselineEbsBandwidthMbpsRequestProperty.builder()
.max(123)
.min(123)
.build())
.burstablePerformance("burstablePerformance")
.cpuManufacturers(List.of("cpuManufacturers"))
.excludedInstanceTypes(List.of("excludedInstanceTypes"))
.instanceGenerations(List.of("instanceGenerations"))
.localStorage("localStorage")
.localStorageTypes(List.of("localStorageTypes"))
.memoryGiBPerVCpu(MemoryGiBPerVCpuRequestProperty.builder()
.max(123)
.min(123)
.build())
.memoryMiB(MemoryMiBRequestProperty.builder()
.max(123)
.min(123)
.build())
.networkInterfaceCount(NetworkInterfaceCountRequestProperty.builder()
.max(123)
.min(123)
.build())
.onDemandMaxPricePercentageOverLowestPrice(123)
.requireHibernateSupport(false)
.spotMaxPricePercentageOverLowestPrice(123)
.totalLocalStorageGb(TotalLocalStorageGBRequestProperty.builder()
.max(123)
.min(123)
.build())
.vCpuCount(VCpuCountRequestProperty.builder()
.max(123)
.min(123)
.build())
.build())
.instanceType("instanceType")
.launchTemplateSpecification(LaunchTemplateSpecificationProperty.builder()
.version("version")
// the properties below are optional
.launchTemplateId("launchTemplateId")
.launchTemplateName("launchTemplateName")
.build())
.weightedCapacity("weightedCapacity")
.build()))
.build())
// the properties below are optional
.instancesDistribution(InstancesDistributionProperty.builder()
.onDemandAllocationStrategy("onDemandAllocationStrategy")
.onDemandBaseCapacity(123)
.onDemandPercentageAboveBaseCapacity(123)
.spotAllocationStrategy("spotAllocationStrategy")
.spotInstancePools(123)
.spotMaxPrice("spotMaxPrice")
.build())
.build())
.newInstancesProtectedFromScaleIn(false)
.notificationConfigurations(List.of(NotificationConfigurationProperty.builder()
.topicArn("topicArn")
// the properties below are optional
.notificationTypes(List.of("notificationTypes"))
.build()))
.placementGroup("placementGroup")
.serviceLinkedRoleArn("serviceLinkedRoleArn")
.tags(List.of(TagPropertyProperty.builder()
.key("key")
.propagateAtLaunch(false)
.value("value")
.build()))
.targetGroupArns(List.of("targetGroupArns"))
.terminationPolicies(List.of("terminationPolicies"))
.vpcZoneIdentifier(List.of("vpcZoneIdentifier"))
.build();
| Modifier and Type | Class and Description |
|---|---|
static interface |
CfnAutoScalingGroup.AcceleratorCountRequestProperty
`AcceleratorCountRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum number of accelerators for an instance type.
|
static interface |
CfnAutoScalingGroup.AcceleratorTotalMemoryMiBRequestProperty
`AcceleratorTotalMemoryMiBRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum total memory size for the accelerators for an instance type, in MiB.
|
static interface |
CfnAutoScalingGroup.BaselineEbsBandwidthMbpsRequestProperty
`BaselineEbsBandwidthMbpsRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum baseline bandwidth performance for an instance type, in Mbps.
|
static class |
CfnAutoScalingGroup.Builder
A fluent builder for
CfnAutoScalingGroup. |
static interface |
CfnAutoScalingGroup.InstanceRequirementsProperty
`InstanceRequirements` specifies a set of requirements for the types of instances that can be launched by an `AWS::AutoScaling::AutoScalingGroup` resource.
|
static interface |
CfnAutoScalingGroup.InstancesDistributionProperty
`InstancesDistribution` is a property of the [AWS::AutoScaling::AutoScalingGroup MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html) property type that describes an instances distribution for an Auto Scaling group.
|
static interface |
CfnAutoScalingGroup.LaunchTemplateOverridesProperty
`LaunchTemplateOverrides` is a property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplate](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplate.html) property type that describes an override for a launch template.
|
static interface |
CfnAutoScalingGroup.LaunchTemplateProperty
`LaunchTemplate` is a property of the [AWS::AutoScaling::AutoScalingGroup MixedInstancesPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-mixedinstancespolicy.html) property type that describes a launch template and overrides.
|
static interface |
CfnAutoScalingGroup.LaunchTemplateSpecificationProperty
`LaunchTemplateSpecification` specifies a launch template and version for the `LaunchTemplate` property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html) resource.
|
static interface |
CfnAutoScalingGroup.LifecycleHookSpecificationProperty
`LifecycleHookSpecification` specifies a lifecycle hook for the `LifecycleHookSpecificationList` property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html) resource.
|
static interface |
CfnAutoScalingGroup.MemoryGiBPerVCpuRequestProperty
`MemoryGiBPerVCpuRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum amount of memory per vCPU for an instance type, in GiB.
|
static interface |
CfnAutoScalingGroup.MemoryMiBRequestProperty
`MemoryMiBRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum instance memory size for an instance type, in MiB.
|
static interface |
CfnAutoScalingGroup.MetricsCollectionProperty
`MetricsCollection` is a property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html) resource that describes the group metrics that an Amazon EC2 Auto Scaling group sends to Amazon CloudWatch.
|
static interface |
CfnAutoScalingGroup.MixedInstancesPolicyProperty
`MixedInstancesPolicy` is a property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html) resource.
|
static interface |
CfnAutoScalingGroup.NetworkInterfaceCountRequestProperty
`NetworkInterfaceCountRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum number of network interfaces for an instance type.
|
static interface |
CfnAutoScalingGroup.NotificationConfigurationProperty
A structure that specifies an Amazon SNS notification configuration for the `NotificationConfigurations` property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html) resource.
|
static interface |
CfnAutoScalingGroup.TagPropertyProperty
A structure that specifies a tag for the `Tags` property of [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-as-group.html) resource.
|
static interface |
CfnAutoScalingGroup.TotalLocalStorageGBRequestProperty
`TotalLocalStorageGBRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum total local storage size for an instance type, in GB.
|
static interface |
CfnAutoScalingGroup.VCpuCountRequestProperty
`VCpuCountRequest` is a property of the `InstanceRequirements` property of the [AWS::AutoScaling::AutoScalingGroup LaunchTemplateOverrides](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-autoscaling-autoscalinggroup-launchtemplateoverrides.html) property type that describes the minimum and maximum number of vCPUs for an instance type.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$Proxy| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnAutoScalingGroup(software.constructs.Construct scope,
String id,
CfnAutoScalingGroupProps props)
Create a new `AWS::AutoScaling::AutoScalingGroup`.
|
protected |
CfnAutoScalingGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnAutoScalingGroup(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAutoScalingGroupName()
The name of the Auto Scaling group.
|
List<String> |
getAvailabilityZones()
A list of Availability Zones where instances in the Auto Scaling group can be created.
|
Object |
getCapacityRebalance()
Indicates whether Capacity Rebalancing is enabled.
|
protected Map<String,Object> |
getCfnProperties() |
String |
getContext()
Reserved.
|
String |
getCooldown()
*Only needed if you use simple scaling policies.*.
|
Number |
getDefaultInstanceWarmup()
Not currently supported by CloudFormation.
|
String |
getDesiredCapacity()
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.
|
String |
getDesiredCapacityType()
The unit of measurement for the value specified for desired capacity.
|
Number |
getHealthCheckGracePeriod()
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.
|
String |
getHealthCheckType()
The service to use for the health checks.
|
String |
getInstanceId()
The ID of the instance used to base the launch configuration on.
|
String |
getLaunchConfigurationName()
The name of the launch configuration to use to launch instances.
|
Object |
getLaunchTemplate()
Information used to specify the launch template and version to use to launch instances.
|
Object |
getLifecycleHookSpecificationList()
One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.
|
List<String> |
getLoadBalancerNames()
A list of Classic Load Balancers associated with this Auto Scaling group.
|
Number |
getMaxInstanceLifetime()
The maximum amount of time, in seconds, that an instance can be in service.
|
String |
getMaxSize()
The maximum size of the group.
|
Object |
getMetricsCollection()
Enables the monitoring of group metrics of an Auto Scaling group.
|
String |
getMinSize()
The minimum size of the group.
|
Object |
getMixedInstancesPolicy()
An embedded object that specifies a mixed instances policy.
|
Object |
getNewInstancesProtectedFromScaleIn()
Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.
|
Object |
getNotificationConfigurations()
Configures an Auto Scaling group to send notifications when specified events take place.
|
String |
getPlacementGroup()
The name of the placement group into which to launch your instances.
|
String |
getServiceLinkedRoleArn()
The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS service on your behalf.
|
TagManager |
getTags()
One or more tags.
|
List<String> |
getTargetGroupArns()
The Amazon Resource Names (ARN) of the target groups to associate with the Auto Scaling group.
|
List<String> |
getTerminationPolicies()
A policy or a list of policies that are used to select the instance to terminate.
|
List<String> |
getVpcZoneIdentifier()
A list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setAutoScalingGroupName(String value)
The name of the Auto Scaling group.
|
void |
setAvailabilityZones(List<String> value)
A list of Availability Zones where instances in the Auto Scaling group can be created.
|
void |
setCapacityRebalance(Boolean value)
Indicates whether Capacity Rebalancing is enabled.
|
void |
setCapacityRebalance(IResolvable value)
Indicates whether Capacity Rebalancing is enabled.
|
void |
setContext(String value)
Reserved.
|
void |
setCooldown(String value)
*Only needed if you use simple scaling policies.*.
|
void |
setDefaultInstanceWarmup(Number value)
Not currently supported by CloudFormation.
|
void |
setDesiredCapacity(String value)
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.
|
void |
setDesiredCapacityType(String value)
The unit of measurement for the value specified for desired capacity.
|
void |
setHealthCheckGracePeriod(Number value)
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.
|
void |
setHealthCheckType(String value)
The service to use for the health checks.
|
void |
setInstanceId(String value)
The ID of the instance used to base the launch configuration on.
|
void |
setLaunchConfigurationName(String value)
The name of the launch configuration to use to launch instances.
|
void |
setLaunchTemplate(CfnAutoScalingGroup.LaunchTemplateSpecificationProperty value)
Information used to specify the launch template and version to use to launch instances.
|
void |
setLaunchTemplate(IResolvable value)
Information used to specify the launch template and version to use to launch instances.
|
void |
setLifecycleHookSpecificationList(IResolvable value)
One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.
|
void |
setLifecycleHookSpecificationList(List<Object> value)
One or more lifecycle hooks to add to the Auto Scaling group before instances are launched.
|
void |
setLoadBalancerNames(List<String> value)
A list of Classic Load Balancers associated with this Auto Scaling group.
|
void |
setMaxInstanceLifetime(Number value)
The maximum amount of time, in seconds, that an instance can be in service.
|
void |
setMaxSize(String value)
The maximum size of the group.
|
void |
setMetricsCollection(IResolvable value)
Enables the monitoring of group metrics of an Auto Scaling group.
|
void |
setMetricsCollection(List<Object> value)
Enables the monitoring of group metrics of an Auto Scaling group.
|
void |
setMinSize(String value)
The minimum size of the group.
|
void |
setMixedInstancesPolicy(CfnAutoScalingGroup.MixedInstancesPolicyProperty value)
An embedded object that specifies a mixed instances policy.
|
void |
setMixedInstancesPolicy(IResolvable value)
An embedded object that specifies a mixed instances policy.
|
void |
setNewInstancesProtectedFromScaleIn(Boolean value)
Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.
|
void |
setNewInstancesProtectedFromScaleIn(IResolvable value)
Indicates whether newly launched instances are protected from termination by Amazon EC2 Auto Scaling when scaling in.
|
void |
setNotificationConfigurations(IResolvable value)
Configures an Auto Scaling group to send notifications when specified events take place.
|
void |
setNotificationConfigurations(List<Object> value)
Configures an Auto Scaling group to send notifications when specified events take place.
|
void |
setPlacementGroup(String value)
The name of the placement group into which to launch your instances.
|
void |
setServiceLinkedRoleArn(String value)
The Amazon Resource Name (ARN) of the service-linked role that the Auto Scaling group uses to call other AWS service on your behalf.
|
void |
setTargetGroupArns(List<String> value)
The Amazon Resource Names (ARN) of the target groups to associate with the Auto Scaling group.
|
void |
setTerminationPolicies(List<String> value)
A policy or a list of policies that are used to select the instance to terminate.
|
void |
setVpcZoneIdentifier(List<String> value)
A list of subnet IDs for a virtual private cloud (VPC) where instances in the Auto Scaling group can be created.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdjsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnAutoScalingGroup(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnAutoScalingGroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnAutoScalingGroup(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
CfnAutoScalingGroupProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public TagManager getTags()
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 .
@Stability(value=Stable) @NotNull public String getMaxSize()
With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above
MaxSizeto meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go aboveMaxSizeby more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group).
@Stability(value=Stable)
public void setMaxSize(@NotNull
String value)
With a mixed instances policy that uses instance weighting, Amazon EC2 Auto Scaling may need to go above
MaxSizeto meet your capacity requirements. In this event, Amazon EC2 Auto Scaling will never go aboveMaxSizeby more than your largest instance weight (weights that define how many units each instance contributes to the desired capacity of the group).
@Stability(value=Stable) @NotNull public String getMinSize()
@Stability(value=Stable)
public void setMinSize(@NotNull
String value)
@Stability(value=Stable) @Nullable public String getAutoScalingGroupName()
This name must be unique per Region per account.
@Stability(value=Stable)
public void setAutoScalingGroupName(@Nullable
String value)
This name must be unique per Region per account.
@Stability(value=Stable) @Nullable public List<String> getAvailabilityZones()
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.
@Stability(value=Stable)
public void setAvailabilityZones(@Nullable
List<String> value)
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.
@Stability(value=Stable) @Nullable public Object getCapacityRebalance()
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 .
@Stability(value=Stable)
public void setCapacityRebalance(@Nullable
Boolean value)
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 .
@Stability(value=Stable)
public void setCapacityRebalance(@Nullable
IResolvable value)
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 .
@Stability(value=Stable) @Nullable public String getContext()
@Stability(value=Stable)
public void setContext(@Nullable
String value)
@Stability(value=Stable) @Nullable public String getCooldown()
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
@Stability(value=Stable)
public void setCooldown(@Nullable
String value)
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
@Stability(value=Stable) @Nullable public Number getDefaultInstanceWarmup()
@Stability(value=Stable)
public void setDefaultInstanceWarmup(@Nullable
Number value)
@Stability(value=Stable) @Nullable public String getDesiredCapacity()
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.
@Stability(value=Stable)
public void setDesiredCapacity(@Nullable
String value)
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.
@Stability(value=Stable) @Nullable public String getDesiredCapacityType()
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
@Stability(value=Stable)
public void setDesiredCapacityType(@Nullable
String value)
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
@Stability(value=Stable) @Nullable public Number getHealthCheckGracePeriod()
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
@Stability(value=Stable)
public void setHealthCheckGracePeriod(@Nullable
Number value)
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
@Stability(value=Stable) @Nullable public String getHealthCheckType()
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 .
@Stability(value=Stable)
public void setHealthCheckType(@Nullable
String value)
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 .
@Stability(value=Stable) @Nullable public String getInstanceId()
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 .
@Stability(value=Stable)
public void setInstanceId(@Nullable
String value)
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 .
@Stability(value=Stable) @Nullable public String getLaunchConfigurationName()
Required only if you don't specify LaunchTemplate , MixedInstancesPolicy , or InstanceId .
@Stability(value=Stable)
public void setLaunchConfigurationName(@Nullable
String value)
Required only if you don't specify LaunchTemplate , MixedInstancesPolicy , or InstanceId .
@Stability(value=Stable) @Nullable public Object getLaunchTemplate()
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 .
@Stability(value=Stable)
public void setLaunchTemplate(@Nullable
CfnAutoScalingGroup.LaunchTemplateSpecificationProperty value)
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 .
@Stability(value=Stable)
public void setLaunchTemplate(@Nullable
IResolvable value)
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 .
@Stability(value=Stable) @Nullable public Object getLifecycleHookSpecificationList()
@Stability(value=Stable)
public void setLifecycleHookSpecificationList(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setLifecycleHookSpecificationList(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public List<String> getLoadBalancerNames()
For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs property instead.
@Stability(value=Stable)
public void setLoadBalancerNames(@Nullable
List<String> value)
For Application Load Balancers, Network Load Balancers, and Gateway Load Balancers, specify the TargetGroupARNs property instead.
@Stability(value=Stable) @Nullable public Number getMaxInstanceLifetime()
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 .
@Stability(value=Stable)
public void setMaxInstanceLifetime(@Nullable
Number value)
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 .
@Stability(value=Stable) @Nullable public Object getMetricsCollection()
By default, these metrics are disabled.
@Stability(value=Stable)
public void setMetricsCollection(@Nullable
IResolvable value)
By default, these metrics are disabled.
@Stability(value=Stable)
public void setMetricsCollection(@Nullable
List<Object> value)
By default, these metrics are disabled.
@Stability(value=Stable) @Nullable public Object getMixedInstancesPolicy()
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 .
@Stability(value=Stable)
public void setMixedInstancesPolicy(@Nullable
CfnAutoScalingGroup.MixedInstancesPolicyProperty value)
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 .
@Stability(value=Stable)
public void setMixedInstancesPolicy(@Nullable
IResolvable value)
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 .
@Stability(value=Stable) @Nullable public Object getNewInstancesProtectedFromScaleIn()
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 .
@Stability(value=Stable)
public void setNewInstancesProtectedFromScaleIn(@Nullable
Boolean value)
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 .
@Stability(value=Stable)
public void setNewInstancesProtectedFromScaleIn(@Nullable
IResolvable value)
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 .
@Stability(value=Stable) @Nullable public Object getNotificationConfigurations()
@Stability(value=Stable)
public void setNotificationConfigurations(@Nullable
IResolvable value)
@Stability(value=Stable)
public void setNotificationConfigurations(@Nullable
List<Object> value)
@Stability(value=Stable) @Nullable public String getPlacementGroup()
For more information, see Placement groups in the Amazon EC2 User Guide for Linux Instances .
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.
@Stability(value=Stable)
public void setPlacementGroup(@Nullable
String value)
For more information, see Placement groups in the Amazon EC2 User Guide for Linux Instances .
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.
@Stability(value=Stable) @Nullable public String getServiceLinkedRoleArn()
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 .
@Stability(value=Stable)
public void setServiceLinkedRoleArn(@Nullable
String value)
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 .
@Stability(value=Stable) @Nullable public List<String> getTargetGroupArns()
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 .
@Stability(value=Stable)
public void setTargetGroupArns(@Nullable
List<String> value)
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 .
@Stability(value=Stable) @Nullable public List<String> getTerminationPolicies()
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
@Stability(value=Stable)
public void setTerminationPolicies(@Nullable
List<String> value)
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
@Stability(value=Stable) @Nullable public List<String> getVpcZoneIdentifier()
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.
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 .
@Stability(value=Stable)
public void setVpcZoneIdentifier(@Nullable
List<String> value)
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.
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 .
Copyright © 2022. All rights reserved.