Connection module for Amazon ELB
New in version 2014.7.0.
This module accepts explicit elb credentials but can also utilize IAM roles assigned to the instance through 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
boto >= 2.33.0
Apply security groups to ELB.
CLI Example:
salt myminion boto_elb.apply_security_groups myelb '["mysecgroup1"]'
Attach ELB to subnets.
CLI Example:
salt myminion boto_elb.attach_subnets myelb '["mysubnet"]'
Create an ELB
CLI example to create an ELB:
salt myminion boto_elb.create myelb '["us-east-1a", "us-east-1e"]' '{"elb_port": 443, "elb_protocol": "HTTPS", ...}' region=us-east-1
Create listeners on an ELB.
CLI Example:
salt myminion boto_elb.create_listeners myelb '[["HTTPS", "HTTP", 443, 80, "arn:aws:iam::11 11111:server-certificate/mycert"]]'
Create an ELB policy.
New in version 2016.3.0.
CLI Example:
salt myminion boto_elb.create_policy myelb mypolicy LBCookieStickinessPolicyType '{"CookieExpirationPeriod": 3600}'
Delete an ELB.
CLI example to delete an ELB:
salt myminion boto_elb.delete myelb region=us-east-1
Delete listeners on an ELB.
CLI Example:
salt myminion boto_elb.delete_listeners myelb '[80,443]'
Delete an ELB policy.
New in version 2016.3.0.
CLI Example:
salt myminion boto_elb.delete_policy myelb mypolicy
Add the tags on an ELB
name of the ELB
list of tags to remove
CLI Example:
salt myminion boto_elb.delete_tags my-elb-name ['TagToRemove1', 'TagToRemove2']
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]"
Detach ELB from subnets.
CLI Example:
salt myminion boto_elb.detach_subnets myelb '["mysubnet"]'
Disable availability zones for ELB.
CLI Example:
salt myminion boto_elb.disable_availability_zones myelb '["us-east-1a"]'
Enable availability zones for ELB.
CLI Example:
salt myminion boto_elb.enable_availability_zones myelb '["us-east-1a"]'
Check to see if an ELB exists.
CLI Example:
salt myminion boto_elb.exists myelb region=us-east-1
Return all load balancers associated with an account
CLI Example:
salt myminion boto_elb.get_all_elbs region=us-east-1
Check to see if attributes are set on an ELB.
CLI Example:
salt myminion boto_elb.get_attributes myelb
Get an ELB configuration.
CLI Example:
salt myminion boto_elb.exists myelb region=us-east-1
Get the health check configured for this ELB.
CLI Example:
salt myminion boto_elb.get_health_check myelb
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]"
Return names of all load balancers associated with an account
CLI Example:
salt myminion boto_elb.list_elbs region=us-east-1
Convert an ELB listener dict into a listener tuple used by certain parts of the AWS ELB API.
CLI Example:
salt myminion boto_elb.listener_dict_to_tuple '{"elb_port":80,"instance_port":80,"elb_protocol":"HTTP"}'
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]"
Set attributes on an ELB.
Name of the ELB instance to set attributes for
A dict of attributes to set.
Valid attributes are:
Enable storage of access logs.
The name of the S3 bucket to place logs.
Prefix for the log file name.
Interval for storing logs in S3 in minutes. Valid values are 5 and 60.
Enable connection draining.
Maximum allowed time in seconds for sending existing connections to an instance that is deregistering or unhealthy. Default is 300.
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
Set the policies of an ELB backend server.
CLI Example:
salt myminion boto_elb.set_backend_policy myelb 443 "[policy1,policy2]"
Set attributes on an ELB.
CLI example to set attributes on an ELB:
salt myminion boto_elb.set_health_check myelb '{"target": "HTTP:80/"}'
Set the instances assigned to an ELB to exactly the list given
CLI Example:
salt myminion boto_elb.set_instances myelb region=us-east-1 instances="[instance_id,instance_id]"
Set the policies of an ELB listener.
New in version 2016.3.0.
CLI Example:
salt myminion boto_elb.set_listener_policy myelb 443 "[policy1,policy2]"
Add the tags on an ELB
New in version 2016.3.0.
name of the ELB
dict of name/value pair tags
CLI Example:
salt myminion boto_elb.set_tags my-elb-name "{'Tag1': 'Value', 'Tag2': 'Another Value'}"