ScalingConfig - AWS Serverless Application Model
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

ScalingConfig

Specifies how the capacity provider scales Amazon Elastic Compute Cloud (Amazon EC2) instances based on demand. You set the maximum number of vCPUs that the capacity provider can provision, and the target average CPU or GPU utilization that triggers scaling.

Syntax

To declare this entity in your AWS Serverless Application Model (AWS SAM) template, use the following syntax.

Properties

MaxVCpuCount

The maximum number of vCPUs that the capacity provider can provision across all compute instances.

Type: Integer

Required: No

CloudFormation compatibility: This property is passed directly to the MaxVCpuCount property of CapacityProviderScalingConfig of an AWS::Lambda::CapacityProvider resource.

AverageCPUUtilization

The target average CPU utilization percentage (0-100) for scaling decisions. When the average CPU utilization exceeds this threshold, the capacity provider will scale up Amazon EC2 instances. When specified, AWS SAM constructs CapacityProviderScalingConfig of an AWS::Lambda::CapacityProvider resource with the ScalingMode set to 'Manual' and ScalingPolicies set to [{PredefinedMetricType: 'LambdaCapacityProviderAverageCPUUtilization', TargetValue: <this value>}].

Type: Double

Required: No

CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an CloudFormation equivalent.

AverageGPUUtilization

The target average GPU utilization percentage (0-100) for scaling decisions. When the average GPU utilization exceeds this threshold, the capacity provider scales up GPU-enabled Amazon EC2 instances. When specified, AWS SAM constructs CapacityProviderScalingConfig of an AWS::Lambda::CapacityProvider resource with the ScalingMode set to 'Manual' and adds {PredefinedMetricType: 'LambdaCapacityProviderAverageGPUUtilization', TargetValue: <this value>} to ScalingPolicies.

If you specify both AverageCPUUtilization and AverageGPUUtilization, AWS SAM creates one scaling policy for each metric.

Type: Double

Required: No

CloudFormation compatibility: This property is unique to AWS SAM and doesn't have an CloudFormation equivalent.

Examples

Scaling configuration

The following example shows a scaling configuration with maximum VCpu count and average CPU utilization.

ScalingConfig: MaxVCpuCount: 10 AverageCPUUtilization: 70.0

GPU utilization scaling

The following example shows a scaling configuration for GPU functions that scales on average GPU utilization.

ScalingConfig: MaxVCpuCount: 100 AverageGPUUtilization: 70.0