interface EnableScalingProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ApplicationAutoScaling.EnableScalingProps |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapplicationautoscaling#EnableScalingProps |
![]() | software.amazon.awscdk.services.applicationautoscaling.EnableScalingProps |
![]() | aws_cdk.aws_applicationautoscaling.EnableScalingProps |
![]() | aws-cdk-lib » aws_applicationautoscaling » EnableScalingProps |
Properties for enabling Application Auto Scaling.
Example
declare const cluster: ecs.Cluster;
const loadBalancedFargateService = new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'Service', {
cluster,
memoryLimitMiB: 1024,
desiredCount: 1,
cpu: 512,
taskImageOptions: {
image: ecs.ContainerImage.fromRegistry("amazon/amazon-ecs-sample"),
},
minHealthyPercent: 100,
});
const scalableTarget = loadBalancedFargateService.service.autoScaleTaskCount({
minCapacity: 1,
maxCapacity: 20,
});
scalableTarget.scaleOnCpuUtilization('CpuScaling', {
targetUtilizationPercent: 50,
});
scalableTarget.scaleOnMemoryUtilization('MemoryScaling', {
targetUtilizationPercent: 50,
});
Properties
Name | Type | Description |
---|---|---|
max | number | Maximum capacity to scale to. |
min | number | Minimum capacity to scale to. |
maxCapacity
Type:
number
Maximum capacity to scale to.
minCapacity?
Type:
number
(optional, default: 1)
Minimum capacity to scale to.