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]>
  • Loading branch information
Akasurde authored and jillr committed May 10, 2021
1 parent f85345b commit 2cfc78a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
40 changes: 20 additions & 20 deletions plugins/modules/ec2_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- Create and manage AWS EC2 instances.
- >
Note: This module does not support creating
L(EC2 Spot instances,https://aws.amazon.com/ec2/spot/). The M(ec2) module
L(EC2 Spot instances,https://aws.amazon.com/ec2/spot/). The M(amazon.aws.ec2) module
can create and manage spot instances.
author:
- Ryan Scott Brown (@ryansb)
Expand Down Expand Up @@ -82,7 +82,7 @@
type: bool
image:
description:
- An image to use for the instance. The M(ec2_ami_info) module may be used to retrieve images.
- An image to use for the instance. The M(amazon.aws.ec2_ami_info) module may be used to retrieve images.
One of I(image) or I(image_id) are required when instance is not already present.
type: dict
suboptions:
Expand Down Expand Up @@ -117,14 +117,14 @@
vpc_subnet_id:
description:
- The subnet ID in which to launch the instance (VPC)
If none is provided, ec2_instance will chose the default zone of the default VPC.
If none is provided, M(community.aws.ec2_instance) will chose the default zone of the default VPC.
aliases: ['subnet_id']
type: str
network:
description:
- Either a dictionary containing the key 'interfaces' corresponding to a list of network interface IDs or
containing specifications for a single network interface.
- Use the ec2_eni module to create ENIs with special settings.
- Use the M(amazon.aws.ec2_eni) module to create ENIs with special settings.
type: dict
suboptions:
interfaces:
Expand Down Expand Up @@ -282,20 +282,20 @@
EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Terminate every running instance in a region. Use with EXTREME caution.
- ec2_instance:
- name: Terminate every running instance in a region. Use with EXTREME caution.
community.aws.ec2_instance:
state: absent
filters:
instance-state-name: running
# restart a particular instance by its ID
- ec2_instance:
- name: restart a particular instance by its ID
community.aws.ec2_instance:
state: restarted
instance_ids:
- i-12345678
# start an instance with a public IP address
- ec2_instance:
- name: start an instance with a public IP address
community.aws.ec2_instance:
name: "public-compute-instance"
key_name: "prod-ssh-key"
vpc_subnet_id: subnet-5ca1ab1e
Expand All @@ -307,8 +307,8 @@
tags:
Environment: Testing
# start an instance and Add EBS
- ec2_instance:
- name: start an instance and Add EBS
community.aws.ec2_instance:
name: "public-withebs-instance"
vpc_subnet_id: subnet-5ca1ab1e
instance_type: t2.micro
Expand All @@ -320,8 +320,8 @@
volume_size: 16
delete_on_termination: true
# start an instance with a cpu_options
- ec2_instance:
- name: start an instance with a cpu_options
community.aws.ec2_instance:
name: "public-cpuoption-instance"
vpc_subnet_id: subnet-5ca1ab1e
tags:
Expand All @@ -335,8 +335,8 @@
core_count: 1
threads_per_core: 1
# start an instance and have it begin a Tower callback on boot
- ec2_instance:
- name: start an instance and have it begin a Tower callback on boot
community.aws.ec2_instance:
name: "tower-callback-test"
key_name: "prod-ssh-key"
vpc_subnet_id: subnet-5ca1ab1e
Expand All @@ -353,8 +353,8 @@
tags:
SomeThing: "A value"
# start an instance with ENI (An existing ENI ID is required)
- ec2_instance:
- name: start an instance with ENI (An existing ENI ID is required)
community.aws.ec2_instance:
name: "public-eni-instance"
key_name: "prod-ssh-key"
vpc_subnet_id: subnet-5ca1ab1e
Expand All @@ -370,8 +370,8 @@
instance_type: t2.micro
image_id: ami-123456
# add second ENI interface
- ec2_instance:
- name: add second ENI interface
community.aws.ec2_instance:
name: "public-eni-instance"
network:
interfaces:
Expand Down
20 changes: 10 additions & 10 deletions plugins/modules/ec2_instance_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@
EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Gather information about all instances
- ec2_instance_info:
- name: Gather information about all instances
community.aws.ec2_instance_info:
# Gather information about all instances in AZ ap-southeast-2a
- ec2_instance_info:
- name: Gather information about all instances in AZ ap-southeast-2a
community.aws.ec2_instance_info:
filters:
availability-zone: ap-southeast-2a
# Gather information about a particular instance using ID
- ec2_instance_info:
- name: Gather information about a particular instance using ID
community.aws.ec2_instance_info:
instance_ids:
- i-12345678
# Gather information about any instance with a tag key Name and value Example
- ec2_instance_info:
- name: Gather information about any instance with a tag key Name and value Example
community.aws.ec2_instance_info:
filters:
"tag:Name": Example
# Gather information about any instance in states "shutting-down", "stopping", "stopped"
- ec2_instance_info:
- name: Gather information about any instance in states "shutting-down", "stopping", "stopped"
community.aws.ec2_instance_info:
filters:
instance-state-name: [ "shutting-down", "stopping", "stopped" ]
Expand Down

0 comments on commit 2cfc78a

Please sign in to comment.