Skip to content

Instantly share code, notes, and snippets.

@claydanford
Created August 10, 2020 20:38
Show Gist options
  • Save claydanford/c4ee734faf83bbec9ec62ff66eb9eeb6 to your computer and use it in GitHub Desktop.
Save claydanford/c4ee734faf83bbec9ec62ff66eb9eeb6 to your computer and use it in GitHub Desktop.
Resources:
PCTargetHello:
Type: AWS::ApplicationAutoScaling::ScalableTarget
DependsOn: HelloProvConcLambdaAlias
Properties:
MaxCapacity: 10
MinCapacity: 1
ResourceId: function:${self:service}-${self:provider.stage}-hello:provisioned
RoleARN: arn:aws:iam::${AWS::AccountId}:role/aws-service-role/lambda.application-autoscaling.amazonaws.com/AWSServiceRoleForApplicationAutoScaling_LambdaConcurrency
ScalableDimension: lambda:function:ProvisionedConcurrency
ServiceNamespace: lambda
PCPolicyHello:
Type: AWS::ApplicationAutoScaling::ScalingPolicy
Properties:
PolicyName: ${self:service}-${self:provider.stage}-hello
PolicyType: TargetTrackingScaling
ScalingTargetId: !Ref PCTargetHello
TargetTrackingScalingPolicyConfiguration:
ScaleInCooldown: 120
ScaleOutCooldown: 0
TargetValue: 0.7
PredefinedMetricSpecification:
PredefinedMetricType: LambdaProvisionedConcurrencyUtilization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment