PredefinedMetric

class aws_cdk.aws_applicationautoscaling.PredefinedMetric(value)

Bases: Enum

One of the predefined autoscaling metrics.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_lambda as lambda_

# code: lambda.Code


handler = lambda_.Function(self, "MyFunction",
    runtime=lambda_.Runtime.PYTHON_3_7,
    handler="index.handler",
    code=code,

    reserved_concurrent_executions=2
)

fn_ver = handler.current_version

target = appscaling.ScalableTarget(self, "ScalableTarget",
    service_namespace=appscaling.ServiceNamespace.LAMBDA,
    max_capacity=100,
    min_capacity=10,
    resource_id=f"function:{handler.functionName}:{fnVer.version}",
    scalable_dimension="lambda:function:ProvisionedConcurrency"
)

target.scale_to_track_metric("PceTracking",
    target_value=0.9,
    predefined_metric=appscaling.PredefinedMetric.LAMBDA_PROVISIONED_CONCURRENCY_UTILIZATION
)

Attributes

ALB_REQUEST_COUNT_PER_TARGET

ALB_REQUEST_COUNT_PER_TARGET.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

APPSTREAM_AVERAGE_CAPACITY_UTILIZATION

Average percentage of instances in an AppStream fleet that are being used.

CASSANDRA_READ_CAPACITY_UTILIZATION

Percentage of provisioned read capacity units utilized by a Keyspaces table.

CASSANDRA_WRITE_CAPACITY_UTILIZATION

Percentage of provisioned write capacity units utilized by a Keyspaces table.

COMPREHEND_INFERENCE_UTILIZATION

Percentage of provisioned inference units utilized by a Comprehend endpoint.

DYANMODB_WRITE_CAPACITY_UTILIZATION

(deprecated) DYANMODB_WRITE_CAPACITY_UTILIZATION.

Deprecated:

use PredefinedMetric.DYNAMODB_WRITE_CAPACITY_UTILIZATION

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

Stability:

deprecated

DYNAMODB_READ_CAPACITY_UTILIZATION

Percentage of provisioned read capacity units consumed by a DynamoDB table.

DYNAMODB_WRITE_CAPACITY_UTILIZATION

Percentage of provisioned write capacity units consumed by a DynamoDB table.

Suffix dummy is necessary due to jsii bug (https://github.com/aws/jsii/issues/2782). Duplicate values will be dropped, so this suffix is added as a workaround. The value will be replaced when this enum is used.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

EC2_SPOT_FLEET_REQUEST_AVERAGE_CPU_UTILIZATION

EC2_SPOT_FLEET_REQUEST_AVERAGE_CPU_UTILIZATION.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

EC2_SPOT_FLEET_REQUEST_AVERAGE_NETWORK_IN

EC2_SPOT_FLEET_REQUEST_AVERAGE_NETWORK_IN.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

EC2_SPOT_FLEET_REQUEST_AVERAGE_NETWORK_OUT

EC2_SPOT_FLEET_REQUEST_AVERAGE_NETWORK_OUT.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

ECS_SERVICE_AVERAGE_CPU_UTILIZATION

ECS_SERVICE_AVERAGE_CPU_UTILIZATION.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

ECS_SERVICE_AVERAGE_MEMORY_UTILIZATION

ECS_SERVICE_AVERAGE_MEMORY_UTILIZATION.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

ELASTICACHE_DATABASE_MEMORY_USAGE_COUNTED_FOR_EVICT_PERCENTAGE

ELASTIC_CACHE_REPLICA_ENGINE_CPU_UTILIZATION.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

ELASTICACHE_PRIMARY_ENGINE_CPU_UTILIZATION

ELASTIC_CACHE_PRIMARY_ENGINE_CPU_UTILIZATION.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

ELASTICACHE_REPLICA_ENGINE_CPU_UTILIZATION

ELASTIC_CACHE_REPLICA_ENGINE_CPU_UTILIZATION.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

KAFKA_BROKER_STORAGE_UTILIZATION

KAFKA_BROKER_STORAGE_UTILIZATION.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

LAMBDA_PROVISIONED_CONCURRENCY_UTILIZATION

LAMBDA_PROVISIONED_CONCURRENCY_UTILIZATION.

See:

https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics.html#monitoring-metrics-concurrency

NEPTURE_READER_AVERAGE_CPU_UTILIZATION

Average CPU Utilization of read replica instances in a Neptune DB cluster.

RDS_READER_AVERAGE_CPU_UTILIZATION

RDS_READER_AVERAGE_CPU_UTILIZATION.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

RDS_READER_AVERAGE_DATABASE_CONNECTIONS

RDS_READER_AVERAGE_DATABASE_CONNECTIONS.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html

SAGEMAKER_VARIANT_INVOCATIONS_PER_INSTANCE

SAGEMAKER_VARIANT_INVOCATIONS_PER_INSTANCE.

See:

https://docs.aws.amazon.com/autoscaling/application/APIReference/API_PredefinedMetricSpecification.html