Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This is a hello world HOT template just defining a single compute instance
- heat_template_version: 2013-05-23
- description: Test-template
- parameters:
- KeyName:
- type: string
- description: Name of an existing key pair to use for the instance
- InstanceType:
- type: string
- description: Instance type for the instance to be created
- default: m1.micro
- constraints:
- - allowed_values: [m1.micro]
- description: Value must be one of 'm1.micro'
- ImageId:
- type: string
- description: ID of the image to use for the instance
- resources:
- group:
- type: AWS::AutoScaling::AutoScalingGroup
- properties:
- # Cooldown: '60'
- # DesiredCapacity: 7
- MinSize: '1'
- MaxSize: '10'
- LaunchConfigurationName: {Ref: launch}
- AvailabilityZones: {'Fn::GetAZs':''}
- scaleUpPolicy:
- type: AWS::AutoScaling::ScalingPolicy
- properties:
- AutoScalingGroupName: {Ref: group}
- ScalingAdjustment: 1
- AdjustmentType: ChangeInCapacity
- scaleDownPolicy:
- type: AWS::AutoScaling::ScalingPolicy
- properties:
- AutoScalingGroupName: {Ref: group}
- ScalingAdjustment: -1
- AdjustmentType: ChangeInCapacity
- launch:
- type: AWS::AutoScaling::LaunchConfiguration
- properties:
- KeyName: { get_param: KeyName }
- InstanceType: { get_param: InstanceType }
- ImageId: {get_param: ImageId}
- CPUAlarmHigh:
- type: OS::Ceilometer::Alarm
- properties:
- description: Scale-up if the average CPU > 20% for 30 Seconds
- meter_name: cpu_util
- statistic: avg
- period: '30'
- evaluation_periods: '1'
- threshold: '20'
- alarm_actions:
- - {"Fn::GetAtt": [scaleUpPolicy, AlarmUrl]}
- comparison_operator: gt
- CPUAlarmLow:
- type: OS::Ceilometer::Alarm
- properties:
- description: Scale-down if the average CPU < 30% for 30 Seconds
- meter_name: cpu_util
- statistic: avg
- period: '30'
- evaluation_periods: '1'
- threshold: '30'
- alarm_actions:
- - {"Fn::GetAtt": [scaleDownPolicy, AlarmUrl]}
- comparison_operator: lt
- #outputs:
- # instance_ip:
- # description: The IP address of the deployed instance
- # value: { get_attr: [instance, PublicIp] }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement