salt.modules.boto_elb

Connection module for Amazon ELB

New in version 2014.7.0.

configuration:

This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance trough Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

If IAM roles are not used you need to specify them either in a pillar or in the minion's config file:

elb.keyid: GKTADJGHEIQSXMKKRBJ08H
elb.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

A region may also be specified in the configuration:

elb.region: us-east-1

If a region is not specified, the default is us-east-1.

It's also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:

myprofile:

keyid: GKTADJGHEIQSXMKKRBJ08H key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs region: us-east-1

depends:

boto

salt.modules.boto_elb.attach_subnets(name, subnets, region=None, key=None, keyid=None, profile=None)

Attach ELB to subnets.

CLI example:

salt myminion boto_elb.attach_subnets myelb '["mysubnet"]'
salt.modules.boto_elb.create(name, availability_zones, listeners=None, subnets=None, security_groups=None, scheme='internet-facing', region=None, key=None, keyid=None, profile=None)

Create an ELB

CLI example to create an ELB:

salt myminion boto_elb.create myelb '["us-east-1a", "us-east-1e"]' listeners='[["HTTPS", "HTTP", 443, 80, "arn:aws:iam::1111111:server-certificate/mycert"]]' region=us-east-1
salt.modules.boto_elb.create_listeners(name, listeners=None, region=None, key=None, keyid=None, profile=None)

Create listeners on an ELB.

CLI example:

salt myminion boto_elb.create_listeners myelb listeners='[["HTTPS", "HTTP", 443, 80, "arn:aws:iam::11  11111:server-certificate/mycert"]]'
salt.modules.boto_elb.delete(name, region=None, key=None, keyid=None, profile=None)

Delete an ELB.

CLI example to delete an ELB:

salt myminion boto_elb.delete myelb region=us-east-1
salt.modules.boto_elb.delete_listeners(name, ports, region=None, key=None, keyid=None, profile=None)

Delete listeners on an ELB.

CLI example:

salt myminion boto_elb.delete_listeners myelb '[80,443]'
salt.modules.boto_elb.deregister_instances(name, instances, region=None, key=None, keyid=None, profile=None)

Deregister instances with an ELB. Instances is either a string instance id or a list of string instance id's.

Returns:

  • True: instance(s) deregistered successfully
  • False: instance(s) failed to be deregistered
  • None: instance(s) not valid or not registered, no action taken

CLI example:

salt myminion boto_elb.deregister_instances myelb instance_id
salt myminion boto_elb.deregister_instances myelb "[instance_id, instance_id]"
salt.modules.boto_elb.detach_subnets(name, subnets, region=None, key=None, keyid=None, profile=None)

Detach ELB from subnets.

CLI example:

salt myminion boto_elb.detach_subnets myelb '["mysubnet"]'
salt.modules.boto_elb.disable_availability_zones(name, availability_zones, region=None, key=None, keyid=None, profile=None)

Disable availability zones for ELB.

CLI example:

salt myminion boto_elb.disable_availability_zones myelb '["us-east-1a"]'
salt.modules.boto_elb.enable_availability_zones(name, availability_zones, region=None, key=None, keyid=None, profile=None)

Enable availability zones for ELB.

CLI example:

salt myminion boto_elb.enable_availability_zones myelb '["us-east-1a"]'
salt.modules.boto_elb.exists(name, region=None, key=None, keyid=None, profile=None)

Check to see if an ELB exists.

CLI example:

salt myminion boto_elb.exists myelb region=us-east-1
salt.modules.boto_elb.get_attributes(name, region=None, key=None, keyid=None, profile=None)

Check to see if attributes are set on an ELB.

CLI example:

salt myminion boto_elb.get_attributes myelb
salt.modules.boto_elb.get_elb_config(name, region=None, key=None, keyid=None, profile=None)

Check to see if an ELB exists.

CLI example:

salt myminion boto_elb.exists myelb region=us-east-1
salt.modules.boto_elb.get_health_check(name, region=None, key=None, keyid=None, profile=None)

Get the health check configured for this ELB.

CLI example:

salt myminion boto_elb.get_health_check myelb
salt.modules.boto_elb.get_instance_health(name, region=None, key=None, keyid=None, profile=None, instances=None)

Get a list of instances and their health state

CLI example:

salt myminion boto_elb.get_instance_health myelb
salt myminion boto_elb.get_instance_health myelb region=us-east-1 instances="[instance_id,instance_id]"
salt.modules.boto_elb.register_instances(name, instances, region=None, key=None, keyid=None, profile=None)

Register instances with an ELB. Instances is either a string instance id or a list of string instance id's.

Returns:

  • True: instance(s) registered successfully
  • False: instance(s) failed to be registered

CLI example:

salt myminion boto_elb.register_instances myelb instance_id
salt myminion boto_elb.register_instances myelb "[instance_id,instance_id]"
salt.modules.boto_elb.set_attributes(name, attributes, region=None, key=None, keyid=None, profile=None)

Set attributes on an ELB.

name (string)
Name of the ELB instance to set attributes for
attributes

A dict of attributes to set.

Valid attributes are:

access_log (dict)
enabled (bool)
Enable storage of access logs.
s3_bucket_name (string)
The name of the S3 bucket to place logs.
s3_bucket_prefix (string)
Prefix for the log file name.
emit_interval (int)
Interval for storing logs in S3 in minutes. Valid values are 5 and 60.
connection_draining (dict)
enabled (bool)
Enable connection draining.
timeout (int)
Maximum allowed time in seconds for sending existing connections to an instance that is deregistering or unhealthy. Default is 300.
cross_zone_load_balancing (dict)
enabled (bool)
Enable cross-zone load balancing.

CLI example to set attributes on an ELB:

salt myminion boto_elb.set_attributes myelb '{"access_log": {"enabled": "true", "s3_bucket_name": "mybucket", "s3_bucket_prefix": "mylogs/", "emit_interval": "5"}}' region=us-east-1
salt.modules.boto_elb.set_health_check(name, health_check, region=None, key=None, keyid=None, profile=None)

Set attributes on an ELB.

CLI example to set attributes on an ELB:

salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}'