Show / Hide Table of Contents

Class AddAutoScalingGroupCapacityOptions

The properties for adding an AutoScalingGroup.

Inheritance
System.Object
AddAutoScalingGroupCapacityOptions
Implements
IAddAutoScalingGroupCapacityOptions
Namespace: Amazon.CDK.AWS.ECS
Assembly: Amazon.CDK.AWS.ECS.dll
Syntax (csharp)
public class AddAutoScalingGroupCapacityOptions : Object, IAddAutoScalingGroupCapacityOptions
Syntax (vb)
Public Class AddAutoScalingGroupCapacityOptions
    Inherits Object
    Implements IAddAutoScalingGroupCapacityOptions
Remarks

ExampleMetadata: fixture=_generated

Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.KMS;
using Amazon.CDK;

Key key;
var addAutoScalingGroupCapacityOptions = new AddAutoScalingGroupCapacityOptions {
    CanContainersAccessInstanceRole = false,
    MachineImageType = MachineImageType.AMAZON_LINUX_2,
    SpotInstanceDraining = false,
    TaskDrainTime = Duration.Minutes(30),
    TopicEncryptionKey = key
};

Synopsis

Constructors

AddAutoScalingGroupCapacityOptions()

Properties

CanContainersAccessInstanceRole

Specifies whether the containers can access the container instance role.

MachineImageType

What type of machine image this is.

SpotInstanceDraining

Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services.

TaskDrainTime

(deprecated) The time period to wait before force terminating an instance that is draining.

TopicEncryptionKey

If {@link AddAutoScalingGroupCapacityOptions.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 for more information.

Constructors

AddAutoScalingGroupCapacityOptions()

public AddAutoScalingGroupCapacityOptions()

Properties

CanContainersAccessInstanceRole

Specifies whether the containers can access the container instance role.

public Nullable<bool> CanContainersAccessInstanceRole { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: false

MachineImageType

What type of machine image this is.

public Nullable<MachineImageType> MachineImageType { get; set; }
Property Value

System.Nullable<MachineImageType>

Remarks

Depending on the setting, different UserData will automatically be added to the AutoScalingGroup to configure it properly for use with ECS.

If you create an AutoScalingGroup yourself and are adding it via addAutoScalingGroup(), you must specify this value. If you are adding an autoScalingGroup via addCapacity, this value will be determined from the machineImage you pass.

Default: - Automatically determined from machineImage, if available, otherwise MachineImageType.AMAZON_LINUX_2.

SpotInstanceDraining

Specify whether to enable Automated Draining for Spot Instances running Amazon ECS Services.

public Nullable<bool> SpotInstanceDraining { get; set; }
Property Value

System.Nullable<System.Boolean>

Remarks

For more information, see Using Spot Instances.

Default: false

TaskDrainTime

(deprecated) The time period to wait before force terminating an instance that is draining.

public Duration TaskDrainTime { get; set; }
Property Value

Duration

Remarks

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.

Default: Duration.minutes(5)

Stability: Deprecated

TopicEncryptionKey

If {@link AddAutoScalingGroupCapacityOptions.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 for more information.

public IKey TopicEncryptionKey { get; set; }
Property Value

IKey

Remarks

Default: The SNS Topic will not be encrypted.

Implements

IAddAutoScalingGroupCapacityOptions
Back to top Generated by DocFX