Last active
April 13, 2018 16:28
-
-
Save Benjamin-Connelly/02aea83d84b7f5c4b682cb41626d1f36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ECSCluster: | |
Type: AWS::ECS::Cluster | |
Properties: | |
ClusterName: !Sub ${AWS::StackName} | |
ECSAutoScalingGroup: | |
Type: AWS::AutoScaling::AutoScalingGroup | |
Properties: | |
VPCZoneIdentifier: | |
- Fn::ImportValue: !Sub '${VPCStackName}-${SubnetType}SubnetList' | |
LaunchConfigurationName: !Ref ECSLaunchConfiguration | |
MetricsCollection: | |
- | |
Granularity: "1Minute" | |
Metrics: | |
- "GroupMinSize" | |
- "GroupMaxSize" | |
MinSize: !Ref MinSize | |
MaxSize: !Ref MaxSize | |
DesiredCapacity: !Ref Desired | |
TerminationPolicies: | |
- Default | |
Tags: | |
- Key: Name | |
Value: !Sub ${AWS::StackName} ECS host | |
PropagateAtLaunch: true | |
CreationPolicy: | |
ResourceSignal: | |
Timeout: PT5M | |
UpdatePolicy: | |
AutoScalingRollingUpdate: | |
MinInstancesInService: 1 | |
MaxBatchSize: 1 | |
PauseTime: PT5M | |
WaitOnResourceSignals: true | |
ScaleUpPolicy: | |
Type: AWS::AutoScaling::ScalingPolicy | |
Properties: | |
AdjustmentType: ChangeInCapacity | |
AutoScalingGroupName: !Ref ECSAutoScalingGroup | |
EstimatedInstanceWarmup: 300 | |
MetricAggregationType: Average | |
PolicyType: StepScaling | |
StepAdjustments: | |
# The X bound is the difference between the breach threshold and the | |
# aggregated CloudWatch metric value | |
- MetricIntervalLowerBound: "0" | |
MetricIntervalUpperBound: "15" | |
ScalingAdjustment: "1" | |
- MetricIntervalLowerBound: "15" | |
ScalingAdjustment: "2" | |
ScaleDownPolicy: | |
Type: AWS::AutoScaling::ScalingPolicy | |
Properties: | |
AdjustmentType: ChangeInCapacity | |
AutoScalingGroupName: !Ref ECSAutoScalingGroup | |
EstimatedInstanceWarmup: 300 | |
MetricAggregationType: Average | |
PolicyType: StepScaling | |
StepAdjustments: | |
# The X bound is the difference between the breach threshold and the | |
# aggregated CloudWatch metric value | |
- MetricIntervalUpperBound: "0" | |
ScalingAdjustment: "-1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment