[aws_ec2 inventory] Add documentation about how to use IAM roles (#53957)

* Add documentation about how to use IAM roles

* Reformat long descriptions
This commit is contained in:
Sloane Hertel 2019-03-21 09:40:13 -05:00 committed by GitHub
parent 6bd32b748f
commit 2d172ee8ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,13 +17,19 @@ DOCUMENTATION = '''
description: description:
- Get inventory hosts from Amazon Web Services EC2. - Get inventory hosts from Amazon Web Services EC2.
- Uses a YAML configuration file that ends with aws_ec2.(yml|yaml). - Uses a YAML configuration file that ends with aws_ec2.(yml|yaml).
notes:
- If no credentials are provided and the control node has an associated IAM instance profile then the
role will be used for authentication.
options: options:
plugin: plugin:
description: token that ensures this is a source file for the 'aws_ec2' plugin. description: token that ensures this is a source file for the 'aws_ec2' plugin.
required: True required: True
choices: ['aws_ec2'] choices: ['aws_ec2']
boto_profile: boto_profile:
description: The boto profile to use. description:
- The boto profile to use.
- This plugin supports boto3-style credentials, so the profile may be sourced from ~/.aws/config for assuming an IAM role.
- See U(https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html) for details.
env: env:
- name: AWS_PROFILE - name: AWS_PROFILE
- name: AWS_DEFAULT_PROFILE - name: AWS_DEFAULT_PROFILE
@ -49,30 +55,34 @@ DOCUMENTATION = '''
- name: EC2_SECURITY_TOKEN - name: EC2_SECURITY_TOKEN
regions: regions:
description: description:
- A list of regions in which to describe EC2 instances. - A list of regions in which to describe EC2 instances.
- If empty (the default) default this will include all regions, except possibly restricted ones like us-gov-west-1 and cn-north-1. - If empty (the default) default this will include all regions, except possibly restricted ones like us-gov-west-1 and cn-north-1.
type: list type: list
default: [] default: []
hostnames: hostnames:
description: A list in order of precedence for hostname variables. You can use the options specified in description:
U(http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options). To use tags as hostnames - A list in order of precedence for hostname variables.
use the syntax tag:Name=Value to use the hostname Name_Value, or tag:Name to use the value of the Name tag. - You can use the options specified in U(http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options).
- To use tags as hostnames use the syntax tag:Name=Value to use the hostname Name_Value, or tag:Name to use the value of the Name tag.
type: list type: list
default: [] default: []
filters: filters:
description: A dictionary of filter value pairs. Available filters are listed here description:
U(http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options) - A dictionary of filter value pairs.
- Available filters are listed here U(http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options).
type: dict type: dict
default: {} default: {}
include_extra_api_calls: include_extra_api_calls:
description: Add two additional API calls for every instance to include 'persistent' and 'events' host variables. Spot instances description:
may be persistent and instances may have associated events. - Add two additional API calls for every instance to include 'persistent' and 'events' host variables.
- Spot instances may be persistent and instances may have associated events.
type: bool type: bool
default: False default: False
version_added: '2.8' version_added: '2.8'
strict_permissions: strict_permissions:
description: By default if a 403 (Forbidden) is encountered this plugin will fail. You can set strict_permissions to description:
False in the inventory config file which will allow 403 errors to be gracefully skipped. - By default if a 403 (Forbidden) error code is encountered this plugin will fail.
- You can set this option to False in the inventory config file which will allow 403 errors to be gracefully skipped.
type: bool type: bool
default: True default: True
use_contrib_script_compatible_sanitization: use_contrib_script_compatible_sanitization: