%PDF- %PDF-
| Direktori : /proc/thread-self/root/proc/self/root/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/thread-self/root/proc/self/root/lib/python2.7/site-packages/salt/states/boto_elbv2.pyo |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l m Z e j e
� Z d � Z d d d d d d d d d
d
d d � Z d d d d d
� Z d d d d d � Z d d d d d � Z d S( u`
Manage AWS Application Load Balancer
.. versionadded:: 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
<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 file or
in the minion's config file:
.. code-block:: yaml
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:
.. code-block:: yaml
myprofile:
keyid: GKTADJGHEIQSXMKKRBJ08H
key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
region: us-east-1
i ( t absolute_importt print_functiont unicode_literalsN( t sixc C@ s d t k r d St d f S( u)
Only load if boto is available.
u boto_elbv2.target_group_existsu
boto_elbv2u? The boto_elbv2 module cannot be loaded: boto3 library not found( t __salt__t False( ( ( s: /usr/lib/python2.7/site-packages/salt/states/boto_elbv2.pyt __virtual__1 s u HTTPu traffic-portu /i i i c K@ s3 i | d 6d d 6d d 6i d 6} t d | | | | | � r_ t | d <d j | � | d <| St d r� d j | � | d <| St d
| | | | d | d | d
| d | d | d | d |
d | d | d |
d | | �} | r| | d d <t | d <d j | � | d <n t | d <d j | � | d <| S( u�
.. versionadded:: 2017.11.0
Create target group if not present.
name
(string) - The name of the target group.
protocol
(string) - The protocol to use for routing traffic to the targets
port
(int) - The port on which the targets receive traffic. This port is used unless
you specify a port override when registering the traffic.
vpc_id
(string) - The identifier of the virtual private cloud (VPC).
health_check_protocol
(string) - The protocol the load balancer uses when performing health check on
targets. The default is the HTTP protocol.
health_check_port
(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.
health_check_path
(string) - The ping path that is the destination on the targets for health
checks. The default is /.
health_check_interval_seconds
(integer) - The approximate amount of time, in seconds, between health checks
of an individual target. The default is 30 seconds.
health_check_timeout_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.
healthy_threshold_count
(integer) - The number of consecutive health checks successes required before
considering an unhealthy target healthy. The default is 5.
unhealthy_threshold_count
(integer) - The number of consecutive health check failures required before
considering a target unhealthy. The default is 2.
returns
(bool) - True on success, False on failure.
CLI example:
.. code-block:: yaml
create-target:
boto_elb2.create_targets_group:
- name: myALB
- protocol: https
- port: 443
- vpc_id: myVPC
u nameu resultu u commentu changesu boto_elbv2.target_group_existsu Target Group {0} already existsu testu Target Group {0} will be createdu boto_elbv2.create_target_groupt regiont keyt keyidt profilet health_check_protocolt health_check_portt health_check_patht health_check_interval_secondst health_check_timeout_secondst healthy_threshold_countt unhealthy_threshold_countu target_groupu Target Group {0} createdu Target Group {0} creation failedN( t NoneR t Truet formatt __opts__R ( t namet protocolt portt vpc_idR R R R
R R R
R R R R t kwargst rett state( ( s: /usr/lib/python2.7/site-packages/salt/states/boto_elbv2.pyt create_target_group: s>