aws-cdk-lib.aws_autoscaling.GroupMetric

class GroupMetric

LanguageType name
.NETAmazon.CDK.AWS.AutoScaling.GroupMetric
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsautoscaling#GroupMetric
Javasoftware.amazon.awscdk.services.autoscaling.GroupMetric
Pythonaws_cdk.aws_autoscaling.GroupMetric
TypeScript (source)aws-cdk-lib » aws_autoscaling » GroupMetric

Group metrics that an Auto Scaling group sends to Amazon CloudWatch.

Example

declare const vpc: ec2.Vpc;
declare const instanceType: ec2.InstanceType;
declare const machineImage: ec2.IMachineImage;

// Enable monitoring of all group metrics
new autoscaling.AutoScalingGroup(this, 'ASG', {
  vpc,
  instanceType,
  machineImage,

  // ...

  groupMetrics: [autoscaling.GroupMetrics.all()],
});

// Enable monitoring for a subset of group metrics
new autoscaling.AutoScalingGroup(this, 'ASG', {
  vpc,
  instanceType,
  machineImage,

  // ...

  groupMetrics: [new autoscaling.GroupMetrics(autoscaling.GroupMetric.MIN_SIZE, autoscaling.GroupMetric.MAX_SIZE)],
});

Initializer

new GroupMetric(name: string)

Parameters

  • name string

Properties

NameTypeDescription
namestringThe name of the group metric.
static DESIRED_CAPACITYGroupMetricThe number of instances that the Auto Scaling group attempts to maintain.
static IN_SERVICE_INSTANCESGroupMetricThe number of instances that are running as part of the Auto Scaling group This metric does not include instances that are pending or terminating.
static MAX_SIZEGroupMetricThe maximum size of the Auto Scaling group.
static MIN_SIZEGroupMetricThe minimum size of the Auto Scaling group.
static PENDING_INSTANCESGroupMetricThe number of instances that are pending A pending instance is not yet in service, this metric does not include instances that are in service or terminating.
static STANDBY_INSTANCESGroupMetricThe number of instances that are in a Standby state Instances in this state are still running but are not actively in service.
static TERMINATING_INSTANCESGroupMetricThe number of instances that are in the process of terminating This metric does not include instances that are in service or pending.
static TOTAL_INSTANCESGroupMetricThe total number of instances in the Auto Scaling group This metric identifies the number of instances that are in service, pending, and terminating.

name

Type: string

The name of the group metric.


static DESIRED_CAPACITY

Type: GroupMetric

The number of instances that the Auto Scaling group attempts to maintain.


static IN_SERVICE_INSTANCES

Type: GroupMetric

The number of instances that are running as part of the Auto Scaling group This metric does not include instances that are pending or terminating.


static MAX_SIZE

Type: GroupMetric

The maximum size of the Auto Scaling group.


static MIN_SIZE

Type: GroupMetric

The minimum size of the Auto Scaling group.


static PENDING_INSTANCES

Type: GroupMetric

The number of instances that are pending A pending instance is not yet in service, this metric does not include instances that are in service or terminating.


static STANDBY_INSTANCES

Type: GroupMetric

The number of instances that are in a Standby state Instances in this state are still running but are not actively in service.


static TERMINATING_INSTANCES

Type: GroupMetric

The number of instances that are in the process of terminating This metric does not include instances that are in service or pending.


static TOTAL_INSTANCES

Type: GroupMetric

The total number of instances in the Auto Scaling group This metric identifies the number of instances that are in service, pending, and terminating.