Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify EBS default autoscaling group #90

Open
Rshomali opened this issue Nov 18, 2016 · 0 comments
Open

Modify EBS default autoscaling group #90

Rshomali opened this issue Nov 18, 2016 · 0 comments

Comments

@Rshomali
Copy link

Hi,

I would like to add a scale up and scale down policy to the existing autoscaling group created by EBS. I tried to add a config file under .ebextensions with:

Resources:
  AWSEBAutoScalingGroup:
    Type: "AWS::AutoScaling::AutoScalingGroup"
    Properties:
      HealthCheckType: ELB
      HealthCheckGracePeriod: 300
  ScaleUpPolicy:
    Type: AWS::AutoScaling::ScalingPolicy
    Properties:
      AdjustmentType: "ChangeInCapacity"
      AutoScalingGroupName: { "Ref" : "AWSEBAutoScalingGroup" }
      Cooldown: 60
      ScalingAdjustment: 1
  ScaleDownPolicy:
    Type: AWS::AutoScaling::ScalingPolicy
    Properties:
      AdjustmentType: "ChangeInCapacity"
      AutoScalingGroupName: { "Ref" : "AWSEBAutoScalingGroup" }
      Cooldown: 60
      ScalingAdjustment: -1
  HighCPUUsageAlarm:
    Type: AWS::CloudWatch::Alarm
    Properties:
      AlarmDescription: "Alarm if CPU Usage > 80%"
      Namespace: "SWF/EC2"
      MetricName: CPUUtilization
      Dimensions:
        - Name: AutoScalingGroupName
          Value: { "Ref" : "AWSEBAutoScalingGroup" }
      Statistic: Average
      Period: 60
      EvaluationPeriods: 1
      Threshold: 80
      ComparisonOperator: GreaterThanThreshold
      AlarmActions:
          - Ref: ScaleUpPolicy

But nothing is changed. I also using CloudFormation template to create AWS resources and it is defined in my eb_deployer.yml:

  resources: &resources
    template: config/resources.json
    inputs:
      <<: *resource_inputs
    outputs:
     . . .

I tried to define the new policy and alarms in resources.json, but the only way I could get it working is by creating and new load balancer to reference. I couldn't find a way to reference the default autoscaling group name in resources.json.

Any help to modify the existing scaling group policy and and more scale up and down policies would be great.

Thanks
Rami

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant