Skip to content

Instantly share code, notes, and snippets.

@georgmao
Created September 2, 2020 20:36
Show Gist options
  • Save georgmao/195845b63af0adb287cec8fb92b0c20b to your computer and use it in GitHub Desktop.
Save georgmao/195845b63af0adb287cec8fb92b0c20b to your computer and use it in GitHub Desktop.
MyTargetTrackingScalingPolicy:
Type: AWS::ApplicationAutoScaling::ScalingPolicy
Properties:
PolicyName: utilization
PolicyType: TargetTrackingScaling
ScalingTargetId: !Ref MyScalableTarget
TargetTrackingScalingPolicyConfiguration:
TargetValue: 0.70 # Any value between 0 and 1 can be used here
# PredefinedMetricSpecification:
# PredefinedMetricType: LambdaProvisionedConcurrencyUtilization
CustomizedMetricSpecification:
Dimensions:
- Name: FunctionName
Value: !Ref ApiFunction
- Name: Resource
Value: !Sub "${ApiFunction}:live"
MetricName: ProvisionedConcurrencyUtilization
Namespace: AWS/Lambda
Statistic: Maximum
Unit: Count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment