Interface AutoScalingGroupProps
- All Superinterfaces:
CommonAutoScalingGroupProps,software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AutoScalingGroupProps.Jsii$Proxy
Example:
Vpc vpc;
SecurityGroup mySecurityGroup = SecurityGroup.Builder.create(this, "SecurityGroup").vpc(vpc).build();
AutoScalingGroup.Builder.create(this, "ASG")
.vpc(vpc)
.instanceType(InstanceType.of(InstanceClass.BURSTABLE2, InstanceSize.MICRO))
.machineImage(MachineImage.latestAmazonLinux2())
.securityGroup(mySecurityGroup)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forAutoScalingGroupPropsstatic final classAn implementation forAutoScalingGroupProps -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default CloudFormationInitgetInit()Apply the given CloudFormation Init configuration to the instances in the AutoScalingGroup at startup.default ApplyCloudFormationInitOptionsUse the given options for applying CloudFormation Init.default InstanceTypeType of instance to launch.default ILaunchTemplateLaunch template to use.default IMachineImageAMI to launch.default NumberSpecifies the upper threshold as a percentage of the desired capacity of the Auto Scaling group.default BooleanWhether safety guardrail should be enforced when migrating to the launch template.default NumberSpecifies the lower threshold as a percentage of the desired capacity of the Auto Scaling group.default MixedInstancesPolicyMixed Instances Policy to use.default BooleanWhether IMDSv2 should be required on launched instances.default IRolegetRole()An IAM role to associate with the instance profile assigned to this Auto Scaling Group.default ISecurityGroupSecurity group to launch the instances in.default UserDataSpecific UserData to use.getVpc()VPC to launch these instances in.Methods inherited from interface software.amazon.awscdk.services.autoscaling.CommonAutoScalingGroupProps
getAllowAllOutbound, getAssociatePublicIpAddress, getAutoScalingGroupName, getAzCapacityDistributionStrategy, getBlockDevices, getCapacityRebalance, getCooldown, getDefaultInstanceWarmup, getDesiredCapacity, getGroupMetrics, getHealthCheck, getHealthChecks, getIgnoreUnmodifiedSizeProperties, getInstanceMonitoring, getKeyName, getKeyPair, getMaxCapacity, getMaxInstanceLifetime, getMinCapacity, getNewInstancesProtectedFromScaleIn, getNotifications, getSignals, getSpotPrice, getSsmSessionPermissions, getTerminationPolicies, getTerminationPolicyCustomLambdaFunctionArn, getUpdatePolicy, getVpcSubnetsMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getVpc
VPC to launch these instances in. -
getInit
Apply the given CloudFormation Init configuration to the instances in the AutoScalingGroup at startup.If you specify
init, you must also specifysignalsto configure the number of instances to wait for and the timeout for waiting for the init process.Default: - no CloudFormation init
-
getInitOptions
Use the given options for applying CloudFormation Init.Describes the configsets to use and the timeout to wait
Default: - default options
-
getInstanceType
Type of instance to launch.launchTemplateandmixedInstancesPolicymust not be specified when this property is specifiedDefault: - Do not provide any instance type
-
getLaunchTemplate
Launch template to use.Launch configuration related settings and MixedInstancesPolicy must not be specified when a launch template is specified.
Default: - Do not provide any launch template
-
getMachineImage
AMI to launch.launchTemplateandmixedInstancesPolicymust not be specified when this property is specifiedDefault: - Do not provide any machine image
-
getMaxHealthyPercentage
Specifies the upper threshold as a percentage of the desired capacity of the Auto Scaling group.It represents the maximum percentage of the group that can be in service and healthy, or pending, to support your workload when replacing instances.
Value range is 0 to 100. After it's set, both
minHealthyPercentageandmaxHealthyPercentageto -1 will clear the previously set value.Both or neither of
minHealthyPercentageandmaxHealthyPercentagemust be specified, and the difference between them cannot be greater than 100. A large range increases the number of instances that can be replaced at the same time.Default: - No instance maintenance policy.
- See Also:
-
getMigrateToLaunchTemplate
Whether safety guardrail should be enforced when migrating to the launch template.Default: false
-
getMinHealthyPercentage
Specifies the lower threshold as a percentage of the desired capacity of the Auto Scaling group.It represents the minimum percentage of the group to keep in service, healthy, and ready to use to support your workload when replacing instances.
Value range is 0 to 100. After it's set, both
minHealthyPercentageandmaxHealthyPercentageto -1 will clear the previously set value.Both or neither of
minHealthyPercentageandmaxHealthyPercentagemust be specified, and the difference between them cannot be greater than 100. A large range increases the number of instances that can be replaced at the same time.Default: - No instance maintenance policy.
- See Also:
-
getMixedInstancesPolicy
Mixed Instances Policy to use.Launch configuration related settings and Launch Template must not be specified when a MixedInstancesPolicy is specified.
Default: - Do not provide any MixedInstancesPolicy
-
getRequireImdsv2
Whether IMDSv2 should be required on launched instances.Default: false
-
getRole
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:launchTemplateandmixedInstancesPolicymust not be specified when this property is specifiedDefault: A role will automatically be created, it can be accessed via the `role` property
Example:
Role role = Role.Builder.create(this, "MyRole") .assumedBy(new ServicePrincipal("ec2.amazonaws.com")) .build(); -
getSecurityGroup
Security group to launch the instances in.launchTemplateandmixedInstancesPolicymust not be specified when this property is specifiedDefault: - A SecurityGroup will be created if none is specified.
-
getUserData
Specific UserData to use.The UserData may still be mutated after creation.
launchTemplateandmixedInstancesPolicymust not be specified when this property is specifiedDefault: - A UserData object appropriate for the MachineImage's Operating System is created.
-
builder
- Returns:
- a
AutoScalingGroupProps.BuilderofAutoScalingGroupProps
-