Skip to content

Commit

Permalink
[promoted]ec2_vpc_igw (_info) - documentation improvement (ansible-co…
Browse files Browse the repository at this point in the history
…llections#495)

* * ec2_vpc_igw (_info) - documentation improvement

Signed-off-by: Alina Buzachis <[email protected]>

* Whitespace linting

Co-authored-by: Mark Chappell <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@1a0c20c
  • Loading branch information
alinabuzachis and tremble authored Mar 24, 2021
1 parent 129efbf commit 3c994a5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 23 deletions.
17 changes: 16 additions & 1 deletion plugins/modules/ec2_vpc_igw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '''
Expand Down
54 changes: 32 additions & 22 deletions plugins/modules/ec2_vpc_igw_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3c994a5

Please sign in to comment.