ec2_network_interface_info – List EC2 Elastic Network Interfaces.¶
Retrieve information about AWS EC2 Elastic Network Interfaces.
Examples¶
- name: List all network interfaces
ec2_network_interface_info:
register: result
- name: Get information for a specific network interface by name
ec2_network_interface_info:
names: my-first-network-interface
register: result
- name: List information for multiple network interfaces by their IDs
ec2_network_interface_info:
ids:
- eni-fce81a6
- eni-47bga99
register: result
- name: Use a complex filter for network interfaces
ec2_network_interface_info:
subnet: subnet-d56a1e85
filters:
association.public-ip: 192.0.2.59
register: result
See Also¶
Parameters¶
- auth (optional)
Parameters for authenticating with the AWS service. Each of them may be defined via environment variables.
type: dict- access_key (optional)
The AWS access key ID. If not set, the value of the AWS_ACCESS_KEY environment variable will be checked.
Mutually exclusive with profile.
type: str- profile (optional)
The name of the AWS profile configured with
aws configure
.Can be used instead of explicitly specifying your access credentials and region.
Use
default
to use the default profile.Mutually exclusive with access_key and secret_key.
type: str- region (optional)
The name of the AWS region.
If not set, the value of the AWS_REGION environment variable will be checked.
If you set a profile that specifies a default region, that region is used and you can omit this parameter. Use this parameter to override the profile’s default region.
type: str- secret_key (optional)
The AWS secret access key. If not set, the value of the AWS_SECRET_KEY environment variable will be checked.
Mutually exclusive with profile.
type: str- url (optional)
The URL to the AWS service related to the resource. By default, this is automatically determined through the region parameter.
If not set explicitly, the value of the AWS_<SERVICE>_URL environment variable will be used.
The services currently supported are EC2 and S3.
type: str
- filters (optional)
Filters to use when querying AWS resources. They must be provided as key/value pairs.
Keys and values are case-sensitive and must be strings.
Each key can have multiple values, provided as a list. Within these values, any value must match for the AWS resource to be included.
When multiple filters are provided, the result contains AWS resources matching all of them.
If a filter is specified in
filters
and also in another top-level parameter, the filter in the top-level parameter has precedence. The two are not merged.If a module accepts a top-level parameter for querying the AWS resources, and you also specify the filter it corresponds to via
filters
, the top-level parameter has precedence.type: dict- ids (optional)
Perform the operation for the specified resources.
type: list- names (optional)
Limit the results to the resources with specified names.
type: list- subnet (optional)
The ID of a subnet.
May be used to limit the results to network interfaces in the specified subnet.
type: str
Return Values¶
- objects (success), list, {‘objects’: [{‘id’: ‘eni-ba546d69’, ‘description’: ‘My First Elastic Network Interface.’, ‘subnet’: ‘subnet-faff387’, ‘security_groups’: [‘sg-1’], ‘type’: ‘normal’, ‘tags’: {‘Name’: ‘myfirsteni’}, ‘mac_address’: ‘00:05:B0:E9:E7:D0’, ‘attachment’: {‘instance’: ‘i-b856a2857fadfa’, ‘device_index’: 0, ‘keep_on_termination’: False}, ‘public_ip’: None, ‘ip’: ‘192.0.2.58’, ‘source_dest_check’: True}]}
A list of objects representing EC2 network interfaces.
- id (always), str,
The ID of the network interface
- description (always), str,
The description of the network interface, if any.
- subnet (always), str,
The ID of the subnet this network interface is assigned to.
- security_groups (always), list,
The IDs of security groups assigned to this network interface. At least one.
- type (always), str,
The type of this network interface.
- tags (always), dict,
The tags assigned to this network interface.
- mac_address (always), str,
The MAC address of this network interface.
- attachment (when I(state=attached)), dict,
The attachment to an instance, if any.
- instance (always), str,
The ID of the instance the network interface is attached to.
- device_index (always), str,
The hardware device index the network interface is attached to.
- keep_on_termination (always), str,
Whether the network interface is preserved when terminating the instance.
- public_ip (always), str,
The public IPv4 address or the VPC address (Elastic IP) associated with this network interface, if any.
- ip (always), str,
The primary private IPv4 address assigned to this network interface.
- source_dest_check (always), bool,
Whether source-destination checking is enabled for this network interface.