boto3_elb¶
Connection module for Amazon ELB (Classic) using boto3.¶
Renamed from
boto_elbtoboto3_elband rewritten to use the boto3elbclient APIs directly viasaltext.boto3.utils.boto3mod. The legacy boto2 code path (object-style access, retry loops) has been removed.
- depends:
boto3 >= 1.28.0
botocore >= 1.31.0
- configuration:
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 the minion’s config file or as a profile. For example, to specify them 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
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
Added in version 1.0.0.
- saltext.boto3.modules.boto3_elb.exists(name, region=None, key=None, keyid=None, profile=None)[source]¶
Check to see if an ELB exists.
- name (str):
The name of the load balancer to check for existence.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.exists myelb region=us-east-1
- saltext.boto3.modules.boto3_elb.get_all_elbs(region=None, key=None, keyid=None, profile=None)[source]¶
Return all load balancers associated with an account.
- region (str, optional):
The AWS region where the load balancers are located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.get_all_elbs region=us-east-1
- saltext.boto3.modules.boto3_elb.list_elbs(region=None, key=None, keyid=None, profile=None)[source]¶
Return names of all load balancers associated with an account.
- region (str, optional):
The AWS region where the load balancers are located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.list_elbs region=us-east-1
- saltext.boto3.modules.boto3_elb.get_elb_config(name, region=None, key=None, keyid=None, profile=None)[source]¶
Get an ELB configuration.
- name (str):
The name of the load balancer to get the configuration for.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.get_elb_config myelb region=us-east-1
- saltext.boto3.modules.boto3_elb.listener_dict_to_tuple(listener)[source]¶
Convert an ELB listener dict into a listener tuple used by certain parts of the AWS ELB API.
- listener (dict):
The listener dictionary to convert into a listener tuple.
Example:
{ "elb_port": 80, "instance_port": 80, "elb_protocol": "HTTP" }
CLI Example:
salt myminion boto3_elb.listener_dict_to_tuple '{"elb_port":80,"instance_port":80,"elb_protocol":"HTTP"}'
- saltext.boto3.modules.boto3_elb.create(name, availability_zones, listeners, subnets=None, security_groups=None, scheme='internet-facing', region=None, key=None, keyid=None, profile=None)[source]¶
Create an ELB.
- name (str):
The name of the load balancer to create.
- availability_zones (list):
A list of availability zones for the load balancer.
- listeners (list):
A list of listener dictionaries for the load balancer.
- subnets (list, optional):
A list of subnets for the load balancer.
- security_groups (list, optional):
A list of security groups for the load balancer.
- scheme (str, optional):
The scheme for the load balancer. Defaults to “internet-facing”.
- region (str, optional):
The AWS region where the load balancer will be created.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.create myelb '["us-east-1a"]' '[{"elb_port": 443, "elb_protocol": "HTTPS"}]'
- saltext.boto3.modules.boto3_elb.delete(name, region=None, key=None, keyid=None, profile=None)[source]¶
Delete an ELB.
- name (str):
The name of the load balancer to delete.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.delete myelb region=us-east-1
- saltext.boto3.modules.boto3_elb.create_listeners(name, listeners, region=None, key=None, keyid=None, profile=None)[source]¶
Create listeners on an ELB.
- name (str):
The name of the load balancer to create listeners on.
- listeners (list):
A list of listener dictionaries to create on the load balancer.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.create_listeners myelb '[{"elb_port":443,"instance_port":80,"elb_protocol":"HTTPS","certificate":"arn:..."}]'
- saltext.boto3.modules.boto3_elb.delete_listeners(name, ports, region=None, key=None, keyid=None, profile=None)[source]¶
Delete listeners on an ELB.
- name (str):
The name of the load balancer to delete listeners from.
- ports (list):
A list of ports corresponding to the listeners to delete.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.delete_listeners myelb '[80,443]'
- saltext.boto3.modules.boto3_elb.apply_security_groups(name, security_groups, region=None, key=None, keyid=None, profile=None)[source]¶
Apply security groups to an ELB.
- name (str):
The name of the load balancer to apply security groups to.
- security_groups (list):
A list of security groups to apply to the load balancer.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.apply_security_groups myelb '["mysecgroup1"]'
- saltext.boto3.modules.boto3_elb.enable_availability_zones(name, availability_zones, region=None, key=None, keyid=None, profile=None)[source]¶
Enable availability zones for ELB.
- name (str):
The name of the load balancer to enable availability zones for.
- availability_zones (list):
A list of availability zones to enable for the load balancer.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.enable_availability_zones myelb '["us-east-1a"]'
- saltext.boto3.modules.boto3_elb.disable_availability_zones(name, availability_zones, region=None, key=None, keyid=None, profile=None)[source]¶
Disable availability zones for an ELB.
- name (str):
The name of the load balancer to disable availability zones for.
- availability_zones (list):
A list of availability zones to disable for the load balancer.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.disable_availability_zones myelb '["us-east-1a"]'
- saltext.boto3.modules.boto3_elb.attach_subnets(name, subnets, region=None, key=None, keyid=None, profile=None)[source]¶
Attach an ELB to subnets.
- name (str):
The name of the load balancer to attach to subnets.
- subnets (list):
A list of subnets to attach the load balancer to.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.attach_subnets myelb '["mysubnet"]'
- saltext.boto3.modules.boto3_elb.detach_subnets(name, subnets, region=None, key=None, keyid=None, profile=None)[source]¶
Detach an ELB from subnets.
- name (str):
The name of the load balancer to detach from subnets.
- subnets (list):
A list of subnets to detach the load balancer from.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.detach_subnets myelb '["mysubnet"]'
- saltext.boto3.modules.boto3_elb.get_attributes(name, region=None, key=None, keyid=None, profile=None)[source]¶
Check to see if attributes are set on an ELB.
- name (str):
The name of the load balancer to check attributes for.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.get_attributes myelb
- saltext.boto3.modules.boto3_elb.set_attributes(name, attributes, region=None, key=None, keyid=None, profile=None)[source]¶
Set attributes on an ELB.
- name (str):
The name of the load balancer to set attributes for.
- attributes (dict):
A dictionary of attributes to set on the load balancer.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.set_attributes myelb '{"access_log": {"enabled": true, "s3_bucket_name": "mybucket"}}'
- saltext.boto3.modules.boto3_elb.get_health_check(name, region=None, key=None, keyid=None, profile=None)[source]¶
Get the health check configured for this ELB.
- name (str):
The name of the load balancer to get the health check for.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.get_health_check myelb
- saltext.boto3.modules.boto3_elb.set_health_check(name, health_check, region=None, key=None, keyid=None, profile=None)[source]¶
Set a health check on an ELB.
- name (str):
The name of the load balancer to set the health check for.
- health_check (dict):
A dictionary representing the health check configuration.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.set_health_check myelb '{"target": "HTTP:80/"}'
- saltext.boto3.modules.boto3_elb.register_instances(name, instances, region=None, key=None, keyid=None, profile=None)[source]¶
Register instances with an ELB.
- name (str):
The name of the load balancer to register instances with.
- instances (list):
A list of instance IDs to register with the load balancer.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.register_instances myelb instance_id
- saltext.boto3.modules.boto3_elb.deregister_instances(name, instances, region=None, key=None, keyid=None, profile=None)[source]¶
Deregister instances with an ELB.
- name (str):
The name of the load balancer to deregister instances from.
- instances (list):
A list of instance IDs to deregister from the load balancer.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.deregister_instances myelb instance_id
- saltext.boto3.modules.boto3_elb.set_instances(name, instances, test=False, region=None, key=None, keyid=None, profile=None)[source]¶
Set the instances assigned to an ELB to exactly the list given.
- name (str):
The name of the load balancer to set instances for.
- instances (list):
A list of instance IDs to assign to the load balancer.
- test (bool, optional):
If True, only test what changes would be made without actually making them.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.set_instances myelb region=us-east-1 instances="[instance_id,instance_id]"
- saltext.boto3.modules.boto3_elb.get_instance_health(name, region=None, key=None, keyid=None, profile=None, instances=None)[source]¶
Get a list of instances and their health state.
- name (str):
The name of the load balancer to get the health state for.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
- instances (list, optional):
A list of instance IDs to get the health state for. If not provided, all instances are returned.
CLI Example:
salt myminion boto3_elb.get_instance_health myelb
- saltext.boto3.modules.boto3_elb.create_policy(name, policy_name, policy_type, policy, region=None, key=None, keyid=None, profile=None)[source]¶
Create an ELB policy.
- name (str):
The name of the load balancer to create the policy for.
- policy_name (str):
The name of the policy to create.
- policy_type (str):
The type of the policy to create.
- policy (dict):
A dictionary representing the policy attributes.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.create_policy myelb mypolicy LBCookieStickinessPolicyType '{"CookieExpirationPeriod": 3600}'
- saltext.boto3.modules.boto3_elb.delete_policy(name, policy_name, region=None, key=None, keyid=None, profile=None)[source]¶
Delete an ELB policy.
- name (str):
The name of the load balancer to delete the policy from.
- policy_name (str):
The name of the policy to delete.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.delete_policy myelb mypolicy
- saltext.boto3.modules.boto3_elb.set_listener_policy(name, port, policies=None, region=None, key=None, keyid=None, profile=None)[source]¶
Set the policies of an ELB listener.
- name (str):
The name of the load balancer to set the listener policies for.
- port (int):
The port of the listener to set the policies for.
- policies (list, optional):
A list of policy names to set on the listener.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.set_listener_policy myelb 443 "[policy1,policy2]"
- saltext.boto3.modules.boto3_elb.set_backend_policy(name, port, policies=None, region=None, key=None, keyid=None, profile=None)[source]¶
Set the policies of an ELB backend server.
- name (str):
The name of the load balancer to set the backend server policies for.
- port (int):
The port of the backend server to set the policies for.
- policies (list, optional):
A list of policy names to set on the backend server.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.set_backend_policy myelb 443 "[policy1,policy2]"
- saltext.boto3.modules.boto3_elb.set_tags(name, tags, region=None, key=None, keyid=None, profile=None)[source]¶
Add tags on an ELB.
- name (str):
The name of the load balancer to add tags to.
- tags (dict):
A dictionary of tags to add to the load balancer.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.set_tags my-elb-name "{'Tag1': 'Value', 'Tag2': 'Another Value'}"
- saltext.boto3.modules.boto3_elb.delete_tags(name, tags, region=None, key=None, keyid=None, profile=None)[source]¶
Delete tags on an ELB.
- name (str):
The name of the load balancer to delete tags from.
- tags (list):
A list of tag keys to delete from the load balancer.
- region (str, optional):
The AWS region where the load balancer is located.
- key (str, optional):
The AWS secret access key.
- keyid (str, optional):
The AWS access key ID.
- profile (str, optional):
The profile to use for AWS credentials.
CLI Example:
salt myminion boto3_elb.delete_tags my-elb-name ['TagToRemove1', 'TagToRemove2']