Skip to content

Instantly share code, notes, and snippets.

@djheru
Created April 22, 2020 18:48
Show Gist options
  • Save djheru/7b465061c7d5c720a1aa340350d5da27 to your computer and use it in GitHub Desktop.
Save djheru/7b465061c7d5c720a1aa340350d5da27 to your computer and use it in GitHub Desktop.
Target Request Autoscaling Policy
TargetRequestAutoScalingPolicy:
Type: AWS::ApplicationAutoScaling::ScalingPolicy
Properties:
PolicyName: !Sub '${Name}-${EnvironmentName}-${ServiceName}-RequestAutoScalingPolicy'
PolicyType: TargetTrackingScaling
ScalingTargetId: !Ref AutoScalingTarget
TargetTrackingScalingPolicyConfiguration:
TargetValue: 10.0
ScaleInCooldown: 60
ScaleOutCooldown: 30
PredefinedMetricSpecification:
PredefinedMetricType: ALBRequestCountPerTarget
ResourceLabel: !Join
- ''
- - Fn::Select:
- 1
- Fn::Split:
- 'loadbalancer/'
- Fn::ImportValue: !Sub '${Name}-${EnvironmentName}-${SubdomainName}-LoadBalancer'
- '/targetgroup'
- Fn::Select:
- 1
- Fn::Split:
- 'targetgroup'
- !Ref TargetGroup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment