aws-cdk-lib.aws_cloudwatch_actions.Ec2InstanceAction

enum Ec2InstanceAction

LanguageType name
.NETAmazon.CDK.AWS.CloudWatch.Actions.Ec2InstanceAction
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscloudwatchactions#Ec2InstanceAction
Javasoftware.amazon.awscdk.services.cloudwatch.actions.Ec2InstanceAction
Pythonaws_cdk.aws_cloudwatch_actions.Ec2InstanceAction
TypeScript (source)aws-cdk-lib » aws_cloudwatch_actions » Ec2InstanceAction

Types of EC2 actions available.

Example

// Alarm must be configured with an EC2 per-instance metric
declare const alarm: cloudwatch.Alarm;
// Attach a reboot when alarm triggers
alarm.addAlarmAction(
  new actions.Ec2Action(actions.Ec2InstanceAction.REBOOT),
);

Members

NameDescription
STOPStop the instance.
TERMINATETerminatethe instance.
RECOVERRecover the instance.
REBOOTReboot the instance.

STOP

Stop the instance.


TERMINATE

Terminatethe instance.


RECOVER

Recover the instance.


REBOOT

Reboot the instance.