Class AddAutoScalingGroupCapacityOptions.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.AddAutoScalingGroupCapacityOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<AddAutoScalingGroupCapacityOptions>
- Enclosing interface:
- AddAutoScalingGroupCapacityOptions
@Stability(Stable)
public static final class AddAutoScalingGroupCapacityOptions.Builder
extends Object
implements software.amazon.jsii.Builder<AddAutoScalingGroupCapacityOptions>
A builder for
AddAutoScalingGroupCapacityOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.canContainersAccessInstanceRole
(Boolean canContainersAccessInstanceRole) Sets the value ofAddAutoScalingGroupCapacityOptions.getCanContainersAccessInstanceRole()
machineImageType
(MachineImageType machineImageType) Sets the value ofAddAutoScalingGroupCapacityOptions.getMachineImageType()
spotInstanceDraining
(Boolean spotInstanceDraining) Sets the value ofAddAutoScalingGroupCapacityOptions.getSpotInstanceDraining()
taskDrainTime
(Duration taskDrainTime) Deprecated.The lifecycle draining hook is not configured if using the EC2 Capacity Provider.topicEncryptionKey
(IKey topicEncryptionKey) Sets the value ofAddAutoScalingGroupCapacityOptions.getTopicEncryptionKey()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
canContainersAccessInstanceRole
@Stability(Stable) public AddAutoScalingGroupCapacityOptions.Builder canContainersAccessInstanceRole(Boolean canContainersAccessInstanceRole) Sets the value ofAddAutoScalingGroupCapacityOptions.getCanContainersAccessInstanceRole()
- Parameters:
canContainersAccessInstanceRole
- Specifies whether the containers can access the container instance role.- Returns:
this
-
machineImageType
@Stability(Stable) public AddAutoScalingGroupCapacityOptions.Builder machineImageType(MachineImageType machineImageType) Sets the value ofAddAutoScalingGroupCapacityOptions.getMachineImageType()
- Parameters:
machineImageType
- What type of machine image this is. Depending on the setting, different UserData will automatically be added to theAutoScalingGroup
to configure it properly for use with ECS.If you create an
AutoScalingGroup
yourself and are adding it viaaddAutoScalingGroup()
, you must specify this value. If you are adding anautoScalingGroup
viaaddCapacity
, this value will be determined from themachineImage
you pass.- Returns:
this
-
spotInstanceDraining
@Stability(Stable) public AddAutoScalingGroupCapacityOptions.Builder spotInstanceDraining(Boolean spotInstanceDraining) Sets the value ofAddAutoScalingGroupCapacityOptions.getSpotInstanceDraining()
- Parameters:
spotInstanceDraining
- Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services. For more information, see Using Spot Instances.- Returns:
this
-
taskDrainTime
@Stability(Deprecated) @Deprecated public AddAutoScalingGroupCapacityOptions.Builder taskDrainTime(Duration taskDrainTime) Deprecated.The lifecycle draining hook is not configured if using the EC2 Capacity Provider. Enable managed termination protection instead.Sets the value ofAddAutoScalingGroupCapacityOptions.getTaskDrainTime()
- Parameters:
taskDrainTime
- The time period to wait before force terminating an instance that is draining. This creates a Lambda function that is used by a lifecycle hook for the AutoScalingGroup that will delay instance termination until all ECS tasks have drained from the instance. Set to 0 to disable task draining.Set to 0 to disable task draining.
- Returns:
this
-
topicEncryptionKey
@Stability(Stable) public AddAutoScalingGroupCapacityOptions.Builder topicEncryptionKey(IKey topicEncryptionKey) Sets the value ofAddAutoScalingGroupCapacityOptions.getTopicEncryptionKey()
- Parameters:
topicEncryptionKey
- IfAddAutoScalingGroupCapacityOptions.taskDrainTime
is non-zero, then the ECS cluster creates an SNS Topic to as part of a system to drain instances of tasks when the instance is being shut down. If this property is provided, then this key will be used to encrypt the contents of that SNS Topic. See [SNS Data Encryption](https://docs.aws.amazon.com/sns/latest/dg/sns-data-encryption.html) for more information.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<AddAutoScalingGroupCapacityOptions>
- Returns:
- a new instance of
AddAutoScalingGroupCapacityOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-