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.giust
- constraints:
- - allowed_values: [m1.giust]
- description: Value must be one of 'm1.giust'
- 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: '5'
- LaunchConfigurationName: {Ref: launch}
- AvailabilityZones: {'Fn::GetAZs':''}
- Tags:
- - {Key: metering.server_group, Value: group}
- 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}
- CPUAlarmHigh:
- type: OS::Ceilometer::Alarm
- properties:
- description: Scale-up if the average CPU > 70% for 60 Seconds
- meter_name: cpu_util
- statistic: avg
- period: '60'
- evaluation_periods: '1'
- repeat_actions: true
- threshold: '70'
- alarm_actions:
- - {"Fn::GetAtt": [scaleUpPolicy, AlarmUrl]}
- matching_metadata: {'metadata.user_metadata.server_group': 'group'}
- comparison_operator: gt
- CPUAlarmLow:
- type: OS::Ceilometer::Alarm
- properties:
- description: Scale-down if the average CPU < 40% for 60 Seconds
- meter_name: cpu_util
- statistic: avg
- period: '60'
- evaluation_periods: '1'
- repeat_actions: true
- threshold: '40'
- alarm_actions:
- - {"Fn::GetAtt": [scaleDownPolicy, AlarmUrl]}
- matching_metadata: {'metadata.user_metadata.server_group': 'group'}
- 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