class Signals
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AutoScaling.Signals |
Java | software.amazon.awscdk.services.autoscaling.Signals |
Python | aws_cdk.aws_autoscaling.Signals |
TypeScript (source) | @aws-cdk/aws-autoscaling » Signals |
Configure whether the AutoScalingGroup waits for signals.
If you do configure waiting for signals, you should make sure the instances
invoke cfn-signal
somewhere in their UserData to signal that they have
started up (either successfully or unsuccessfully).
Signals are used both during intial creation and subsequent updates.
Example
declare const vpc: ec2.Vpc;
declare const instanceType: ec2.InstanceType;
declare const machineImage: ec2.IMachineImage;
new autoscaling.AutoScalingGroup(this, 'ASG', {
vpc,
instanceType,
machineImage,
// ...
init: ec2.CloudFormationInit.fromElements(
ec2.InitFile.fromString('/etc/my_instance', 'This got written during instance startup'),
),
signals: autoscaling.Signals.waitForAll({
timeout: Duration.minutes(10),
}),
});
Initializer
new Signals()
Methods
Name | Description |
---|---|
render | Render the ASG's CreationPolicy. |
protected do | Helper to render the actual creation policy, as the logic between them is quite similar. |
static wait | Wait for the desiredCapacity of the AutoScalingGroup amount of signals to have been received. |
static wait | Wait for a specific amount of signals to have been received. |
static wait | Wait for the minCapacity of the AutoScalingGroup amount of signals to have been received. |
CreationPolicy(renderOptions)
renderpublic renderCreationPolicy(renderOptions: RenderSignalsOptions): CfnCreationPolicy
Parameters
- renderOptions
Render
Signals Options
Returns
Render the ASG's CreationPolicy.
Render(options, count?)
protected doprotected doRender(options: SignalsOptions, count?: number): CfnCreationPolicy
Parameters
- options
Signals
Options - count
number
Returns
Helper to render the actual creation policy, as the logic between them is quite similar.
ForAll(options?)
static waitpublic static waitForAll(options?: SignalsOptions): Signals
Parameters
- options
Signals
Options
Returns
Wait for the desiredCapacity of the AutoScalingGroup amount of signals to have been received.
If no desiredCapacity has been configured, wait for minCapacity signals intead.
This number is used during initial creation and during replacing updates. During rolling updates, all updated instances must send a signal.
ForCount(count, options?)
static waitpublic static waitForCount(count: number, options?: SignalsOptions): Signals
Parameters
- count
number
- options
Signals
Options
Returns
Wait for a specific amount of signals to have been received.
You should send one signal per instance, so this represents the number of instances to wait for.
This number is used during initial creation and during replacing updates. During rolling updates, all updated instances must send a signal.
ForMinCapacity(options?)
static waitpublic static waitForMinCapacity(options?: SignalsOptions): Signals
Parameters
- options
Signals
Options
Returns
Wait for the minCapacity of the AutoScalingGroup amount of signals to have been received.
This number is used during initial creation and during replacing updates. During rolling updates, all updated instances must send a signal.