Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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'
LoadBalancerNames: [{get_resource: loadbalancer}]
DesiredCapacity: 1
MinSize: '1'
MaxSize: '10'
# MaxSize: '2'
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 cumulative bytes > 10M for 30 Seconds
meter_name: network.incoming.bytes
repeat_actions: True
statistic: avg
period: '30'
evaluation_periods: '1'
threshold: '10000000'
alarm_actions:
- {"Fn::GetAtt": [scaleUpPolicy, AlarmUrl]}
comparison_operator: gt
RAMAlarmLow:
type: OS::Ceilometer::Alarm
properties:
description: Scale-down if the cumulative bytes < 1M for 30 Seconds
meter_name: network.incoming.bytes
repeat_actions: True
statistic: avg
period: '30'
evaluation_periods: '1'
threshold: '1000000'
alarm_actions:
- {"Fn::GetAtt": [scaleDownPolicy, AlarmUrl]}
comparison_operator: lt
loadbalancer:
type: OS::Neutron::LoadBalancer
properties:
pool_id: {get_resource: pool}
protocol_port: 500
pool:
type: OS::Neutron::Pool
properties:
#admin_state_up: Boolean
#description: String
lb_method: LEAST_CONNECTIONS
#monitors: [Value, Value, ...]
#name: String
protocol: TCP
subnet_id: 04b2e779-e01c-4260-90f2-ac8d68cd26c0
vip: {"protocol_port": 500}
# poolmember:
# type: OS::Neutron::PoolMember
# properties:
# address: {get_resource: group}
# #admin_state_up: Boolean
# pool_id: {get_resource: pool}
# protocol_port: '500'
# #weight: Integer
outputs:
lb_ip:
description: The IP address of the load balancer
value: { get_attr: [loadbalancer, PublicIp] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.