diff --git a/plugins/modules/ec2_vpc_igw.py b/plugins/modules/ec2_vpc_igw.py index bef92a71fcf..0d649d2131c 100644 --- a/plugins/modules/ec2_vpc_igw.py +++ b/plugins/modules/ec2_vpc_igw.py @@ -52,11 +52,26 @@ # Ensure that the VPC has an Internet Gateway. # The Internet Gateway ID is can be accessed via {{igw.gateway_id}} for use in setting up NATs etc. -- community.aws.ec2_vpc_igw: +- name: Create Internet gateway + community.aws.ec2_vpc_igw: vpc_id: vpc-abcdefgh state: present register: igw +- name: Create Internet gateway with tags + community.aws.ec2_vpc_igw: + vpc_id: vpc-abcdefgh + state: present + tags: + Tag1: tag1 + Tag2: tag2 + register: igw + +- name: Delete Internet gateway + community.aws.ec2_vpc_igw: + state: absent + vpc_id: vpc-abcdefgh + register: vpc_igw_delete ''' RETURN = ''' diff --git a/plugins/modules/ec2_vpc_igw_info.py b/plugins/modules/ec2_vpc_igw_info.py index ab7d26a80b4..17e5cc805ae 100644 --- a/plugins/modules/ec2_vpc_igw_info.py +++ b/plugins/modules/ec2_vpc_igw_info.py @@ -65,33 +65,43 @@ ''' RETURN = r''' -internet_gateways: - description: The internet gateways for the account. - returned: always - type: list - sample: [ - { - "attachments": [ - { - "state": "available", - "vpc_id": "vpc-02123b67" - } - ], - "internet_gateway_id": "igw-2123634d", - "tags": [ - { - "key": "Name", - "value": "test-vpc-20-igw" - } - ] - } - ] - changed: description: True if listing the internet gateways succeeds. type: bool returned: always sample: "false" +internet_gateways: + description: The internet gateways for the account. + returned: always + type: complex + contains: + attachments: + description: Any VPCs attached to the internet gateway + returned: I(state=present) + type: complex + contains: + state: + description: The current state of the attachment + returned: I(state=present) + type: str + sample: available + vpc_id: + description: The ID of the VPC. + returned: I(state=present) + type: str + sample: vpc-02123b67 + internet_gateway_id: + description: The ID of the internet gateway + returned: I(state=present) + type: str + sample: igw-2123634d + tags: + description: Any tags assigned to the internet gateway + returned: I(state=present) + type: dict + sample: + tags: + "Ansible": "Test" ''' try: