ServiceNamespace

class aws_cdk.aws_applicationautoscaling.ServiceNamespace(value)

Bases: Enum

The service that supports Application AutoScaling.

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

APPSTREAM

App Stream.

COMPREHEND

Comprehend.

CUSTOM_RESOURCE

Custom Resource.

DYNAMODB

Dynamo DB.

EC2

Elastic Compute Cloud.

ECS

Elastic Container Service.

ELASTICACHE

ElastiCache.

ELASTIC_MAP_REDUCE

Elastic Map Reduce.

KAFKA

Kafka.

LAMBDA

Lambda.

RDS

Relational Database Service.

SAGEMAKER

SageMaker.