mardi 2 juin 2015

Creating load balancer in AWS using Chef provisioning

I am trying to create a load balancer in AWS. I already have the machine created and the machine's node file is in my nodes folder. I keep getting an error asking me to enter the instance id of the machine. I thought the whole point of using chef provisioning was to be able to use the name of the machine to be able to use it and not have to use it's instance ID. My code is as follows:

require 'chef/provisioning'  # driver for creating machines

provisioner = get_setting("CHEF_PROFILE", "abcd-environments")

require "chef/provisioning/aws_driver"

with_driver "aws:abcd-environments"

load_balancer 'test-elb-from-prov' do

  driver "aws:abcd-environments"
  machines ['webappsadm001.da.abcd']
  load_balancer_options   availability_zones: ['us-east-1b'],
  listeners: [{
    # required
    protocol: :http,
    # required
    port: 80,
    instance_protocol: :http,
    # required
    instance_port: 10262,
    }],
  subnets: ['subnet-37ce3a1c'],

    health_check:
    [{
      target: "TCP:10262",
      interval: 30,
      timeout: 5,
      unhealthy_threshold: 2,
      healthy_threshold: 10
    }]

end

The log is as follows:

 ================================================================================
    Error executing action `create` on resource 'load_balancer[test-elb-from-prov]'
    ================================================================================

    AWS::Core::OptionGrammar::FormatError
    -------------------------------------
    expected string value for key instance_id of member 1 of option instances




Aucun commentaire:

Enregistrer un commentaire