ec2_internet_gateway_info – List EC2 Internet Gateways

Retrieve information about AWS EC2 Internet Gateways.


- name: List all internet gateways in the region

- name: List only specific internet gateways
      - igw-13a244t23
      - igw-a862nf0sd

- name: List the internet gateway attached to a VPC
    vpc: vpc-2jdb5kd83fs


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 retrieving information about, or managing AWS resources, provided as key/value pairs.

Keys and values are case-sensitive.

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
vpc (optional)

ID of the VPC to which the internet gateway is attached.

type: str

Return Values

objects (success), list, )

A list of objects representing EC2 Internet Gateways.

id (always), str, igw-841b9271gd)

ID of the internet gateway

vpc (always), str, vpc-2w7hs924hs)

ID of the VPC the internet gateway is attached to, or None.

tags (always), dict, {‘environment’: ‘staging’, ‘Name’: ‘my-gateway’})

Tags associated with the internet gateway.