Created
December 17, 2013 17:56
-
-
Save anonymous/8009540 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
# 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.small | |
constraints: | |
- allowed_values: [m1.small] | |
description: Value must be one of 'm1.small' | |
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} #Ref und Klammern hinzugefügt | |
ScalingAdjustment: 1 | |
AdjustmentType: ChangeInCapacity | |
scaleDownPolicy: | |
type: AWS::AutoScaling::ScalingPolicy | |
properties: | |
AutoScalingGroupName: {Ref: group} #Ref und Klammern hinzugefügt | |
ScalingAdjustment: -1 | |
AdjustmentType: ChangeInCapacity | |
launch: | |
type: AWS::AutoScaling::LaunchConfiguration | |
properties: | |
KeyName: { get_param: KeyName } | |
InstanceType: { get_param: InstanceType } | |
ImageId: {get_param: ImageId} | |
RAMAlarmHigh: | |
type: OS::Ceilometer::Alarm | |
properties: | |
description: Scale-up if the average RAM > 50% for 30 Seconds | |
meter_name: cpu_util | |
statistic: avg | |
period: '30' | |
evaluation_periods: '1' | |
threshold: '50' | |
alarm_actions: | |
- {"Fn::GetAtt": [scaleUpPolicy, AlarmUrl]} | |
comparison_operator: gt | |
RAMAlarmLow: | |
type: OS::Ceilometer::Alarm | |
properties: | |
description: Scale-down if the average RAM < 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] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment