heat_template_version: 2014-10-16

description: Auto-scaling Test

parameters:
  image_id:
    type: string
    label: Image ID
    description: Image ID from configurations
  capacity:
    type: string
    label: Capacity
    description: Auto-scaling group desired capacity
  fixed_subnet:
    type: string
    label: fixed subnetwork ID
    description: subnetwork ID used for autoscaling
  instance_type:
    type: string
    label: instance_type
    description: type of instance to launch

resources:
  test_pool:
    type: OS::Neutron::Pool
    properties:
      description: Test Pool
      lb_method: ROUND_ROBIN
      name: test_pool
      protocol: HTTP
      subnet: { get_param: fixed_subnet }
      vip: {
        "description": "Test VIP",
        "protocol_port": 80,
        "name": "test_vip"
      }
  load_balancer:
    type: OS::Neutron::LoadBalancer
    properties:
      protocol_port: 80
      pool_id: { get_resource: test_pool }
  launch_config:
    type: AWS::AutoScaling::LaunchConfiguration
    properties:
      ImageId: { get_param: image_id }
      InstanceType: { get_param: instance_type }
  server_group:
    type: AWS::AutoScaling::AutoScalingGroup
    properties:
      AvailabilityZones : ["nova"]
      LaunchConfigurationName : { get_resource : launch_config }
      VPCZoneIdentifier: [{ get_param: fixed_subnet }]
      MinSize : 1
      MaxSize : 5
      DesiredCapacity: { get_param: capacity }
      LoadBalancerNames : [ { get_resource : load_balancer } ]
