Documentation

ali_eip_facts - Gather facts about Elastic IP addresses in Alibaba Cloud

New in version 2.8.

Synopsis

  • Gather facts about Elastic IP addresses in Alibaba Cloud

Requirements

The below requirements are needed on the host that executes this module.

  • footmark >= 1.9.0
  • python >= 2.6

Parameters

Parameter Choices/Defaults Comments
alicloud_access_key
Aliyun Cloud access key. If not set then the value of environment variable ALICLOUD_ACCESS_KEY, ALICLOUD_ACCESS_KEY_ID will be used instead.

aliases: access_key_id, access_key
alicloud_region
The Aliyun Cloud region to use. If not specified then the value of environment variable ALICLOUD_REGION, ALICLOUD_REGION_ID will be used instead.

aliases: region, region_id
alicloud_secret_key
Aliyun Cloud secret key. If not set then the value of environment variable ALICLOUD_SECRET_KEY, ALICLOUD_SECRET_ACCESS_KEY will be used instead.

aliases: secret_access_key, secret_key
alicloud_security_token
The Aliyun Cloud security token. If not specified then the value of environment variable ALICLOUD_SECURITY_TOKEN will be used instead.

aliases: security_token
eip_ids
A list of EIP IDs that exist in your account.

aliases: ids
filters
A dict of filters to apply. Each dict item consists of a filter key and a filter value. The filter keys can be all of request parameters. See https://www.alibabacloud.com/help/doc-detail/36018.htm for parameter details. Filter keys can be same as request parameter name or be lower case and use underscore ("_") or dashes ("-") to connect different words in one parameter. 'AllocationId' will be appended to eip_ids automatically.
ip_address_prefix
Use a ip address prefix to filter EIPs.

aliases: ip_prefix
name_prefix
Use a name prefix to filter EIPs.

Notes

Note

  • If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence ALICLOUD_ACCESS_KEY or ALICLOUD_ACCESS_KEY_ID, ALICLOUD_SECRET_KEY or ALICLOUD_SECRET_ACCESS_KEY, ALICLOUD_REGION or ALICLOUD_REGION_ID, ALICLOUD_SECURITY_TOKEN
  • ALICLOUD_REGION or ALICLOUD_REGION_ID can be typically be used to specify the ALICLOUD region, when required, but this can also be configured in the footmark config file

Examples

# Note: These examples do not set authentication details, see the Alibaba Cloud Guide for details.

# Gather facts about all EIPs
- ali_eip_facts:

# Gather facts about a particular EIP
- ali_eip_facts:
    eip_ids:
      - eip-xxxxxxx
      - eip-yyyyyyy
    filters:
      status: Available

# Gather facts about a particular EIP
- ali_eip_facts:
    filters:
      associated_instance_type: EcsInstance

# Gather facts based on ip_address_prefix
- ali_eip_facts:
    ip_address_prefix: 72.16

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
eips
complex
always
List of matching elastic ip addresses

  charge_type
string
always
The eip charge type.

Sample:
PostPaid
  allocation_time
string
always
The time the EIP was created

Sample:
2018-12-31T12:12:52Z
  description
string
always
interface description

Sample:
My new EIP
  allocation_id
string
always
The EIP id

Sample:
eip-2zee1nu68juox4
  internet_charge_type
string
always
The EIP charge type.

Sample:
PayByTraffic
  tags
dict
always
Any tags assigned to the EIP.

  instance_id
string
always
Associated instance id

Sample:
i-123456
  instance_type
string
always
Associated instance type

Sample:
EcsInstance
  bandwidth
int
always
Maximum bandwidth from the internet network

Sample:
5
  status
string
always
The EIP status

Sample:
inuse
  instance_region_id
string
always
The region id in which the associated instance

Sample:
cn-beijing
  ip_address
string
always
The IP address of the EIP

Sample:
39.96.169.143
  id
string
always
Allocated EIP id (alias for allocation_id)

Sample:
eip-2zee1nu68juox4
  name
string
always
The EIP name

Sample:
from-ansible
ids
list
always
List of elastic ip address IDs

Sample:
['eip-12345er', 'eip-3245fs']


Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Author

  • He Guimin (@xiaozhu36)

Hint

If you notice any issues in this documentation you can edit this document to improve it.