Interface AutoScalingGroupProps

All Superinterfaces:
CommonAutoScalingGroupProps, software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
AutoScalingGroupProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-04-10T22:22:24.032Z") @Stability(Stable) public interface AutoScalingGroupProps extends software.amazon.jsii.JsiiSerializable, CommonAutoScalingGroupProps
Properties of a Fleet.

Example:

 Vpc vpc;
 InstanceType instanceType;
 IMachineImage machineImage;
 AutoScalingGroup.Builder.create(this, "ASG")
         .vpc(vpc)
         .instanceType(instanceType)
         .machineImage(machineImage)
         // ...
         .init(CloudFormationInit.fromElements(InitFile.fromString("/etc/my_instance", "This got written during instance startup")))
         .signals(Signals.waitForAll(SignalsOptions.builder()
                 .timeout(Duration.minutes(10))
                 .build()))
         .build();
 
  • Method Details

    • getVpc

      @Stability(Stable) @NotNull IVpc getVpc()
      VPC to launch these instances in.
    • getInit

      @Stability(Stable) @Nullable default CloudFormationInit getInit()
      Apply the given CloudFormation Init configuration to the instances in the AutoScalingGroup at startup.

      If you specify init, you must also specify signals to configure the number of instances to wait for and the timeout for waiting for the init process.

      Default: - no CloudFormation init

    • getInitOptions

      @Stability(Stable) @Nullable default ApplyCloudFormationInitOptions getInitOptions()
      Use the given options for applying CloudFormation Init.

      Describes the configsets to use and the timeout to wait

      Default: - default options

    • getInstanceType

      @Stability(Stable) @Nullable default InstanceType getInstanceType()
      Type of instance to launch.

      launchTemplate and mixedInstancesPolicy must not be specified when this property is specified

      Default: - Do not provide any instance type

    • getLaunchTemplate

      @Stability(Stable) @Nullable default ILaunchTemplate 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

      @Stability(Stable) @Nullable default IMachineImage getMachineImage()
      AMI to launch.

      launchTemplate and mixedInstancesPolicy must not be specified when this property is specified

      Default: - Do not provide any machine image

    • getMaxHealthyPercentage

      @Stability(Stable) @Nullable default Number 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 minHealthyPercentage and maxHealthyPercentage to -1 will clear the previously set value.

      Both or neither of minHealthyPercentage and maxHealthyPercentage must 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:
    • getMinHealthyPercentage

      @Stability(Stable) @Nullable default Number 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 minHealthyPercentage and maxHealthyPercentage to -1 will clear the previously set value.

      Both or neither of minHealthyPercentage and maxHealthyPercentage must 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

      @Stability(Stable) @Nullable default MixedInstancesPolicy 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

      @Stability(Stable) @Nullable default Boolean getRequireImdsv2()
      Whether IMDSv2 should be required on launched instances.

      Default: false

    • getRole

      @Stability(Stable) @Nullable default IRole 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:

      launchTemplate and mixedInstancesPolicy must not be specified when this property is specified

      Default: 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

      @Stability(Stable) @Nullable default ISecurityGroup getSecurityGroup()
      Security group to launch the instances in.

      launchTemplate and mixedInstancesPolicy must not be specified when this property is specified

      Default: - A SecurityGroup will be created if none is specified.

    • getUserData

      @Stability(Stable) @Nullable default UserData getUserData()
      Specific UserData to use.

      The UserData may still be mutated after creation.

      launchTemplate and mixedInstancesPolicy must not be specified when this property is specified

      Default: - A UserData object appropriate for the MachineImage's Operating System is created.

    • builder

      @Stability(Stable) static AutoScalingGroupProps.Builder builder()
      Returns:
      a AutoScalingGroupProps.Builder of AutoScalingGroupProps