heat_template_version: 2013-05-23 description: > A HOT template that holds an ASRG of a stack parameters: KeyName: type: string description: Name of an existing key pair to use for the instance flavor: type: string description: Instance type for the instance to be created default: m1.small constraints: - allowed_values: [m1.tiny, m1.small, m1.medium, m1.large] description: Value must be one of 'm1.tiny', 'm1.small', 'm1.medium', or 'm1.large' image: type: string default: F17-x86_64-cfntools description: ID of the image to use for the instance meter_group: type: string description: value of VM's metering.instgroup metadatum default: ogrp resources: my_group: type: OS::Heat::AutoScalingGroup properties: resource: type: AWS::CloudFormation::Stack properties: Parameters: KeyName: { get_param: KeyName } image: { get_param: image } flavor: { get_param: flavor } meter_group: { get_param: meter_group } TemplateURL: http://my.favorite.server/path/VM_with_EBS.yaml min_size: 1 desired_capacity: 3 max_size: 5 control_group: type: AWS::AutoScaling::AutoScalingGroup properties: AvailabilityZones: {'Fn::GetAZs': ''} LaunchConfigurationName: {get_resource: LaunchConfig} MinSize: '1' DesiredCapacity: 2 MaxSize: '3' Tags: - {Key: metering.server_group, Value: control_group} LaunchConfig: type: AWS::AutoScaling::LaunchConfiguration properties: ImageId: {get_param: image} InstanceType: {get_param: flavor} KeyName: { get_param: KeyName } ControlScaleUpPolicy: type: AWS::AutoScaling::ScalingPolicy properties: AdjustmentType: ChangeInCapacity AutoScalingGroupName: {get_resource: control_group} Cooldown: 60 ScalingAdjustment: '1' ControlScaleDnPolicy: type: AWS::AutoScaling::ScalingPolicy properties: AdjustmentType: ChangeInCapacity AutoScalingGroupName: {get_resource: control_group} Cooldown: 60 ScalingAdjustment: -1 WebServerScaleUpPolicy: type: AWS::AutoScaling::ScalingPolicy properties: AdjustmentType: ChangeInCapacity AutoScalingGroupName: {get_resource: my_group} Cooldown: 60 ScalingAdjustment: '1' WebServerScaleDnPolicy: type: AWS::AutoScaling::ScalingPolicy properties: AdjustmentType: ChangeInCapacity AutoScalingGroupName: {get_resource: my_group} Cooldown: 60 ScalingAdjustment: '-11' outputs: group_id: description: the ID of the ASG value: { get_resource: my_group } control_up_url: value: {get_attr: [ControlScaleUpPolicy, AlarmUrl]} control_dn_url: value: {get_attr: [ControlScaleDnPolicy, AlarmUrl]} scale_up_url: value: {get_attr: [WebServerScaleUpPolicy, AlarmUrl]} scale_dn_url: value: {get_attr: [WebServerScaleDnPolicy, AlarmUrl]}