Skip to content

Commit

Permalink
Update Examples with FQCN (ansible-collections#67)
Browse files Browse the repository at this point in the history
Updated module examples with FQCN

Signed-off-by: Abhijeet Kasurde <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@98173ae
  • Loading branch information
Akasurde authored and goneri committed Jun 25, 2021
1 parent e856584 commit cfc3f86
Show file tree
Hide file tree
Showing 17 changed files with 87 additions and 87 deletions.
8 changes: 4 additions & 4 deletions plugins/modules/ec2_vpc_egress_igw.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
# Ensure that the VPC has an Internet Gateway.
# The Internet Gateway ID is can be accessed via {{eigw.gateway_id}} for use in setting up NATs etc.
ec2_vpc_egress_igw:
vpc_id: vpc-abcdefgh
state: present
register: eigw
- community.aws.ec2_vpc_egress_igw:
vpc_id: vpc-abcdefgh
state: present
register: eigw
'''

Expand Down
10 changes: 5 additions & 5 deletions plugins/modules/ec2_vpc_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
type: str
service:
description:
- An AWS supported vpc endpoint service. Use the M(ec2_vpc_endpoint_info)
- An AWS supported vpc endpoint service. Use the M(community.aws.ec2_vpc_endpoint_info)
module to describe the supported endpoint services.
- Required when creating an endpoint.
required: false
Expand Down Expand Up @@ -99,7 +99,7 @@
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Create new vpc endpoint with a json template for policy
ec2_vpc_endpoint:
community.aws.ec2_vpc_endpoint:
state: present
region: ap-southeast-2
vpc_id: vpc-12345678
Expand All @@ -111,7 +111,7 @@
register: new_vpc_endpoint
- name: Create new vpc endpoint with the default policy
ec2_vpc_endpoint:
community.aws.ec2_vpc_endpoint:
state: present
region: ap-southeast-2
vpc_id: vpc-12345678
Expand All @@ -122,7 +122,7 @@
register: new_vpc_endpoint
- name: Create new vpc endpoint with json file
ec2_vpc_endpoint:
community.aws.ec2_vpc_endpoint:
state: present
region: ap-southeast-2
vpc_id: vpc-12345678
Expand All @@ -134,7 +134,7 @@
register: new_vpc_endpoint
- name: Delete newly created vpc endpoint
ec2_vpc_endpoint:
community.aws.ec2_vpc_endpoint:
state: absent
vpc_endpoint_id: "{{ new_vpc_endpoint.result['VpcEndpointId'] }}"
region: ap-southeast-2
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/ec2_vpc_endpoint_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@
EXAMPLES = '''
# Simple example of listing all support AWS services for VPC endpoints
- name: List supported AWS endpoint services
ec2_vpc_endpoint_info:
community.aws.ec2_vpc_endpoint_info:
query: services
region: ap-southeast-2
register: supported_endpoint_services
- name: Get all endpoints in ap-southeast-2 region
ec2_vpc_endpoint_info:
community.aws.ec2_vpc_endpoint_info:
query: endpoints
region: ap-southeast-2
register: existing_endpoints
- name: Get all endpoints with specific filters
ec2_vpc_endpoint_info:
community.aws.ec2_vpc_endpoint_info:
query: endpoints
region: ap-southeast-2
filters:
Expand All @@ -68,7 +68,7 @@
register: existing_endpoints
- name: Get details on specific endpoint
ec2_vpc_endpoint_info:
community.aws.ec2_vpc_endpoint_info:
query: endpoints
region: ap-southeast-2
vpc_endpoint_ids:
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/ec2_vpc_igw.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
# 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.
ec2_vpc_igw:
vpc_id: vpc-abcdefgh
state: present
register: igw
- community.aws.ec2_vpc_igw:
vpc_id: vpc-abcdefgh
state: present
register: igw
'''

Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/ec2_vpc_igw_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@
# # Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Gather information about all Internet Gateways for an account or profile
ec2_vpc_igw_info:
community.aws.ec2_vpc_igw_info:
region: ap-southeast-2
profile: production
register: igw_info
- name: Gather information about a filtered list of Internet Gateways
ec2_vpc_igw_info:
community.aws.ec2_vpc_igw_info:
region: ap-southeast-2
profile: production
filters:
"tag:Name": "igw-123"
register: igw_info
- name: Gather information about a specific internet gateway by InternetGatewayId
ec2_vpc_igw_info:
community.aws.ec2_vpc_igw_info:
region: ap-southeast-2
profile: production
internet_gateway_ids: igw-c1231234
Expand Down
10 changes: 5 additions & 5 deletions plugins/modules/ec2_vpc_nacl.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
# Complete example to create and delete a network ACL
# that allows SSH, HTTP and ICMP in, and all traffic out.
- name: "Create and associate production DMZ network ACL with DMZ subnets"
ec2_vpc_nacl:
community.aws.ec2_vpc_nacl:
vpc_id: vpc-12345678
name: prod-dmz-nacl
region: ap-southeast-2
Expand All @@ -106,7 +106,7 @@
state: 'present'
- name: "Remove the ingress and egress rules - defaults to deny all"
ec2_vpc_nacl:
community.aws.ec2_vpc_nacl:
vpc_id: vpc-12345678
name: prod-dmz-nacl
region: ap-southeast-2
Expand All @@ -120,20 +120,20 @@
state: present
- name: "Remove the NACL subnet associations and tags"
ec2_vpc_nacl:
community.aws.ec2_vpc_nacl:
vpc_id: 'vpc-12345678'
name: prod-dmz-nacl
region: ap-southeast-2
state: present
- name: "Delete nacl and subnet associations"
ec2_vpc_nacl:
community.aws.ec2_vpc_nacl:
vpc_id: vpc-12345678
name: prod-dmz-nacl
state: absent
- name: "Delete nacl by its id"
ec2_vpc_nacl:
community.aws.ec2_vpc_nacl:
nacl_id: acl-33b4ee5b
state: absent
'''
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/ec2_vpc_nacl_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@
# Gather information about all Network ACLs:
- name: Get All NACLs
register: all_nacls
ec2_vpc_nacl_info:
community.aws.ec2_vpc_nacl_info:
region: us-west-2
register: all_nacls
# Retrieve default Network ACLs:
- name: Get Default NACLs
register: default_nacls
ec2_vpc_nacl_info:
community.aws.ec2_vpc_nacl_info:
region: us-west-2
filters:
'default': 'true'
register: default_nacls
'''

RETURN = '''
Expand Down
16 changes: 8 additions & 8 deletions plugins/modules/ec2_vpc_nat_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Create new nat gateway with client token.
ec2_vpc_nat_gateway:
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
eip_address: 52.1.1.1
Expand All @@ -93,15 +93,15 @@
register: new_nat_gateway
- name: Create new nat gateway using an allocation-id.
ec2_vpc_nat_gateway:
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
allocation_id: eipalloc-12345678
region: ap-southeast-2
register: new_nat_gateway
- name: Create new nat gateway, using an EIP address and wait for available status.
ec2_vpc_nat_gateway:
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
eip_address: 52.1.1.1
Expand All @@ -110,15 +110,15 @@
register: new_nat_gateway
- name: Create new nat gateway and allocate new EIP.
ec2_vpc_nat_gateway:
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
wait: true
region: ap-southeast-2
register: new_nat_gateway
- name: Create new nat gateway and allocate new EIP if a nat gateway does not yet exist in the subnet.
ec2_vpc_nat_gateway:
community.aws.ec2_vpc_nat_gateway:
state: present
subnet_id: subnet-12345678
wait: true
Expand All @@ -127,7 +127,7 @@
register: new_nat_gateway
- name: Delete nat gateway using discovered nat gateways from facts module.
ec2_vpc_nat_gateway:
community.aws.ec2_vpc_nat_gateway:
state: absent
region: ap-southeast-2
wait: true
Expand All @@ -137,15 +137,15 @@
loop: "{{ gateways_to_remove.result }}"
- name: Delete nat gateway and wait for deleted status.
ec2_vpc_nat_gateway:
community.aws.ec2_vpc_nat_gateway:
state: absent
nat_gateway_id: nat-12345678
wait: true
wait_timeout: 500
region: ap-southeast-2
- name: Delete nat gateway and release EIP.
ec2_vpc_nat_gateway:
community.aws.ec2_vpc_nat_gateway:
state: absent
nat_gateway_id: nat-12345678
release_eip: true
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/ec2_vpc_nat_gateway_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
EXAMPLES = '''
# Simple example of listing all nat gateways
- name: List all managed nat gateways in ap-southeast-2
ec2_vpc_nat_gateway_info:
community.aws.ec2_vpc_nat_gateway_info:
region: ap-southeast-2
register: all_ngws
Expand All @@ -44,22 +44,22 @@
msg: "{{ all_ngws.result }}"
- name: Get details on specific nat gateways
ec2_vpc_nat_gateway_info:
community.aws.ec2_vpc_nat_gateway_info:
nat_gateway_ids:
- nat-1234567891234567
- nat-7654321987654321
region: ap-southeast-2
register: specific_ngws
- name: Get all nat gateways with specific filters
ec2_vpc_nat_gateway_info:
community.aws.ec2_vpc_nat_gateway_info:
region: ap-southeast-2
filters:
state: ['pending']
register: pending_ngws
- name: Get nat gateways with specific filter
ec2_vpc_nat_gateway_info:
community.aws.ec2_vpc_nat_gateway_info:
region: ap-southeast-2
filters:
subnet-id: subnet-12345678
Expand Down
Loading

0 comments on commit cfc3f86

Please sign in to comment.