| 1 |
# -*- coding: utf-8 -*- |
| 2 |
|
| 3 |
# Copyright: (c) 2014, Will Thames <[email protected]> |
| 4 |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 5 |
|
| 6 |
|
| 7 |
class ModuleDocFragment: |
| 8 |
# Common configuration for all AWS services |
| 9 |
# Note: If you're updating MODULES, PLUGINS probably needs updating too. |
| 10 |
|
| 11 |
# Formatted for Modules |
| 12 |
# - modules don't support 'env' |
| 13 |
MODULES = r""" |
| 14 |
options: |
| 15 |
access_key: |
| 16 |
description: |
| 17 |
- AWS access key ID. |
| 18 |
- See the AWS documentation for more information about access tokens |
| 19 |
U(https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). |
| 20 |
- The C(AWS_ACCESS_KEY_ID) or C(AWS_ACCESS_KEY) |
| 21 |
environment variables may also be used in decreasing order of |
| 22 |
preference. |
| 23 |
- The I(aws_access_key) and I(profile) options are mutually exclusive. |
| 24 |
- The I(aws_access_key_id) alias was added in release 5.1.0 for |
| 25 |
consistency with the AWS botocore SDK. |
| 26 |
type: str |
| 27 |
aliases: ['aws_access_key_id', 'aws_access_key'] |
| 28 |
secret_key: |
| 29 |
description: |
| 30 |
- AWS secret access key. |
| 31 |
- See the AWS documentation for more information about access tokens |
| 32 |
U(https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). |
| 33 |
- The C(AWS_SECRET_ACCESS_KEY) or C(AWS_SECRET_KEY) |
| 34 |
environment variables may also be used in decreasing order of |
| 35 |
preference. |
| 36 |
- The I(secret_key) and I(profile) options are mutually exclusive. |
| 37 |
- The I(aws_secret_access_key) alias was added in release 5.1.0 for |
| 38 |
consistency with the AWS botocore SDK. |
| 39 |
type: str |
| 40 |
aliases: ['aws_secret_access_key', 'aws_secret_key'] |
| 41 |
session_token: |
| 42 |
description: |
| 43 |
- AWS STS session token for use with temporary credentials. |
| 44 |
- See the AWS documentation for more information about access tokens |
| 45 |
U(https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). |
| 46 |
- The C(AWS_SESSION_TOKEN) environment variable may also be used. |
| 47 |
- The I(session_token) and I(profile) options are mutually exclusive. |
| 48 |
type: str |
| 49 |
aliases: ['aws_session_token'] |
| 50 |
profile: |
| 51 |
description: |
| 52 |
- A named AWS profile to use for authentication. |
| 53 |
- See the AWS documentation for more information about named profiles |
| 54 |
U(https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html). |
| 55 |
- The C(AWS_PROFILE) environment variable may also be used. |
| 56 |
- The I(profile) option is mutually exclusive with the I(aws_access_key), |
| 57 |
I(aws_secret_key) and I(session_token) options. |
| 58 |
type: str |
| 59 |
aliases: ['aws_profile'] |
| 60 |
|
| 61 |
endpoint_url: |
| 62 |
description: |
| 63 |
- URL to connect to instead of the default AWS endpoints. While this |
| 64 |
can be used to connection to other AWS-compatible services the |
| 65 |
amazon.aws and community.aws collections are only tested against |
| 66 |
AWS. |
| 67 |
- The C(AWS_URL) environment variable may also be used. |
| 68 |
type: str |
| 69 |
aliases: ['aws_endpoint_url'] |
| 70 |
|
| 71 |
aws_ca_bundle: |
| 72 |
description: |
| 73 |
- The location of a CA Bundle to use when validating SSL certificates. |
| 74 |
- The C(AWS_CA_BUNDLE) environment variable may also be used. |
| 75 |
type: path |
| 76 |
validate_certs: |
| 77 |
description: |
| 78 |
- When set to C(false), SSL certificates will not be validated for |
| 79 |
communication with the AWS APIs. |
| 80 |
- Setting I(validate_certs=false) is strongly discouraged, as an |
| 81 |
alternative, consider setting I(aws_ca_bundle) instead. |
| 82 |
type: bool |
| 83 |
default: true |
| 84 |
aws_config: |
| 85 |
description: |
| 86 |
- A dictionary to modify the botocore configuration. |
| 87 |
- Parameters can be found in the AWS documentation |
| 88 |
U(https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config). |
| 89 |
type: dict |
| 90 |
debug_botocore_endpoint_logs: |
| 91 |
description: |
| 92 |
- Use a C(botocore.endpoint) logger to parse the unique (rather than total) |
| 93 |
C("resource:action") API calls made during a task, outputing the set to |
| 94 |
the resource_actions key in the task results. Use the |
| 95 |
C(aws_resource_action) callback to output to total list made during |
| 96 |
a playbook. |
| 97 |
- The C(ANSIBLE_DEBUG_BOTOCORE_LOGS) environment variable may also be used. |
| 98 |
type: bool |
| 99 |
default: false |
| 100 |
notes: |
| 101 |
- B(Caution:) For modules, environment variables and configuration files are |
| 102 |
read from the Ansible 'host' context and not the 'controller' context. |
| 103 |
As such, files may need to be explicitly copied to the 'host'. For lookup |
| 104 |
and connection plugins, environment variables and configuration files are |
| 105 |
read from the Ansible 'controller' context and not the 'host' context. |
| 106 |
- The AWS SDK (boto3) that Ansible uses may also read defaults for credentials |
| 107 |
and other settings, such as the region, from its configuration files in the |
| 108 |
Ansible 'host' context (typically C(~/.aws/credentials)). |
| 109 |
See U(https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html) |
| 110 |
for more information. |
| 111 |
""" |
| 112 |
|
| 113 |
# Formatted for non-module plugins |
| 114 |
# - modules don't support 'env' |
| 115 |
PLUGINS = r""" |
| 116 |
options: |
| 117 |
access_key: |
| 118 |
description: |
| 119 |
- AWS access key ID. |
| 120 |
- See the AWS documentation for more information about access tokens |
| 121 |
U(https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). |
| 122 |
- The I(aws_access_key) and I(profile) options are mutually exclusive. |
| 123 |
- The I(aws_access_key_id) alias was added in release 5.1.0 for |
| 124 |
consistency with the AWS botocore SDK. |
| 125 |
type: str |
| 126 |
aliases: ['aws_access_key_id', 'aws_access_key'] |
| 127 |
env: |
| 128 |
- name: AWS_ACCESS_KEY_ID |
| 129 |
- name: AWS_ACCESS_KEY |
| 130 |
secret_key: |
| 131 |
description: |
| 132 |
- AWS secret access key. |
| 133 |
- See the AWS documentation for more information about access tokens |
| 134 |
U(https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). |
| 135 |
- The I(secret_key) and I(profile) options are mutually exclusive. |
| 136 |
- The I(aws_secret_access_key) alias was added in release 5.1.0 for |
| 137 |
consistency with the AWS botocore SDK. |
| 138 |
type: str |
| 139 |
aliases: ['aws_secret_access_key', 'aws_secret_key'] |
| 140 |
env: |
| 141 |
- name: AWS_SECRET_ACCESS_KEY |
| 142 |
- name: AWS_SECRET_KEY |
| 143 |
session_token: |
| 144 |
description: |
| 145 |
- AWS STS session token for use with temporary credentials. |
| 146 |
- See the AWS documentation for more information about access tokens |
| 147 |
U(https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). |
| 148 |
- The I(session_token) and I(profile) options are mutually exclusive. |
| 149 |
type: str |
| 150 |
aliases: ['aws_session_token'] |
| 151 |
env: |
| 152 |
- name: AWS_SESSION_TOKEN |
| 153 |
|
| 154 |
profile: |
| 155 |
description: |
| 156 |
- A named AWS profile to use for authentication. |
| 157 |
- See the AWS documentation for more information about named profiles |
| 158 |
U(https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html). |
| 159 |
- The I(profile) option is mutually exclusive with the I(aws_access_key), |
| 160 |
I(aws_secret_key) and I(session_token) options. |
| 161 |
type: str |
| 162 |
aliases: ['aws_profile'] |
| 163 |
env: |
| 164 |
- name: AWS_PROFILE |
| 165 |
- name: AWS_DEFAULT_PROFILE |
| 166 |
endpoint_url: |
| 167 |
description: |
| 168 |
- URL to connect to instead of the default AWS endpoints. While this |
| 169 |
can be used to connection to other AWS-compatible services the |
| 170 |
amazon.aws and community.aws collections are only tested against |
| 171 |
AWS. |
| 172 |
type: str |
| 173 |
aliases: ['aws_endpoint_url'] |
| 174 |
env: |
| 175 |
- name: AWS_URL |
| 176 |
|
| 177 |
notes: |
| 178 |
- B(Caution:) For modules, environment variables and configuration files are |
| 179 |
read from the Ansible 'host' context and not the 'controller' context. |
| 180 |
As such, files may need to be explicitly copied to the 'host'. For lookup |
| 181 |
and connection plugins, environment variables and configuration files are |
| 182 |
read from the Ansible 'controller' context and not the 'host' context. |
| 183 |
- The AWS SDK (boto3) that Ansible uses may also read defaults for credentials |
| 184 |
and other settings, such as the region, from its configuration files in the |
| 185 |
Ansible 'host' context (typically C(~/.aws/credentials)). |
| 186 |
See U(https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html) |
| 187 |
for more information. |
| 188 |
""" |