Manage AWS Application Load Balancer
New in version 2017.7.0.
Add and remove targets from an ALB target group.
This module uses boto3
, which can be installed via package, or pip.
This module accepts explicit alb 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 here.
If IAM roles are not used you need to specify them either in a pillar file or in the minion's config file:
elbv2.keyid: GKTADJGHEIQSXMKKRBJ08H
elbv2.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
elbv2.region: us-west-2
It's also possible to specify key
, keyid
and region
via a profile, either
passed in as a dict, or as a string to pull from pillars or minion config:
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
New in version 2017.11.0.
Create target group if not present.
(string) - The name of the target group.
(string) - The protocol to use for routing traffic to the targets
(int) - The port on which the targets receive traffic. This port is used unless you specify a port override when registering the traffic.
(string) - The identifier of the virtual private cloud (VPC).
(string) - The protocol the load balancer uses when performing health check on targets. The default is the HTTP protocol.
(string) - The port the load balancer uses when performing health checks on targets. The default is 'traffic-port', which indicates the port on which each target receives traffic from the load balancer.
(string) - The ping path that is the destination on the targets for health checks. The default is /.
(integer) - The approximate amount of time, in seconds, between health checks of an individual target. The default is 30 seconds.
(integer) - The amount of time, in seconds, during which no response from a target means a failed health check. The default is 5 seconds.
(integer) - The number of consecutive health checks successes required before considering an unhealthy target healthy. The default is 5.
(integer) - The number of consecutive health check failures required before considering a target unhealthy. The default is 2.
(bool) - True on success, False on failure.
CLI Example:
create-target:
boto_elb2.create_targets_group:
- name: myALB
- protocol: https
- port: 443
- vpc_id: myVPC
Delete target group.
(string) - The Amazon Resource Name (ARN) of the resource.
(bool) - True on success, False on failure.
CLI Example:
check-target:
boto_elb2.delete_targets_group:
- name: myALB
- protocol: https
- port: 443
- vpc_id: myVPC
Remove targets to an Application Load Balancer target group.
The ARN of the Application Load Balancer Target Group to remove targets from.
A list of target IDs or a string of a single target registered to the target group to be removed
New in version 2017.7.0.
remove-targets:
boto_elb.targets_deregistered:
- name: arn:myloadbalancer
- targets:
- instance-id1
- instance-id2
New in version 2017.7.0.
Add targets to an Application Load Balancer target group. This state will not remove targets.
The ARN of the Application Load Balancer Target Group to add targets to.
A list of target IDs or a string of a single target that this target group should distribute traffic to.
add-targets:
boto_elb.targets_registered:
- name: arn:myloadbalancer
- targets:
- instance-id1
- instance-id2