Amazon related Sanity test fixups (remaining batch 1) (#64368)

* Remove Sanity test ignore.txt entries

* Fixup boilerplate

* Remove use of blacklisted _ variable name

* cloudformation: Add an explicit removal version for template_format

This option's been ignored since ansible 2.3

* General docs cleanup to clear sanity errors

* elasticache_parameter_group: Add list of choices

- matches documented choices
- other values wouldn't have worked

* data_pipeline: Deprecate 'version' - always ignored

* Add deprecation documentation
This commit is contained in:
Mark Chappell 2019-11-04 16:13:27 +01:00 committed by John R Barker
parent 3126c38f8a
commit 8c8077b5be
34 changed files with 1373 additions and 671 deletions

View file

@ -0,0 +1,3 @@
deprecated_features:
- "cloudformation - The ``template_format`` option had no effect since Ansible 2.3 and will be removed in Ansible 2.14"
- "data_pipeline - The ``version`` option had no effect and will be removed in Ansible 2.14"

View file

@ -57,6 +57,9 @@ The following functionality will be removed in Ansible 2.14. Please update updat
* :ref:`s3_lifecycle <s3_lifecycle_module>`: the ``requester_pays`` option will be removed. It has always been ignored by the module.
* :ref:`s3_sync <s3_sync_module>`: the ``retries`` option will be removed. It has always been ignored by the module.
* The return values ``err`` and ``out`` of :ref:`docker_stack <docker_stack_module>` have been deprecated. Use ``stdout`` and ``stderr`` from now on instead.
* :ref:`cloudformation <cloudformation_module>`: the ``template_format`` option will be removed. It has been ignored by the module since Ansible 2.3.
* :ref:`data_pipeline <data_pipeline_module>`: the ``version`` option will be removed. It has always been ignored by the module.
The following functionality will change in Ansible 2.14. Please update update your playbooks accordingly.

View file

@ -18,7 +18,7 @@ short_description: Create or delete an AWS CloudFormation stack
description:
- Launches or updates an AWS CloudFormation stack and waits for it complete.
notes:
- Cloudformation features change often, and this module tries to keep up. That means your botocore version should be fresh.
- CloudFormation features change often, and this module tries to keep up. That means your botocore version should be fresh.
The version listed in the requirements is the oldest version that works with the module as a whole.
Some features may require recent versions, and we do not pinpoint a minimum version for each feature.
Instead of relying on the minimum version, keep botocore up to date. AWS is always releasing features and fixing bugs.
@ -26,109 +26,129 @@ version_added: "1.1"
options:
stack_name:
description:
- name of the cloudformation stack
- Name of the CloudFormation stack.
required: true
type: str
disable_rollback:
description:
- If a stacks fails to form, rollback will remove the stack
- If a stacks fails to form, rollback will remove the stack.
default: false
type: bool
default: 'no'
on_create_failure:
description:
- Action to take upon failure of stack creation. Incompatible with the disable_rollback option.
- Action to take upon failure of stack creation. Incompatible with the I(disable_rollback) option.
choices:
- DO_NOTHING
- ROLLBACK
- DELETE
version_added: "2.8"
type: str
create_timeout:
description:
- The amount of time (in minutes) that can pass before the stack status becomes CREATE_FAILED
version_added: "2.6"
type: int
template_parameters:
description:
- A list of hashes of all the template variables for the stack. The value can be a string or a dict.
- Dict can be used to set additional template parameter attributes like UsePreviousValue (see example).
default: {}
type: dict
state:
description:
- If state is "present", stack will be created. If state is "present" and if stack exists and template has changed, it will be updated.
If state is "absent", stack will be removed.
- If I(state=present), stack will be created.
- If I(state=present) and if stack exists and template has changed, it will be updated.
- If I(state=absent), stack will be removed.
default: present
choices: [ present, absent ]
type: str
template:
description:
- The local path of the cloudformation template.
- The local path of the CloudFormation template.
- This must be the full path to the file, relative to the working directory. If using roles this may look
like "roles/cloudformation/files/cloudformation-example.json".
- If 'state' is 'present' and the stack does not exist yet, either 'template', 'template_body' or 'template_url'
must be specified (but only one of them). If 'state' is 'present', the stack does exist, and neither 'template',
'template_body' nor 'template_url' are specified, the previous template will be reused.
like C(roles/cloudformation/files/cloudformation-example.json).
- If I(state=present) and the stack does not exist yet, either I(template), I(template_body) or I(template_url)
must be specified (but only one of them).
- If I(state=present), the stack does exist, and neither I(template),
I(template_body) nor I(template_url) are specified, the previous template will be reused.
type: path
notification_arns:
description:
- The Simple Notification Service (SNS) topic ARNs to publish stack related events.
- A comma separated list of Simple Notification Service (SNS) topic ARNs to publish stack related events.
version_added: "2.0"
type: str
stack_policy:
description:
- the path of the cloudformation stack policy. A policy cannot be removed once placed, but it can be modified.
- The path of the CloudFormation stack policy. A policy cannot be removed once placed, but it can be modified.
for instance, allow all updates U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html#d0e9051)
version_added: "1.9"
type: str
tags:
description:
- Dictionary of tags to associate with stack and its resources during stack creation. Can be updated later, updating tags removes previous entries.
- Dictionary of tags to associate with stack and its resources during stack creation.
- Can be updated later, updating tags removes previous entries.
version_added: "1.4"
type: dict
template_url:
description:
- Location of file containing the template body. The URL must point to a template (max size 307,200 bytes) located in an S3 bucket in the same region
as the stack.
- If 'state' is 'present' and the stack does not exist yet, either 'template', 'template_body' or 'template_url'
must be specified (but only one of them). If 'state' is present, the stack does exist, and neither 'template',
'template_body' nor 'template_url' are specified, the previous template will be reused.
- Location of file containing the template body. The URL must point to a template (max size 307,200 bytes) located in an
S3 bucket in the same region as the stack.
- If I(state=present) and the stack does not exist yet, either I(template), I(template_body) or I(template_url)
must be specified (but only one of them).
- If I(state=present), the stack does exist, and neither I(template), I(template_body) nor I(template_url) are specified,
the previous template will be reused.
version_added: "2.0"
type: str
create_changeset:
description:
- "If stack already exists create a changeset instead of directly applying changes.
See the AWS Change Sets docs U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html).
WARNING: if the stack does not exist, it will be created without changeset. If the state is absent, the stack will be deleted immediately with no
changeset."
- "If stack already exists create a changeset instead of directly applying changes. See the AWS Change Sets docs
U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html)."
- "WARNING: if the stack does not exist, it will be created without changeset. If I(state=absent), the stack will be
deleted immediately with no changeset."
type: bool
default: 'no'
default: false
version_added: "2.4"
changeset_name:
description:
- Name given to the changeset when creating a changeset, only used when create_changeset is true. By default a name prefixed with Ansible-STACKNAME
is generated based on input parameters.
See the AWS Change Sets docs U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html)
- Name given to the changeset when creating a changeset.
- Only used when I(create_changeset=true).
- By default a name prefixed with Ansible-STACKNAME is generated based on input parameters.
See the AWS Change Sets docs for more information
U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html)
version_added: "2.4"
type: str
template_format:
description:
- (deprecated) For local templates, allows specification of json or yaml format. Templates are now passed raw to CloudFormation regardless of format.
This parameter is ignored since Ansible 2.3.
default: json
choices: [ json, yaml ]
- This parameter is ignored since Ansible 2.3 and will be removed in Ansible 2.14.
- Templates are now passed raw to CloudFormation regardless of format.
version_added: "2.0"
type: str
role_arn:
description:
- The role that AWS CloudFormation assumes to create the stack. See the AWS CloudFormation Service Role
docs U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-servicerole.html)
version_added: "2.3"
type: str
termination_protection:
description:
- enable or disable termination protection on the stack. Only works with botocore >= 1.7.18.
- Enable or disable termination protection on the stack. Only works with botocore >= 1.7.18.
type: bool
version_added: "2.5"
template_body:
description:
- Template body. Use this to pass in the actual body of the Cloudformation template.
- If 'state' is 'present' and the stack does not exist yet, either 'template', 'template_body' or 'template_url'
must be specified (but only one of them). If 'state' is present, the stack does exist, and neither 'template',
'template_body' nor 'template_url' are specified, the previous template will be reused.
- Template body. Use this to pass in the actual body of the CloudFormation template.
- If I(state=present) and the stack does not exist yet, either I(template), I(template_body) or I(template_url)
must be specified (but only one of them).
- If I(state=present), the stack does exist, and neither I(template), I(template_body) nor I(template_url)
are specified, the previous template will be reused.
version_added: "2.5"
type: str
events_limit:
description:
- Maximum number of CloudFormation events to fetch from a stack when creating or updating it.
default: 200
version_added: "2.7"
type: int
backoff_delay:
description:
- Number of seconds to wait for the next retry.
@ -146,7 +166,7 @@ options:
backoff_retries:
description:
- Number of times to retry operation.
- AWS API throttling mechanism fails Cloudformation module so we have to retry a couple of times.
- AWS API throttling mechanism fails CloudFormation module so we have to retry a couple of times.
default: 10
version_added: "2.8"
type: int
@ -154,8 +174,9 @@ options:
capabilities:
description:
- Specify capabilities that stack template contains.
- Valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM and CAPABILITY_AUTO_EXPAND.
- Valid values are C(CAPABILITY_IAM), C(CAPABILITY_NAMED_IAM) and C(CAPABILITY_AUTO_EXPAND).
type: list
elements: str
version_added: "2.8"
default: [ CAPABILITY_IAM, CAPABILITY_NAMED_IAM ]
@ -231,9 +252,9 @@ EXAMPLES = '''
tags:
Stack: ansible-cloudformation
# Pass a template parameter which uses Cloudformation's UsePreviousValue attribute
# Pass a template parameter which uses CloudFormation's UsePreviousValue attribute
# When use_previous_value is set to True, the given value will be ignored and
# Cloudformation will use the value from a previously submitted template.
# CloudFormation will use the value from a previously submitted template.
# If use_previous_value is set to False (default) the given value is used.
- cloudformation:
stack_name: "ansible-cloudformation"
@ -283,7 +304,7 @@ EXAMPLES = '''
RETURN = '''
events:
type: list
description: Most recent events in Cloudformation's event log. This may be from a previous run in some cases.
description: Most recent events in CloudFormation's event log. This may be from a previous run in some cases.
returned: always
sample: ["StackEvent AWS::CloudFormation::Stack stackname UPDATE_COMPLETE", "StackEvent AWS::CloudFormation::Stack stackname UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"]
log:
@ -638,7 +659,7 @@ def main():
create_timeout=dict(default=None, type='int'),
template_url=dict(default=None, required=False),
template_body=dict(default=None, require=False),
template_format=dict(default=None, choices=['json', 'yaml'], required=False),
template_format=dict(removed_in_version='2.14'),
create_changeset=dict(default=False, type='bool'),
changeset_name=dict(default=None, required=False),
role_arn=dict(default=None, required=False),
@ -812,10 +833,6 @@ def main():
except Exception as err:
module.fail_json(msg=boto_exception(err), exception=traceback.format_exc())
if module.params['template_format'] is not None:
result['warnings'] = [('Argument `template_format` is deprecated '
'since Ansible 2.3, JSON and YAML templates are now passed '
'directly to the CloudFormation API.')]
module.exit_json(**result)

View file

@ -16,7 +16,7 @@ DOCUMENTATION = '''
module: cloudformation_info
short_description: Obtain information about an AWS CloudFormation stack
description:
- Gets information about an AWS CloudFormation stack
- Gets information about an AWS CloudFormation stack.
- This module was called C(cloudformation_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(cloudformation_info) module no longer returns C(ansible_facts)!
requirements:
@ -28,31 +28,32 @@ options:
stack_name:
description:
- The name or id of the CloudFormation stack. Gathers information on all stacks by default.
type: str
all_facts:
description:
- Get all stack information for the stack
- Get all stack information for the stack.
type: bool
default: 'no'
default: false
stack_events:
description:
- Get stack events for the stack
- Get stack events for the stack.
type: bool
default: 'no'
default: false
stack_template:
description:
- Get stack template body for the stack
- Get stack template body for the stack.
type: bool
default: 'no'
default: false
stack_resources:
description:
- Get stack resources for the stack
- Get stack resources for the stack.
type: bool
default: 'no'
default: false
stack_policy:
description:
- Get stack policy for the stack
- Get stack policy for the stack.
type: bool
default: 'no'
default: false
extends_documentation_fragment:
- aws
- ec2

View file

@ -15,54 +15,65 @@ DOCUMENTATION = '''
module: cloudformation_stack_set
short_description: Manage groups of CloudFormation stacks
description:
- Launches/updates/deletes AWS CloudFormation Stack Sets
- Launches/updates/deletes AWS CloudFormation Stack Sets.
notes:
- To make an individual stack, you want the cloudformation module.
- To make an individual stack, you want the M(cloudformation) module.
version_added: "2.7"
options:
name:
description:
- name of the cloudformation stack set
- Name of the CloudFormation stack set.
required: true
type: str
description:
description:
- A description of what this stack set creates
- A description of what this stack set creates.
type: str
parameters:
description:
- A list of hashes of all the template variables for the stack. The value can be a string or a dict.
- Dict can be used to set additional template parameter attributes like UsePreviousValue (see example).
default: {}
type: dict
state:
description:
- If state is "present", stack will be created. If state is "present" and if stack exists and template has changed, it will be updated.
If state is "absent", stack will be removed.
- If I(state=present), stack will be created. If I(state=present) and if stack exists and template has changed, it will be updated.
If I(state=absent), stack will be removed.
default: present
choices: [ present, absent ]
type: str
template:
description:
- The local path of the cloudformation template.
- The local path of the CloudFormation template.
- This must be the full path to the file, relative to the working directory. If using roles this may look
like "roles/cloudformation/files/cloudformation-example.json".
- If 'state' is 'present' and the stack does not exist yet, either 'template', 'template_body' or 'template_url'
must be specified (but only one of them). If 'state' is present, the stack does exist, and neither 'template',
'template_body' nor 'template_url' are specified, the previous template will be reused.
like C(roles/cloudformation/files/cloudformation-example.json).
- If I(state=present) and the stack does not exist yet, either I(template), I(template_body) or I(template_url)
must be specified (but only one of them).
- If I(state=present), the stack does exist, and neither I(template), I(template_body) nor I(template_url)
are specified, the previous template will be reused.
type: path
template_body:
description:
- Template body. Use this to pass in the actual body of the Cloudformation template.
- If 'state' is 'present' and the stack does not exist yet, either 'template', 'template_body' or 'template_url'
must be specified (but only one of them). If 'state' is present, the stack does exist, and neither 'template',
'template_body' nor 'template_url' are specified, the previous template will be reused.
- Template body. Use this to pass in the actual body of the CloudFormation template.
- If I(state=present) and the stack does not exist yet, either I(template), I(template_body) or I(template_url)
must be specified (but only one of them).
- If I(state=present), the stack does exist, and neither I(template), I(template_body) nor I(template_url)
are specified, the previous template will be reused.
type: str
template_url:
description:
- Location of file containing the template body. The URL must point to a template (max size 307,200 bytes) located in an S3 bucket in the same region
- Location of file containing the template body.
- The URL must point to a template (max size 307,200 bytes) located in an S3 bucket in the same region
as the stack.
- If 'state' is 'present' and the stack does not exist yet, either 'template', 'template_body' or 'template_url'
must be specified (but only one of them). If 'state' is present, the stack does exist, and neither 'template',
'template_body' nor 'template_url' are specified, the previous template will be reused.
- If I(state=present) and the stack does not exist yet, either I(template), I(template_body) or I(template_url)
must be specified (but only one of them).
- If I(state=present), the stack does exist, and neither I(template), I(template_body) nor I(template_url)
are specified, the previous template will be reused.
type: str
purge_stacks:
description:
- Only applicable when I(state=absent). Sets whether, when deleting a stack set, the stack instances should also be deleted.
- By default, instances will be deleted. Set to 'no' or 'false' to keep stacks when stack set is deleted.
- By default, instances will be deleted. To keep stacks when stack set is deleted set I(purge_stacks=false).
type: bool
default: true
wait:
@ -75,6 +86,7 @@ options:
description:
- How long to wait (in seconds) for stacks to complete create/update/delete operations.
default: 900
type: int
capabilities:
description:
- Capabilities allow stacks to create and modify IAM resources, which may include adding users or roles.
@ -82,6 +94,8 @@ options:
- >
The following resources require that one or both of these parameters is specified: AWS::IAM::AccessKey,
AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, AWS::IAM::Role, AWS::IAM::User, AWS::IAM::UserToGroupAddition
type: list
elements: str
choices:
- 'CAPABILITY_IAM'
- 'CAPABILITY_NAMED_IAM'
@ -91,35 +105,72 @@ options:
specifies the region for stack instances.
- At least one region must be specified to create a stack set. On updates, if fewer regions are specified only the specified regions will
have their stack instances updated.
type: list
elements: str
accounts:
description:
- A list of AWS accounts in which to create instance of CloudFormation stacks.
- At least one region must be specified to create a stack set. On updates, if fewer regions are specified only the specified regions will
have their stack instances updated.
type: list
elements: str
administration_role_arn:
description:
- ARN of the administration role, meaning the role that CloudFormation Stack Sets use to assume the roles in your child accounts.
- This defaults to I(arn:aws:iam::{{ account ID }}:role/AWSCloudFormationStackSetAdministrationRole) where I({{ account ID }}) is replaced with the
- This defaults to C(arn:aws:iam::{{ account ID }}:role/AWSCloudFormationStackSetAdministrationRole) where C({{ account ID }}) is replaced with the
account number of the current IAM role/user/STS credentials.
aliases:
- admin_role_arn
- admin_role
- administration_role
type: str
execution_role_name:
description:
- ARN of the execution role, meaning the role that CloudFormation Stack Sets assumes in your child accounts.
- This MUST NOT be an ARN, and the roles must exist in each child account specified.
- The default name for the execution role is I(AWSCloudFormationStackSetExecutionRole)
- The default name for the execution role is C(AWSCloudFormationStackSetExecutionRole)
aliases:
- exec_role_name
- exec_role
- execution_role
type: str
tags:
description:
- Dictionary of tags to associate with stack and its resources during stack creation. Can be updated later, updating tags removes previous entries.
- Dictionary of tags to associate with stack and its resources during stack creation.
- Can be updated later, updating tags removes previous entries.
type: dict
failure_tolerance:
description:
- Settings to change what is considered "failed" when running stack instance updates, and how many to do at a time.
type: dict
suboptions:
fail_count:
description:
- The number of accounts, per region, for which this operation can fail before CloudFormation
stops the operation in that region.
- You must specify one of I(fail_count) and I(fail_percentage).
type: int
fail_percentage:
type: int
description:
- The percentage of accounts, per region, for which this stack operation can fail before CloudFormation
stops the operation in that region.
- You must specify one of I(fail_count) and I(fail_percentage).
parallel_percentage:
type: int
description:
- The maximum percentage of accounts in which to perform this operation at one time.
- You must specify one of I(parallel_count) and I(parallel_percentage).
- Note that this setting lets you specify the maximum for operations.
For large deployments, under certain circumstances the actual percentage may be lower.
parallel_count:
type: int
description:
- The maximum number of accounts in which to perform this operation at one time.
- I(parallel_count) may be at most one more than the I(fail_count).
- You must specify one of I(parallel_count) and I(parallel_percentage).
- Note that this setting lets you specify the maximum for operations.
For large deployments, under certain circumstances the actual count may be lower.
author: "Ryan Scott Brown (@ryansb)"
extends_documentation_fragment:
@ -170,7 +221,7 @@ EXAMPLES = '''
RETURN = '''
operations_log:
type: list
description: Most recent events in Cloudformation's event log. This may be from a previous run in some cases.
description: Most recent events in CloudFormation's event log. This may be from a previous run in some cases.
returned: always
sample:
- action: CREATE

View file

@ -2,6 +2,10 @@
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
@ -11,7 +15,7 @@ DOCUMENTATION = '''
module: cloudfront_distribution
short_description: create, update and delete aws cloudfront distributions.
short_description: Create, update and delete AWS CloudFront distributions.
description:
- Allows for easy creation, updating and deletion of CloudFront distributions.
@ -34,39 +38,47 @@ options:
state:
description:
- The desired state of the distribution
present - creates a new distribution or updates an existing distribution.
absent - deletes an existing distribution.
- The desired state of the distribution.
- I(state=present) creates a new distribution or updates an existing distribution.
- I(state=absent) deletes an existing distribution.
choices: ['present', 'absent']
default: 'present'
type: str
distribution_id:
description:
- The id of the cloudfront distribution. This parameter can be exchanged with I(alias) or I(caller_reference) and is used in conjunction with I(e_tag).
- The id of the CloudFront distribution.
- This parameter can be exchanged with I(alias) or I(caller_reference) and is used in conjunction with I(e_tag).
type: str
e_tag:
description:
- A unique identifier of a modified or existing distribution. Used in conjunction with I(distribution_id).
Is determined automatically if not specified.
- Is determined automatically if not specified.
type: str
caller_reference:
description:
- A unique identifier for creating and updating cloudfront distributions. Each caller reference must be unique across all distributions. e.g. a caller
reference used in a web distribution cannot be reused in a streaming distribution. This parameter can be used instead of I(distribution_id)
- A unique identifier for creating and updating cloudfront distributions.
- Each caller reference must be unique across all distributions. e.g. a caller reference used in a web
distribution cannot be reused in a streaming distribution. This parameter can be used instead of I(distribution_id)
to reference an existing distribution. If not specified, this defaults to a datetime stamp of the format
'YYYY-MM-DDTHH:MM:SS.ffffff'.
C(YYYY-MM-DDTHH:MM:SS.ffffff).
type: str
tags:
description:
- Should be input as a dict() of key-value pairs.
Note that numeric keys or values must be wrapped in quotes. e.g. "Priority:" '1'
- Should be input as a dict of key-value pairs.
- Note that numeric keys or values must be wrapped in quotes. e.g. "Priority:" '1'
type: dict
purge_tags:
description:
- Specifies whether existing tags will be removed before adding new tags. When I(purge_tags=yes), existing tags are removed and I(tags) are added, if
specified. If no tags are specified, it removes all existing tags for the distribution. When I(purge_tags=no), existing tags are kept and I(tags)
are added, if specified.
default: 'no'
- Specifies whether existing tags will be removed before adding new tags.
- When I(purge_tags=yes), existing tags are removed and I(tags) are added, if specified.
If no tags are specified, it removes all existing tags for the distribution.
- When I(purge_tags=no), existing tags are kept and I(tags) are added, if specified.
default: false
type: bool
alias:
@ -74,227 +86,501 @@ options:
- The name of an alias (CNAME) that is used in a distribution. This is used to effectively reference a distribution by its alias as an alias can only
be used by one distribution per AWS account. This variable avoids having to provide the I(distribution_id) as well as
the I(e_tag), or I(caller_reference) of an existing distribution.
type: str
aliases:
description:
- A I(list[]) of domain name aliases (CNAMEs) as strings to be used for the distribution. Each alias must be unique across all distribution for the AWS
account.
- A list) of domain name aliases (CNAMEs) as strings to be used for the distribution.
- Each alias must be unique across all distribution for the AWS account.
type: list
elements: str
purge_aliases:
description:
- Specifies whether existing aliases will be removed before adding new aliases. When I(purge_aliases=yes), existing aliases are removed and I(aliases)
are added.
default: 'no'
- Specifies whether existing aliases will be removed before adding new aliases.
- When I(purge_aliases=yes), existing aliases are removed and I(aliases) are added.
default: false
type: bool
default_root_object:
description:
- A config element that specifies the path to request when the user requests the origin. e.g. if specified as 'index.html', this maps to
www.example.com/index.html when www.example.com is called by the user. This prevents the entire distribution origin from being exposed at the root.
- A config element that specifies the path to request when the user requests the origin.
- e.g. if specified as 'index.html', this maps to www.example.com/index.html when www.example.com is called by the user.
- This prevents the entire distribution origin from being exposed at the root.
type: str
default_origin_domain_name:
description:
- The domain name to use for an origin if no I(origins) have been specified. Should only be used on a first run of generating a distribution and not on
subsequent runs. Should not be used in conjunction with I(distribution_id), I(caller_reference) or I(alias).
- The domain name to use for an origin if no I(origins) have been specified.
- Should only be used on a first run of generating a distribution and not on
subsequent runs.
- Should not be used in conjunction with I(distribution_id), I(caller_reference) or I(alias).
type: str
default_origin_path:
description:
- The default origin path to specify for an origin if no I(origins) have been specified. Defaults to empty if not specified.
type: str
origins:
type: list
elements: dict
description:
- A config element that is a I(list[]) of complex origin objects to be specified for the distribution. Used for creating and updating distributions.
Each origin item comprises the attributes
I(id)
I(domain_name) (defaults to default_origin_domain_name if not specified)
I(origin_path) (defaults to default_origin_path if not specified)
I(custom_headers[])
I(header_name)
I(header_value)
I(s3_origin_access_identity_enabled)
I(custom_origin_config)
I(http_port)
I(https_port)
I(origin_protocol_policy)
I(origin_ssl_protocols[])
I(origin_read_timeout)
I(origin_keepalive_timeout)
- A config element that is a list of complex origin objects to be specified for the distribution. Used for creating and updating distributions.
suboptions:
id:
description: A unique identifier for the origin or origin group. I(id) must be unique within the distribution.
type: str
domain_name:
description:
- The domain name which CloudFront will query as the origin.
- For more information see the CloudFront documentation
at U(https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesDomainName)
type: str
origin_path:
description: Tells CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin.
type: str
custom_headers:
description:
- Custom headers you wish to add to the request before passing it to the origin.
- For more information see the CloudFront documentation
at U(https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/forward-custom-headers.html)
type: list
elements: dict
suboptions:
header_name:
description: The name of a header that you want CloudFront to forward to your origin.
type: str
header_value:
description: The value for the header that you specified in the I(header_name) field.
type: str
s3_origin_access_identity_enabled:
description:
- Use an origin access identity to configure the origin so that viewers can only access objects in an Amazon S3 bucket through CloudFront.
- Will automatically create an Identity for you.
- See also U(https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html).
type: bool
custom_origin_config:
description: Connection information about the origin.
type: dict
suboptions:
http_port:
description: The HTTP port the custom origin listens on.
type: int
https_port:
description: The HTTPS port the custom origin listens on.
type: int
origin_protocol_policy:
description: The origin protocol policy to apply to your origin.
type: str
origin_ssl_protocols:
description: A list of SSL/TLS protocols that you want CloudFront to use when communicating to the origin over HTTPS.
type: list
elements: str
origin_read_timeout:
description: A timeout (in seconds) when reading from your origin.
type: int
origin_keepalive_timeout:
description: A keep-alive timeout (in seconds).
type: int
purge_origins:
description: Whether to remove any origins that aren't listed in I(origins)
description: Whether to remove any origins that aren't listed in I(origins).
default: false
type: bool
default_cache_behavior:
type: dict
description:
- A config element that is a complex object specifying the default cache behavior of the distribution. If not specified, the I(target_origin_id) is
defined as the I(target_origin_id) of the first valid I(cache_behavior) in I(cache_behaviors) with defaults.
The default cache behavior comprises the attributes
I(target_origin_id)
I(forwarded_values)
I(query_string)
I(cookies)
I(forward)
I(whitelisted_names)
I(headers[])
I(query_string_cache_keys[])
I(trusted_signers)
I(enabled)
I(items[])
I(viewer_protocol_policy)
I(min_ttl)
I(allowed_methods)
I(items[])
I(cached_methods[])
I(smooth_streaming)
I(default_ttl)
I(max_ttl)
I(compress)
I(lambda_function_associations[])
I(lambda_function_arn)
I(event_type)
I(field_level_encryption_id)
- A dict specifying the default cache behavior of the distribution.
- If not specified, the I(target_origin_id) is defined as the I(target_origin_id) of the first valid
I(cache_behavior) in I(cache_behaviors) with defaults.
suboptions:
target_origin_id:
description:
- The ID of the origin that you want CloudFront to route requests to
by default.
type: str
forwarded_values:
description:
- A dict that specifies how CloudFront handles query strings and cookies.
type: dict
suboptions:
query_string:
description:
- Indicates whether you want CloudFront to forward query strings
to the origin that is associated with this cache behavior.
type: bool
cookies:
description: A dict that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones.
type: dict
suboptions:
forward:
description:
- Specifies which cookies to forward to the origin for this cache behavior.
- Valid values are C(all), C(none), or C(whitelist).
type: str
whitelisted_names:
type: list
elements: str
description: A list of coockies to forward to the origin for this cache behavior.
headers:
description:
- A list of headers to forward to the origin for this cache behavior.
- To forward all headers use a list containing a single element '*' (C(['*']))
type: list
elements: str
query_string_cache_keys:
description:
- A list that contains the query string parameters you want CloudFront to use as a basis for caching for a cache behavior.
type: list
elements: str
trusted_signers:
description:
- A dict that specifies the AWS accounts that you want to allow to create signed URLs for private content.
type: dict
suboptions:
enabled:
description: Whether you want to require viewers to use signed URLs to access the files specified by I(target_origin_id)
type: bool
items:
description: A list of trusted signers for this cache behavior.
elements: str
type: list
viewer_protocol_policy:
description:
- The protocol that viewers can use to access the files in the origin specified by I(target_origin_id).
- Valid values are C(allow-all), C(redirect-to-https) and C(https-only).
type: str
default_ttl:
description: The default amount of time that you want objects to stay in CloudFront caches.
type: int
max_ttl:
description: The maximum amount of time that you want objects to stay in CloudFront caches.
type: int
min_ttl:
description: The minimum amount of time that you want objects to stay in CloudFront caches.
type: int
allowed_methods:
description: A dict that controls which HTTP methods CloudFront processes and forwards.
type: dict
suboptions:
items:
description: A list of HTTP methods that you want CloudFront to process and forward.
type: list
elements: str
cached_methods:
description:
- A list of HTTP methods that you want CloudFront to apply caching to.
- This can either be C([GET,HEAD]), or C([GET,HEAD,OPTIONS]).
type: list
elements: str
smooth_streaming:
description:
- Whether you want to distribute media files in the Microsoft Smooth Streaming format.
type: bool
compress:
description:
- Whether you want CloudFront to automatically compress files.
type: bool
lambda_function_associations:
description:
- A list of Lambda function associations to use for this cache behavior.
type: list
elements: dict
suboptions:
lambda_function_arn:
description: The ARN of the Lambda function.
type: str
event_type:
description:
- Specifies the event type that triggers a Lambda function invocation.
- This can be C(viewer-request), C(origin-request), C(origin-response) or C(viewer-response).
type: str
field_level_encryption_id:
description:
- The field-level encryption configuration that you want CloudFront to use for encrypting specific fields of data.
type: str
cache_behaviors:
type: list
elements: dict
description:
- A config element that is a I(list[]) of complex cache behavior objects to be specified for the distribution. The order
of the list is preserved across runs unless C(purge_cache_behavior) is enabled.
Each cache behavior comprises the attributes
I(path_pattern)
I(target_origin_id)
I(forwarded_values)
I(query_string)
I(cookies)
I(forward)
I(whitelisted_names)
I(headers[])
I(query_string_cache_keys[])
I(trusted_signers)
I(enabled)
I(items[])
I(viewer_protocol_policy)
I(min_ttl)
I(allowed_methods)
I(items[])
I(cached_methods[])
I(smooth_streaming)
I(default_ttl)
I(max_ttl)
I(compress)
I(lambda_function_associations[])
I(field_level_encryption_id)
- A list of dictionaries describing the cache behaviors for the distribution.
- The order of the list is preserved across runs unless I(purge_cache_behavior) is enabled.
suboptions:
path_pattern:
description:
- The pattern that specifies which requests to apply the behavior to.
type: str
target_origin_id:
description:
- The ID of the origin that you want CloudFront to route requests to
by default.
type: str
forwarded_values:
description:
- A dict that specifies how CloudFront handles query strings and cookies.
type: dict
suboptions:
query_string:
description:
- Indicates whether you want CloudFront to forward query strings
to the origin that is associated with this cache behavior.
type: bool
cookies:
description: A dict that specifies whether you want CloudFront to forward cookies to the origin and, if so, which ones.
type: dict
suboptions:
forward:
description:
- Specifies which cookies to forward to the origin for this cache behavior.
- Valid values are C(all), C(none), or C(whitelist).
type: str
whitelisted_names:
type: list
elements: str
description: A list of coockies to forward to the origin for this cache behavior.
headers:
description:
- A list of headers to forward to the origin for this cache behavior.
- To forward all headers use a list containing a single element '*' (C(['*']))
type: list
elements: str
query_string_cache_keys:
description:
- A list that contains the query string parameters you want CloudFront to use as a basis for caching for a cache behavior.
type: list
elements: str
trusted_signers:
description:
- A dict that specifies the AWS accounts that you want to allow to create signed URLs for private content.
type: dict
suboptions:
enabled:
description: Whether you want to require viewers to use signed URLs to access the files specified by I(path_pattern) and I(target_origin_id)
type: bool
items:
description: A list of trusted signers for this cache behavior.
elements: str
type: list
viewer_protocol_policy:
description:
- The protocol that viewers can use to access the files in the origin specified by I(target_origin_id) when a request matches I(path_pattern).
- Valid values are C(allow-all), C(redirect-to-https) and C(https-only).
type: str
default_ttl:
description: The default amount of time that you want objects to stay in CloudFront caches.
type: int
max_ttl:
description: The maximum amount of time that you want objects to stay in CloudFront caches.
type: int
min_ttl:
description: The minimum amount of time that you want objects to stay in CloudFront caches.
type: int
allowed_methods:
description: A dict that controls which HTTP methods CloudFront processes and forwards.
type: dict
suboptions:
items:
description: A list of HTTP methods that you want CloudFront to process and forward.
type: list
elements: str
cached_methods:
description:
- A list of HTTP methods that you want CloudFront to apply caching to.
- This can either be C([GET,HEAD]), or C([GET,HEAD,OPTIONS]).
type: list
elements: str
smooth_streaming:
description:
- Whether you want to distribute media files in the Microsoft Smooth Streaming format.
type: bool
compress:
description:
- Whether you want CloudFront to automatically compress files.
type: bool
lambda_function_associations:
description:
- A list of Lambda function associations to use for this cache behavior.
type: list
elements: dict
suboptions:
lambda_function_arn:
description: The ARN of the Lambda function.
type: str
event_type:
description:
- Specifies the event type that triggers a Lambda function invocation.
- This can be C(viewer-request), C(origin-request), C(origin-response) or C(viewer-response).
type: str
field_level_encryption_id:
description:
- The field-level encryption configuration that you want CloudFront to use for encrypting specific fields of data.
type: str
purge_cache_behaviors:
description: Whether to remove any cache behaviors that aren't listed in I(cache_behaviors). This switch
also allows the reordering of cache_behaviors.
description:
- Whether to remove any cache behaviors that aren't listed in I(cache_behaviors).
- This switch also allows the reordering of I(cache_behaviors).
default: false
type: bool
custom_error_responses:
type: list
elements: dict
description:
- A config element that is a I(list[]) of complex custom error responses to be specified for the distribution. This attribute configures custom http
error messages returned to the user.
Each custom error response object comprises the attributes
I(error_code)
I(response_page_path)
I(response_code)
I(error_caching_min_ttl)
- A config element that is a I(list[]) of complex custom error responses to be specified for the distribution.
- This attribute configures custom http error messages returned to the user.
suboptions:
error_code:
type: int
description: The error code the the custom error page is for.
error_caching_min_ttl:
type: int
description: The length of time (in seconds) that CloudFront will cache status codes for.
response_code:
type: int
description:
- The HTTP status code that CloudFront should return to a user when the origin returns the HTTP status code specified by I(error_code).
response_page_path:
type: str
description:
- The path to the custom error page that you want CloudFront to return to a viewer when your origin returns
the HTTP status code specified by I(error_code).
purge_custom_error_responses:
description: Whether to remove any custom error responses that aren't listed in I(custom_error_responses)
description: Whether to remove any custom error responses that aren't listed in I(custom_error_responses).
default: false
type: bool
comment:
description:
- A comment that describes the cloudfront distribution. If not specified, it defaults to a
generic message that it has been created with Ansible, and a datetime stamp.
- A comment that describes the cloudfront distribution.
- If not specified, it defaults to a generic message that it has been created with Ansible, and a datetime stamp.
type: str
logging:
description:
- A config element that is a complex object that defines logging for the distribution.
The logging object comprises the attributes
I(enabled)
I(include_cookies)
I(bucket)
I(prefix)
suboptions:
enabled:
description: When I(enabled=true) CloudFront will log access to an S3 bucket.
type: bool
include_cookies:
description: When I(include_cookies=true) CloudFront will include cookies in the logs.
type: bool
bucket:
description: The S3 bucket to store the log in.
type: str
prefix:
description: A prefix to include in the S3 object names.
type: str
type: dict
price_class:
description:
- A string that specifies the pricing class of the distribution. As per
U(https://aws.amazon.com/cloudfront/pricing/)
I(price_class=PriceClass_100) consists of the areas
United States
Canada
Europe
I(price_class=PriceClass_200) consists of the areas
United States
Canada
Europe
Hong Kong, Philippines, S. Korea, Singapore & Taiwan
Japan
India
I(price_class=PriceClass_All) consists of the areas
United States
Canada
Europe
Hong Kong, Philippines, S. Korea, Singapore & Taiwan
Japan
India
South America
Australia
choices: ['PriceClass_100', 'PriceClass_200', 'PriceClass_All']
default: aws defaults this to 'PriceClass_All'
- I(price_class=PriceClass_100) consists of the areas United States, Canada and Europe.
- I(price_class=PriceClass_200) consists of the areas United States, Canada, Europe, Japan, India,
Hong Kong, Philippines, S. Korea, Singapore & Taiwan.
- I(price_class=PriceClass_All) consists of the areas United States, Canada, Europe, Japan, India,
South America, Australia, Hong Kong, Philippines, S. Korea, Singapore & Taiwan.
- AWS defaults this to C(PriceClass_All).
- Valid values are C(PriceClass_100), C(PriceClass_200) and C(PriceClass_All)
type: str
enabled:
description:
- A boolean value that specifies whether the distribution is enabled or disabled.
default: 'yes'
default: false
type: bool
viewer_certificate:
type: dict
description:
- A config element that is a complex object that specifies the encryption details of the distribution.
Comprises the following attributes
I(cloudfront_default_certificate)
I(iam_certificate_id)
I(acm_certificate_arn)
I(ssl_support_method)
I(minimum_protocol_version)
I(certificate)
I(certificate_source)
- A dict that specifies the encryption details of the distribution.
suboptions:
cloudfront_default_certificate:
type: bool
description:
- If you're using the CloudFront domain name for your distribution, such as C(123456789abcde.cloudfront.net)
you should set I(cloudfront_default_certificate=true)
- If I(cloudfront_default_certificate=true) do not set I(ssl_support_method).
iam_certificate_id:
type: str
description:
- The ID of a certificate stored in IAM to use for HTTPS connections.
- If I(iam_certificate_id) is set then you must also specify I(ssl_support_method)
acm_certificate_arn:
type: str
description:
- The ID of a certificate stored in ACM to use for HTTPS connections.
- If I(acm_certificate_id) is set then you must also specify I(ssl_support_method)
ssl_support_method:
type: str
description:
- How CloudFront should serve SSL certificates.
- Valid values are C(sni-only) for SNI, and C(vip) if CloudFront is configured to use a dedicated IP for your content.
minimum_protocol_version:
type: str
description:
- The security policy that you want CloudFront to use for HTTPS connections.
- See U(https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html)
for supported security policies.
restrictions:
type: dict
description:
- A config element that is a complex object that describes how a distribution should restrict it's content.
The restriction object comprises the following attributes
I(geo_restriction)
I(restriction_type)
I(items[])
suboptions:
geo_restriction:
description: Apply a restriciton based on the location of the requester.
type: dict
suboptions:
restriction_type:
type: str
description:
- The method that you want to use to restrict distribution of your content by country.
- Valid values are C(none), C(whitelist), C(blacklist)
items:
description:
- A list of ISO 3166-1 two letter (Alpha 2) country codes that the
restriction should apply to.
- 'See the ISO website for a full list of codes U(https://www.iso.org/obp/ui/#search/code/)'
type: list
web_acl_id:
description:
- The id of a Web Application Firewall (WAF) Access Control List (ACL).
type: str
http_version:
description:
- The version of the http protocol to use for the distribution.
choices: [ 'http1.1', 'http2' ]
default: aws defaults this to 'http2'
- AWS defaults this to C(http2).
- Valid values are C(http1.1) and C(http2)
type: str
ipv6_enabled:
description:
- Determines whether IPv6 support is enabled or not.
type: bool
default: 'no'
default: false
wait:
description:
- Specifies whether the module waits until the distribution has completed processing the creation or update.
type: bool
default: 'no'
default: false
wait_timeout:
description:
- Specifies the duration in seconds to wait for a timeout of a cloudfront create or update. Defaults to 1800 seconds (30 minutes).
- Specifies the duration in seconds to wait for a timeout of a cloudfront create or update.
default: 1800
type: int
'''

View file

@ -1,18 +1,10 @@
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
@ -24,7 +16,7 @@ DOCUMENTATION = '''
module: cloudfront_info
short_description: Obtain facts about an AWS CloudFront distribution
description:
- Gets information about an AWS CloudFront distribution
- Gets information about an AWS CloudFront distribution.
- This module was called C(cloudfront_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(cloudfront_info) module no longer returns C(ansible_facts)!
requirements:
@ -38,98 +30,108 @@ options:
- The id of the CloudFront distribution. Used with I(distribution), I(distribution_config),
I(invalidation), I(streaming_distribution), I(streaming_distribution_config), I(list_invalidations).
required: false
type: str
invalidation_id:
description:
- The id of the invalidation to get information about. Used with I(invalidation).
- The id of the invalidation to get information about.
- Used with I(invalidation).
required: false
type: str
origin_access_identity_id:
description:
- The id of the cloudfront origin access identity to get information about.
required: false
web_acl_id:
description:
- Used with I(list_distributions_by_web_acl_id).
- The id of the CloudFront origin access identity to get information about.
required: false
type: str
# web_acl_id:
# description:
# - Used with I(list_distributions_by_web_acl_id).
# required: false
# type: str
domain_name_alias:
description:
- Can be used instead of I(distribution_id) - uses the aliased CNAME for the cloudfront
- Can be used instead of I(distribution_id) - uses the aliased CNAME for the CloudFront
distribution to get the distribution id where required.
required: false
type: str
all_lists:
description:
- Get all cloudfront lists that do not require parameters.
- Get all CloudFront lists that do not require parameters.
required: false
default: false
type: bool
origin_access_identity:
description:
- Get information about an origin access identity. Requires I(origin_access_identity_id)
to be specified.
- Get information about an origin access identity.
- Requires I(origin_access_identity_id) to be specified.
required: false
default: false
type: bool
origin_access_identity_config:
description:
- Get the configuration information about an origin access identity. Requires
I(origin_access_identity_id) to be specified.
- Get the configuration information about an origin access identity.
- Requires I(origin_access_identity_id) to be specified.
required: false
default: false
type: bool
distribution:
description:
- Get information about a distribution. Requires I(distribution_id) or I(domain_name_alias)
to be specified.
- Get information about a distribution.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
required: false
default: false
type: bool
distribution_config:
description:
- Get the configuration information about a distribution. Requires I(distribution_id)
or I(domain_name_alias) to be specified.
- Get the configuration information about a distribution.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
required: false
default: false
type: bool
invalidation:
description:
- Get information about an invalidation. Requires I(invalidation_id) to be specified.
- Get information about an invalidation.
- Requires I(invalidation_id) to be specified.
required: false
default: false
type: bool
streaming_distribution:
description:
- Get information about a specified RTMP distribution. Requires I(distribution_id) or
I(domain_name_alias) to be specified.
- Get information about a specified RTMP distribution.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
required: false
default: false
type: bool
streaming_distribution_config:
description:
- Get the configuration information about a specified RTMP distribution.
Requires I(distribution_id) or I(domain_name_alias) to be specified.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
required: false
default: false
type: bool
list_origin_access_identities:
description:
- Get a list of cloudfront origin access identities. Requires I(origin_access_identity_id) to be set.
- Get a list of CloudFront origin access identities.
- Requires I(origin_access_identity_id) to be set.
required: false
default: false
type: bool
list_distributions:
description:
- Get a list of cloudfront distributions.
- Get a list of CloudFront distributions.
required: false
default: false
type: bool
list_distributions_by_web_acl_id:
description:
- Get a list of distributions using web acl id as a filter. Requires I(web_acl_id) to be set.
- Get a list of distributions using web acl id as a filter.
- Requires I(web_acl_id) to be set.
required: false
default: false
type: bool
list_invalidations:
description:
- Get a list of invalidations. Requires I(distribution_id) or I(domain_name_alias) to be specified.
- Get a list of invalidations.
- Requires I(distribution_id) or I(domain_name_alias) to be specified.
required: false
default: false
type: bool
@ -142,7 +144,7 @@ options:
summary:
description:
- Returns a summary of all distributions, streaming distributions and origin_access_identities.
This is the default behaviour if no option is selected.
- This is the default behaviour if no option is selected.
required: false
default: false
type: bool

View file

@ -2,6 +2,9 @@
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
@ -11,7 +14,7 @@ DOCUMENTATION = '''
module: cloudfront_invalidation
short_description: create invalidations for aws cloudfront distributions
short_description: create invalidations for AWS CloudFront distributions
description:
- Allows for invalidation of a batch of paths for a CloudFront distribution.
@ -30,21 +33,27 @@ extends_documentation_fragment:
options:
distribution_id:
description:
- The id of the cloudfront distribution to invalidate paths for. Can be specified instead of the alias.
- The id of the CloudFront distribution to invalidate paths for. Can be specified instead of the alias.
required: false
type: str
alias:
description:
- The alias of the cloudfront distribution to invalidate paths for. Can be specified instead of distribution_id.
- The alias of the CloudFront distribution to invalidate paths for. Can be specified instead of distribution_id.
required: false
type: str
caller_reference:
description:
- A unique reference identifier for the invalidation paths.
- Defaults to current datetime stamp.
required: false
default: current datetime stamp
default:
type: str
target_paths:
description:
- A list of paths on the distribution to invalidate. Each path should begin with '/'. Wildcards are allowed. eg. '/foo/bar/*'
required: true
type: list
elements: str
notes:
- does not support check mode

View file

@ -2,6 +2,9 @@
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
@ -11,8 +14,8 @@ DOCUMENTATION = '''
module: cloudfront_origin_access_identity
short_description: create, update and delete origin access identities for a
cloudfront distribution.
short_description: Create, update and delete origin access identities for a
cloudfront distribution
description:
- Allows for easy creation, updating and deletion of origin access
@ -36,22 +39,26 @@ options:
choices:
- present
- absent
default: update_origin_access_identity
default: present
type: str
origin_access_identity_id:
description:
- The origin_access_identity_id of the cloudfront distribution.
required: false
type: str
comment:
description:
- A comment to describe the cloudfront origin access identity.
required: false
type: str
caller_reference:
description:
- A unique identifier to reference the origin access identity by.
required: false
type: str
notes:
- does not support check mode
- Does not support check mode.
'''

View file

@ -29,15 +29,20 @@ options:
state:
description:
- Add or remove CloudTrail configuration.
- The following states have been preserved for backwards compatibility. C(state=enabled) and C(state=disabled).
- enabled=present and disabled=absent.
- 'The following states have been preserved for backwards compatibility: I(state=enabled) and I(state=disabled).'
- I(state=enabled) is equivalet to I(state=present).
- I(state=disabled) is equivalet to I(state=absent).
type: str
required: true
choices: ['present', 'absent', 'enabled', 'disabled']
default: present
name:
description:
- Name for the CloudTrail.
- Names are unique per-region unless the CloudTrail is a multi-region trail, in which case it is unique per-account.
type: str
required: true
default: default
enable_logging:
description:
- Start or stop the CloudTrail logging. If stopped the trail will be paused and will not record events or deliver log files.
@ -49,11 +54,13 @@ options:
- An existing S3 bucket where CloudTrail will deliver log files.
- This bucket should exist and have the proper policy.
- See U(https://docs.aws.amazon.com/awscloudtrail/latest/userguide/aggregating_logs_regions_bucket_policy.html).
- Required when C(state=present).
- Required when I(state=present).
type: str
version_added: "2.4"
s3_key_prefix:
description:
- S3 Key prefix for delivered log files. A trailing slash is not necessary and will be removed.
type: str
is_multi_region_trail:
description:
- Specify whether the trail belongs only to one region or exists in all regions.
@ -77,23 +84,27 @@ options:
description:
- SNS Topic name to send notifications to when a log file is delivered.
version_added: "2.4"
type: str
cloudwatch_logs_role_arn:
description:
- Specifies a full ARN for an IAM role that assigns the proper permissions for CloudTrail to create and write to the log group.
- See U(https://docs.aws.amazon.com/awscloudtrail/latest/userguide/send-cloudtrail-events-to-cloudwatch-logs.html).
- Required when C(cloudwatch_logs_log_group_arn).
version_added: "2.4"
type: str
cloudwatch_logs_log_group_arn:
description:
- A full ARN specifying a valid CloudWatch log group to which CloudTrail logs will be delivered. The log group should already exist.
- See U(https://docs.aws.amazon.com/awscloudtrail/latest/userguide/send-cloudtrail-events-to-cloudwatch-logs.html).
- Required when C(cloudwatch_logs_role_arn).
type: str
version_added: "2.4"
kms_key_id:
description:
- Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. This also has the effect of enabling log file encryption.
- The value can be an alias name prefixed by "alias/", a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.
- See U(https://docs.aws.amazon.com/awscloudtrail/latest/userguide/encrypting-cloudtrail-log-files-with-aws-kms.html).
type: str
version_added: "2.4"
tags:
description:
@ -101,6 +112,7 @@ options:
- Remove completely or specify an empty dictionary to remove all tags.
default: {}
version_added: "2.4"
type: dict
extends_documentation_fragment:
- aws

View file

@ -35,47 +35,79 @@ options:
name:
description:
- The name of the rule you are creating, updating or deleting. No spaces
or special characters allowed (i.e. must match C([\.\-_A-Za-z0-9]+))
or special characters allowed (i.e. must match C([\.\-_A-Za-z0-9]+)).
required: true
type: str
schedule_expression:
description:
- A cron or rate expression that defines the schedule the rule will
trigger on. For example, C(cron(0 20 * * ? *)), C(rate(5 minutes))
trigger on. For example, C(cron(0 20 * * ? *)), C(rate(5 minutes)).
required: false
type: str
event_pattern:
description:
- A string pattern (in valid JSON format) that is used to match against
incoming events to determine if the rule should be triggered
incoming events to determine if the rule should be triggered.
required: false
type: str
state:
description:
- Whether the rule is present (and enabled), disabled, or absent
- Whether the rule is present (and enabled), disabled, or absent.
choices: ["present", "disabled", "absent"]
default: present
required: false
type: str
description:
description:
- A description of the rule
- A description of the rule.
required: false
type: str
role_arn:
description:
- The Amazon Resource Name (ARN) of the IAM role associated with the rule
- The Amazon Resource Name (ARN) of the IAM role associated with the rule.
required: false
type: str
targets:
type: list
elements: dict
description:
- "A dictionary array of targets to add to or update for the rule, in the
form C({ id: [string], arn: [string], role_arn: [string], input: [valid JSON string],
input_path: [valid JSONPath string], ecs_parameters: {task_definition_arn: [string], task_count: [int]}}).
I(id) [required] is the unique target assignment ID. I(arn) (required)
is the Amazon Resource Name associated with the target. I(role_arn) (optional) is The Amazon Resource Name
of the IAM role to be used for this target when the rule is triggered. I(input)
(optional) is a JSON object that will override the event data when
passed to the target. I(input_path) (optional) is a JSONPath string
(e.g. C($.detail)) that specifies the part of the event data to be
passed to the target. If neither I(input) nor I(input_path) is
specified, then the entire event is passed to the target in JSON form.
I(task_definition_arn) [optional] is ecs task definition arn.
I(task_count) [optional] is ecs task count."
- A list of targets to add to or update for the rule.
suboptions:
id:
type: str
required: true
description: The unique target assignment ID.
arn:
type: str
required: true
description: The ARN associated with the target.
role_arn:
type: str
description: The ARN of the IAM role to be used for this target when the rule is triggered.
input:
type: str
description:
- A JSON object that will override the event data when passed to the target.
- If neither I(input) nor I(input_path) is specified, then the entire
event is passed to the target in JSON form.
input_path:
type: str
description:
- A JSONPath string (e.g. C($.detail)) that specifies the part of the event data to be
passed to the target.
- If neither I(input) nor I(input_path) is specified, then the entire
event is passed to the target in JSON form.
ecs_parameters:
type: dict
description:
- Contains the ECS task definition and task count to be used, if the event target is an ECS task.
suboptions:
task_definition_arn:
type: str
description: The full ARN of the task definition.
task_count:
type: int
description: The number of tasks to create based on I(task_definition).
required: false
'''

View file

@ -16,7 +16,7 @@ DOCUMENTATION = '''
module: cloudwatchlogs_log_group
short_description: create or delete log_group in CloudWatchLogs
notes:
- for details of the parameters and returns see U(http://boto3.readthedocs.io/en/latest/reference/services/logs.html)
- For details of the parameters and returns see U(http://boto3.readthedocs.io/en/latest/reference/services/logs.html).
description:
- Create or delete log_group in CloudWatchLogs.
version_added: "2.5"
@ -26,33 +26,38 @@ requirements: [ json, botocore, boto3 ]
options:
state:
description:
- Whether the rule is present, absent or get
- Whether the rule is present or absent.
choices: ["present", "absent"]
default: present
required: false
type: str
log_group_name:
description:
- The name of the log group.
required: true
type: str
kms_key_id:
description:
- The Amazon Resource Name (ARN) of the CMK to use when encrypting log data.
required: false
type: str
tags:
description:
- The key-value pairs to use for the tags.
required: false
type: dict
retention:
description:
- "The number of days to retain the log events in the specified log group.
Valid values are: [1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653]"
- The number of days to retain the log events in the specified log group.
- "Valid values are: [1, 3, 5, 7, 14, 30, 60, 90, 120, 150, 180, 365, 400, 545, 731, 1827, 3653]"
required: false
type: int
overwrite:
description:
description:
- Whether an existing log group should be overwritten on create.
default: false
required: false
type: bool
default: false
required: false
type: bool
extends_documentation_fragment:
- aws
- ec2

View file

@ -13,7 +13,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: cloudwatchlogs_log_group_info
short_description: get information about log_group in CloudWatchLogs
short_description: Get information about log_group in CloudWatchLogs
description:
- Lists the specified log groups. You can list all your log groups or filter the results by prefix.
- This module was called C(cloudwatchlogs_log_group_facts) before Ansible 2.9. The usage did not change.
@ -25,6 +25,7 @@ options:
log_group_name:
description:
- The name or prefix of the log group to filter by.
type: str
extends_documentation_fragment:
- aws
- ec2

View file

@ -24,62 +24,112 @@ extends_documentation_fragment:
- aws
- ec2
description:
- Create and manage AWS Datapipelines. Creation is not idempotent in AWS, so the I(uniqueId) is created by hashing the options (minus objects)
- Create and manage AWS Datapipelines. Creation is not idempotent in AWS, so the C(uniqueId) is created by hashing the options (minus objects)
given to the datapipeline.
- The pipeline definition must be in the format given here
U(https://docs.aws.amazon.com/datapipeline/latest/APIReference/API_PutPipelineDefinition.html#API_PutPipelineDefinition_RequestSyntax).
- Also operations will wait for a configurable amount of time to ensure the pipeline is in the requested state.
- Operations will wait for a configurable amount of time to ensure the pipeline is in the requested state.
options:
name:
description:
- The name of the Datapipeline to create/modify/delete.
required: true
type: str
description:
description:
- An optional description for the pipeline being created.
default: ''
type: str
objects:
type: list
elements: dict
description:
- A list of pipeline object definitions, each of which is a dict that takes the keys C(id), C(name) and C(fields).
- A list of pipeline object definitions, each of which is a dict that takes the keys I(id), I(name) and I(fields).
suboptions:
id:
description:
- The ID of the object.
type: str
name:
description:
- The name of the object.
type: str
fields:
description:
- A list of dicts that take the keys C(key) and C(stringValue)/C(refValue).
The value is specified as a reference to another object C(refValue) or as a string value C(stringValue)
- Key-value pairs that define the properties of the object.
- The value is specified as a reference to another object I(refValue) or as a string value I(stringValue)
but not as both.
type: list
elements: dict
suboptions:
key:
type: str
description:
- The field identifier.
stringValue:
type: str
description:
- The field value.
- Exactly one of I(stringValue) and I(refValue) may be specified.
refValue:
type: str
description:
- The field value, expressed as the identifier of another object.
- Exactly one of I(stringValue) and I(refValue) may be specified.
parameters:
description:
- A list of parameter objects (dicts) in the pipeline definition.
type: list
elements: dict
suboptions:
id:
description:
- The ID of the parameter object.
attributes:
description:
- A list of attributes (dicts) of the parameter object. Each attribute takes the keys C(key) and C(stringValue) both
of which are strings.
- A list of attributes (dicts) of the parameter object.
type: list
elements: dict
suboptions:
key:
description: The field identifier.
type: str
stringValue:
description: The field value.
type: str
values:
description:
- A list of parameter values (dicts) in the pipeline definition. Each dict takes the keys C(id) and C(stringValue) both
of which are strings.
- A list of parameter values (dicts) in the pipeline definition.
type: list
elements: dict
suboptions:
id:
description: The ID of the parameter value
type: str
stringValue:
description: The field value
type: str
timeout:
description:
- Time in seconds to wait for the pipeline to transition to the requested state, fail otherwise.
default: 300
type: int
state:
description:
- The requested state of the pipeline.
choices: ['present', 'absent', 'active', 'inactive']
default: present
type: str
tags:
description:
- A dict of key:value pair(s) to add to the pipeline.
type: dict
version:
description:
- The version option has never had any effect and will be removed in
Ansible 2.14
type: str
'''
EXAMPLES = '''
@ -244,7 +294,7 @@ def run_with_timeout(timeout, func, *func_args, **func_kwargs):
"""
for _ in range(timeout // 10):
for count in range(timeout // 10):
if func(*func_args, **func_kwargs):
return True
else:
@ -525,7 +575,7 @@ def create_pipeline(client, module):
if changed == "NEW_VERSION":
# delete old version
changed, _ = delete_pipeline(client, module)
changed, creation_result = delete_pipeline(client, module)
# There isn't a pipeline or it has different parameters than the pipeline in existence.
if create_dp:
@ -544,7 +594,7 @@ def create_pipeline(client, module):
module.fail_json(msg=('Data Pipeline {0} failed to create'
'within timeout {1} seconds').format(dp_name, timeout))
# Put pipeline definition
_, msg = define_pipeline(client, module, objects, dp_id)
changed, msg = define_pipeline(client, module, objects, dp_id)
changed = True
data_pipeline = get_result(client, dp_id)
@ -559,7 +609,7 @@ def main():
argument_spec.update(
dict(
name=dict(required=True),
version=dict(required=False),
version=dict(removed_in_version='2.14'),
description=dict(required=False, default=''),
objects=dict(required=False, type='list', default=[]),
parameters=dict(required=False, type='list', default=[]),

View file

@ -1,18 +1,10 @@
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
@ -22,122 +14,137 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: dms_endpoint
short_description: creates or destroys a data migration services endpoint
short_description: Creates or destroys a data migration services endpoint
description:
- creates or destroys a data migration services endpoint,
- Creates or destroys a data migration services endpoint,
that can be used to replicate data.
version_added: "2.9"
options:
state:
description:
- State of the endpoint
- State of the endpoint.
default: present
choices: ['present', 'absent']
type: str
endpointidentifier:
description:
- An identifier name for the endpoint
- An identifier name for the endpoint.
type: str
endpointtype:
description:
- Type of endpoint we want to manage
- Type of endpoint we want to manage.
choices: ['source', 'target']
type: str
enginename:
description:
- Database engine that we want to use, please refer to
the AWS DMS for more information on the supported
engines and their limitation
engines and their limitations.
choices: ['mysql', 'oracle', 'postgres', 'mariadb', 'aurora',
'redshift', 's3', 'db2', 'azuredb', 'sybase',
'dynamodb', 'mongodb', 'sqlserver']
type: str
username:
description:
- Username our endpoint will use to connect to the database
- Username our endpoint will use to connect to the database.
type: str
password:
description:
- Password used to connect to the database
this attribute can only be written
the AWS API does not return this parameter
the AWS API does not return this parameter.
type: str
servername:
description:
- Servername that the endpoint will connect to
- Servername that the endpoint will connect to.
type: str
port:
description:
- TCP port for access to the database
- TCP port for access to the database.
type: int
databasename:
description:
- Name for the database on the origin or target side
type: str
extraconnectionattributes:
description:
- Extra attributes for the database connection, the AWS documentation
states " For more information about extra connection attributes,
see the documentation section for your data store."
type: str
kmskeyid:
description:
- Encryption key to use to encrypt replication storage and
connection information
connection information.
type: str
tags:
description:
- A list of tags to add to the endpoint
- A list of tags to add to the endpoint.
type: dict
certificatearn:
description:
- Amazon Resource Name (ARN) for the certificate
description:
- Amazon Resource Name (ARN) for the certificate.
type: str
sslmode:
description:
- Mode used for the ssl connection
default: none
choices: ['none', 'require', 'verify-ca', 'verify-full']
description:
- Mode used for the ssl connection
default: none
choices: ['none', 'require', 'verify-ca', 'verify-full']
type: str
serviceaccessrolearn:
description:
- Amazon Resource Name (ARN) for the service access role that you
want to use to create the endpoint.
description:
- Amazon Resource Name (ARN) for the service access role that you
want to use to create the endpoint.
type: str
externaltabledefinition:
description:
- The external table definition
description:
- The external table definition
type: str
dynamodbsettings:
description:
- Settings in JSON format for the target Amazon DynamoDB endpoint
if source or target is dynamodb
description:
- Settings in JSON format for the target Amazon DynamoDB endpoint
if source or target is dynamodb
type: dict
s3settings:
description:
- S3 buckets settings for the target Amazon S3 endpoint.
description:
- S3 buckets settings for the target Amazon S3 endpoint.
type: dict
dmstransfersettings:
description:
- The settings in JSON format for the DMS transfer type of
source endpoint
description:
- The settings in JSON format for the DMS transfer type of
source endpoint
type: dict
mongodbsettings:
description:
- Settings in JSON format for the source MongoDB endpoint
description:
- Settings in JSON format for the source MongoDB endpoint
type: dict
kinesissettings:
description:
- Settings in JSON format for the target Amazon Kinesis
Data Streams endpoint
description:
- Settings in JSON format for the target Amazon Kinesis
Data Streams endpoint
type: dict
elasticsearchsettings:
description:
- Settings in JSON format for the target Elasticsearch endpoint
description:
- Settings in JSON format for the target Elasticsearch endpoint
type: dict
wait:
description:
- should wait for the object to be deleted when state = absent
type: bool
default: 'false'
description:
- should wait for the object to be deleted when state = absent
type: bool
default: 'false'
timeout:
description:
- time in seconds we should wait for when deleting a resource
type: int
description:
- time in seconds we should wait for when deleting a resource
type: int
retries:
description:
- number of times we should retry when deleting a resource
type: int
region:
description:
- aws region, should be read from the running aws config
ec2_region:
description:
- alias for region
aws_region:
description:
- alias for region
description:
- number of times we should retry when deleting a resource
type: int
author:
- "Rui Moreira (@ruimoreira)"
extends_documentation_fragment: aws
extends_documentation_fragment:
- aws
- ec2
'''
EXAMPLES = '''

View file

@ -2,6 +2,10 @@
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}

View file

@ -14,7 +14,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = """
---
module: dynamodb_table
short_description: Create, update or delete AWS Dynamo DB tables.
short_description: Create, update or delete AWS Dynamo DB tables
version_added: "2.0"
description:
- Create or delete AWS Dynamo DB tables.
@ -27,55 +27,102 @@ requirements:
options:
state:
description:
- Create or delete the table
- Create or delete the table.
choices: ['present', 'absent']
default: 'present'
type: str
name:
description:
- Name of the table.
required: true
type: str
hash_key_name:
description:
- Name of the hash key.
- Required when C(state=present).
type: str
hash_key_type:
description:
- Type of the hash key.
choices: ['STRING', 'NUMBER', 'BINARY']
default: 'STRING'
type: str
range_key_name:
description:
- Name of the range key.
type: str
range_key_type:
description:
- Type of the range key.
choices: ['STRING', 'NUMBER', 'BINARY']
default: 'STRING'
type: str
read_capacity:
description:
- Read throughput capacity (units) to provision.
default: 1
type: int
write_capacity:
description:
- Write throughput capacity (units) to provision.
default: 1
type: int
indexes:
description:
- list of dictionaries describing indexes to add to the table. global indexes can be updated. local indexes don't support updates or have throughput.
- "required options: ['name', 'type', 'hash_key_name']"
- "valid types: ['all', 'global_all', 'global_include', 'global_keys_only', 'include', 'keys_only']"
- "other options: ['hash_key_type', 'range_key_name', 'range_key_type', 'includes', 'read_capacity', 'write_capacity']"
suboptions:
name:
description: The name of the index.
type: str
required: true
type:
description:
- The type of index.
- "Valid types: C(all), C(global_all), C(global_include), C(global_keys_only), C(include), C(keys_only)"
type: str
required: true
hash_key_name:
description: The name of the hash-based key.
required: true
type: str
hash_key_type:
description: The type of the hash-based key.
type: str
range_key_name:
description: The name of the range-based key.
type: str
range_key_type:
type: str
description: The type of the range-based key.
includes:
type: list
description: A list of fields to include when using C(global_include) or C(include) indexes.
read_capacity:
description:
- Read throughput capacity (units) to provision for the index.
type: int
write_capacity:
description:
- Write throughput capacity (units) to provision for the index.
type: int
default: []
version_added: "2.1"
type: list
elements: dict
tags:
version_added: "2.4"
description:
- a hash/dictionary of tags to add to the new instance or for starting/stopping instance by tag; '{"key":"value"}' and '{"key":"value","key":"value"}'
- A hash/dictionary of tags to add to the new instance or for starting/stopping instance by tag.
- 'For example: C({"key":"value"}) and C({"key":"value","key2":"value2"})'
type: dict
wait_for_active_timeout:
version_added: "2.4"
description:
- how long before wait gives up, in seconds. only used when tags is set
default: 60
type: int
extends_documentation_fragment:
- aws
- ec2

View file

@ -13,27 +13,29 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: dynamodb_ttl
short_description: set TTL for a given DynamoDB table.
short_description: Set TTL for a given DynamoDB table
description:
- Uses boto3 to set TTL.
- requires botocore version 1.5.24 or higher.
- Requires botocore version 1.5.24 or higher.
version_added: "2.4"
options:
state:
description:
- state to set DynamoDB table to
- State to set DynamoDB table to.
choices: ['enable', 'disable']
required: false
default: enable
type: str
table_name:
description:
- name of the DynamoDB table to work on
- Name of the DynamoDB table to work on.
required: true
type: str
attribute_name:
description:
- the name of the Time to Live attribute used to store the expiration time for items in the table
- this appears to be required by the API even when disabling TTL.
- The name of the Time To Live attribute used to store the expiration time for items in the table.
- This appears to be required by the API even when disabling TTL.
required: true
type: str
author: Ted Timmons (@tedder)
extends_documentation_fragment:

View file

@ -25,32 +25,39 @@ options:
- The short name or full Amazon Resource Name (ARN) of the cluster
that contains the resource to apply attributes.
required: true
type: str
state:
description:
- The desired state of the attributes.
required: false
default: present
choices: ['present', 'absent']
type: str
attributes:
description:
- List of attributes.
required: true
type: list
elements: dict
suboptions:
name:
description:
- The name of the attribute. Up to 128 letters (uppercase and lowercase),
numbers, hyphens, underscores, and periods are allowed.
required: true
type: str
value:
description:
- The value of the attribute. Up to 128 letters (uppercase and lowercase),
numbers, hyphens, underscores, periods, at signs (@), forward slashes, colons,
and spaces are allowed.
required: false
type: str
ec2_instance_id:
description:
- EC2 instance ID of ECS cluster container instance.
required: true
type: str
extends_documentation_fragment:
- aws
- ec2

View file

@ -14,7 +14,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: ecs_cluster
short_description: create or terminate ecs clusters
short_description: Create or terminate ECS clusters.
notes:
- When deleting a cluster, the information returned is the state of the cluster prior to deletion.
- It will also wait for a cluster to have instances registered to it.
@ -26,21 +26,27 @@ requirements: [ boto3 ]
options:
state:
description:
- The desired state of the cluster
- The desired state of the cluster.
required: true
choices: ['present', 'absent', 'has_instances']
type: str
name:
description:
- The cluster name
- The cluster name.
required: true
type: str
delay:
description:
- Number of seconds to wait
- Number of seconds to wait.
required: false
type: int
default: 10
repeat:
description:
- The number of times to wait for the cluster to have an instance
- The number of times to wait for the cluster to have an instance.
required: false
type: int
default: 10
extends_documentation_fragment:
- aws
- ec2

View file

@ -18,48 +18,53 @@ module: ecs_ecr
version_added: "2.3"
short_description: Manage Elastic Container Registry repositories
description:
- Manage Elastic Container Registry repositories
- Manage Elastic Container Registry repositories.
requirements: [ boto3 ]
options:
name:
description:
- the name of the repository
- The name of the repository.
required: true
type: str
registry_id:
description:
- AWS account id associated with the registry.
- If not specified, the default registry is assumed.
required: false
type: str
policy:
description:
- JSON or dict that represents the new policy
- JSON or dict that represents the new policy.
required: false
type: json
force_set_policy:
description:
- if no, prevents setting a policy that would prevent you from
- If I(force_set_policy=false), it prevents setting a policy that would prevent you from
setting another policy in the future.
required: false
default: false
type: bool
delete_policy:
description:
- if yes, remove the policy from the repository
- If yes, remove the policy from the repository.
required: false
default: false
type: bool
image_tag_mutability:
description:
- configure whether repository should be mutable (ie. an already existing tag can be overwritten) or not
- Configure whether repository should be mutable (ie. an already existing tag can be overwritten) or not.
required: false
choices: [mutable, immutable]
default: 'mutable'
version_added: '2.10'
type: str
state:
description:
- create or destroy the repository
- Create or destroy the repository.
required: false
choices: [present, absent]
default: 'present'
type: str
author:
- David M. Lee (@leedm777)
extends_documentation_fragment:

View file

@ -1,18 +1,10 @@
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
@ -22,13 +14,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: ecs_service
short_description: create, terminate, start or stop a service in ecs
short_description: Create, terminate, start or stop a service in ECS
description:
- Creates or terminates ecs services.
- Creates or terminates ECS. services.
notes:
- the service role specified must be assumable (i.e. have a trust relationship for the ecs service, ecs.amazonaws.com)
- for details of the parameters and returns see U(https://boto3.readthedocs.io/en/latest/reference/services/ecs.html)
- An IAM role must have been previously created
- The service role specified must be assumable. (i.e. have a trust relationship for the ecs service, ecs.amazonaws.com)
- For details of the parameters and returns see U(https://boto3.readthedocs.io/en/latest/reference/services/ecs.html).
- An IAM role must have been previously created.
version_added: "2.1"
author:
- "Mark Chance (@Java1Guy)"
@ -40,119 +32,169 @@ requirements: [ json, botocore, boto3 ]
options:
state:
description:
- The desired state of the service
- The desired state of the service.
required: true
choices: ["present", "absent", "deleting"]
type: str
name:
description:
- The name of the service
- The name of the service.
required: true
type: str
cluster:
description:
- The name of the cluster in which the service exists
- The name of the cluster in which the service exists.
required: false
type: str
task_definition:
description:
- The task definition the service will run. This parameter is required when state=present
- The task definition the service will run.
- This parameter is required when I(state=present).
required: false
type: str
load_balancers:
description:
- The list of ELBs defined for this service
- The list of ELBs defined for this service.
required: false
type: list
elements: str
desired_count:
description:
- The count of how many instances of the service. This parameter is required when state=present
- The count of how many instances of the service.
- This parameter is required when I(state=present).
required: false
type: int
client_token:
description:
- Unique, case-sensitive identifier you provide to ensure the idempotency of the request. Up to 32 ASCII characters are allowed.
required: false
type: str
role:
description:
- The name or full Amazon Resource Name (ARN) of the IAM role that allows your Amazon ECS container agent to make calls to your load balancer
on your behalf. This parameter is only required if you are using a load balancer with your service, in a network mode other than `awsvpc`.
on your behalf.
- This parameter is only required if you are using a load balancer with your service in a network mode other than C(awsvpc).
required: false
type: str
delay:
description:
- The time to wait before checking that the service is available
- The time to wait before checking that the service is available.
required: false
default: 10
type: int
repeat:
description:
- The number of times to check that the service is available
- The number of times to check that the service is available.
required: false
default: 10
type: int
force_new_deployment:
description:
- Force deployment of service even if there are no changes
- Force deployment of service even if there are no changes.
required: false
version_added: 2.8
type: bool
deployment_configuration:
description:
- Optional parameters that control the deployment_configuration; format is '{"maximum_percent":<integer>, "minimum_healthy_percent":<integer>}
- Optional parameters that control the deployment_configuration.
- Format is '{"maximum_percent":<integer>, "minimum_healthy_percent":<integer>}
required: false
version_added: 2.3
type: dict
suboptions:
maximum_percent:
type: int
description: Upper limit on the number of tasks in a service that are allowed in the RUNNING or PENDING state during a deployment.
minimum_healthy_percent:
type: int
description: A lower limit on the number of tasks in a service that must remain in the RUNNING state during a deployment.
placement_constraints:
description:
- The placement constraints for the tasks in the service
- The placement constraints for the tasks in the service.
required: false
version_added: 2.4
type: list
elements: dict
suboptions:
placement_strategy:
description:
- The placement strategy objects to use for tasks in your service. You can specify a maximum of 5 strategy rules per service
- The placement strategy objects to use for tasks in your service. You can specify a maximum of 5 strategy rules per service.
required: false
version_added: 2.4
type: list
elements: dict
suboptions:
type:
description: The type of placement strategy.
type: str
field:
description: The field to apply the placement strategy against.
type: str
network_configuration:
description:
- network configuration of the service. Only applicable for task definitions created with C(awsvpc) I(network_mode).
- assign_public_ip requires botocore >= 1.8.4
- Network configuration of the service. Only applicable for task definitions created with I(network_mode=awsvpc).
- I(assign_public_ip) requires botocore >= 1.8.4
type: dict
suboptions:
subnets:
description:
- A list of subnet IDs to associate with the task
version_added: 2.6
type: list
elements: str
security_groups:
description:
- A list of security group names or group IDs to associate with the task
version_added: 2.6
type: list
elements: str
assign_public_ip:
description:
- Whether the task's elastic network interface receives a public IP address. This option requires botocore >= 1.8.4.
- Whether the task's elastic network interface receives a public IP address.
- This option requires botocore >= 1.8.4.
type: bool
version_added: 2.7
launch_type:
description:
- The launch type on which to run your service
- The launch type on which to run your service.
required: false
version_added: 2.7
choices: ["EC2", "FARGATE"]
type: str
health_check_grace_period_seconds:
description:
- Seconds to wait before health checking the freshly added/updated services. This option requires botocore >= 1.8.20.
- Seconds to wait before health checking the freshly added/updated services.
- This option requires botocore >= 1.8.20.
required: false
version_added: 2.8
type: int
service_registries:
description:
- describes service discovery registries this service will register with.
- Describes service discovery registries this service will register with.
type: list
elements: dict
required: false
version_added: 2.8
suboptions:
container_name:
description:
- container name for service discovery registration
type: str
container_port:
description:
- container port for service discovery registration
type: int
arn:
description:
- Service discovery registry ARN
type: str
scheduling_strategy:
description:
- The scheduling strategy, defaults to "REPLICA" if not given to preserve previous behavior
required: false
version_added: 2.8
choices: ["DAEMON", "REPLICA"]
type: str
extends_documentation_fragment:
- aws
- ec2
@ -318,15 +360,122 @@ service:
such as attribute:ecs.availability-zone. For the binpack placement strategy, valid values are CPU and MEMORY.
returned: always
type: str
ansible_facts:
description: Facts about deleted service.
returned: when deleting a service
type: complex
contains:
service:
description: Details of deleted service in the same structure described above for service creation.
description: Details of deleted service.
returned: when service existed and was deleted
type: complex
contains:
clusterArn:
description: The Amazon Resource Name (ARN) of the of the cluster that hosts the service.
returned: always
type: str
desiredCount:
description: The desired number of instantiations of the task definition to keep running on the service.
returned: always
type: int
loadBalancers:
description: A list of load balancer objects
returned: always
type: complex
contains:
loadBalancerName:
description: the name
returned: always
type: str
containerName:
description: The name of the container to associate with the load balancer.
returned: always
type: str
containerPort:
description: The port on the container to associate with the load balancer.
returned: always
type: int
pendingCount:
description: The number of tasks in the cluster that are in the PENDING state.
returned: always
type: int
runningCount:
description: The number of tasks in the cluster that are in the RUNNING state.
returned: always
type: int
serviceArn:
description: The Amazon Resource Name (ARN) that identifies the service. The ARN contains the arn:aws:ecs namespace, followed by the region
of the service, the AWS account ID of the service owner, the service namespace, and then the service name. For example,
arn:aws:ecs:region :012345678910 :service/my-service .
returned: always
type: str
serviceName:
description: A user-generated string used to identify the service
returned: always
type: str
status:
description: The valid values are ACTIVE, DRAINING, or INACTIVE.
returned: always
type: str
taskDefinition:
description: The ARN of a task definition to use for tasks in the service.
returned: always
type: str
deployments:
description: list of service deployments
returned: always
type: list
elements: dict
deploymentConfiguration:
description: dictionary of deploymentConfiguration
returned: always
type: complex
contains:
maximumPercent:
description: maximumPercent param
returned: always
type: int
minimumHealthyPercent:
description: minimumHealthyPercent param
returned: always
type: int
events:
description: list of service events
returned: always
type: list
elements: dict
placementConstraints:
description: List of placement constraints objects
returned: always
type: list
elements: dict
contains:
type:
description: The type of constraint. Valid values are distinctInstance and memberOf.
returned: always
type: str
expression:
description: A cluster query language expression to apply to the constraint. Note you cannot specify an expression if
the constraint type is distinctInstance.
returned: always
type: str
placementStrategy:
description: List of placement strategy objects
returned: always
type: list
elements: dict
contains:
type:
description: The type of placement strategy. Valid values are random, spread and binpack.
returned: always
type: str
field:
description: The field to apply the placement strategy against. For the spread placement strategy, valid values are instanceId
(or host, which has the same effect), or any platform or custom attribute that is applied to a container instance,
such as attribute:ecs.availability-zone. For the binpack placement strategy, valid values are CPU and MEMORY.
returned: always
type: str
'''
import time

View file

@ -13,9 +13,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: ecs_service_info
short_description: list or describe services in ecs
short_description: List or describe services in ECS
description:
- Lists or describes services in ecs.
- Lists or describes services in ECS.
- This module was called C(ecs_service_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(ecs_service_info) module no longer returns C(ansible_facts)!
version_added: "2.1"
@ -28,24 +28,26 @@ options:
description:
- Set this to true if you want detailed information about the services.
required: false
default: 'false'
default: false
type: bool
events:
description:
- Whether to return ECS service events. Only has an effect if C(details) is true.
- Whether to return ECS service events. Only has an effect if I(details=true).
required: false
default: 'true'
default: true
type: bool
version_added: "2.6"
cluster:
description:
- The cluster ARNS in which to list the services.
required: false
default: 'default'
type: str
service:
description:
- One or more services to get details for
required: false
type: list
elements: str
extends_documentation_fragment:
- aws
- ec2

View file

@ -14,7 +14,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: ecs_task
short_description: run, start or stop a task in ecs
short_description: Run, start or stop a task in ecs
description:
- Creates or deletes instances of task definitions.
version_added: "2.0"
@ -23,49 +23,67 @@ requirements: [ json, botocore, boto3 ]
options:
operation:
description:
- Which task operation to execute
- Which task operation to execute.
required: True
choices: ['run', 'start', 'stop']
type: str
cluster:
description:
- The name of the cluster to run the task on
- The name of the cluster to run the task on.
required: False
type: str
task_definition:
description:
- The task definition to start or run
- The task definition to start or run.
required: False
type: str
overrides:
description:
- A dictionary of values to pass to the new instances
- A dictionary of values to pass to the new instances.
required: False
type: dict
count:
description:
- How many new instances to start
- How many new instances to start.
required: False
type: int
task:
description:
- The task to stop
- The task to stop.
required: False
type: str
container_instances:
description:
- The list of container instances on which to deploy the task
- The list of container instances on which to deploy the task.
required: False
type: list
elements: str
started_by:
description:
- A value showing who or what started the task (for informational purposes)
- A value showing who or what started the task (for informational purposes).
required: False
type: str
network_configuration:
description:
- network configuration of the service. Only applicable for task definitions created with C(awsvpc) I(network_mode).
- I(network_configuration) has two keys, I(subnets), a list of subnet IDs to which the task is attached and I(security_groups),
a list of group names or group IDs for the task
- Network configuration of the service. Only applicable for task definitions created with I(network_mode=awsvpc).
type: dict
suboptions:
subnets:
description: A list of subnet IDs to which the task is attached.
type: list
elements: str
security_groups:
description: A list of group names or group IDs for the task.
type: list
elements: str
version_added: 2.6
launch_type:
description:
- The launch type on which to run your service
- The launch type on which to run your service.
required: false
version_added: 2.8
choices: ["EC2", "FARGATE"]
type: str
extends_documentation_fragment:
- aws
- ec2

View file

@ -1,18 +1,10 @@
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
@ -24,38 +16,44 @@ DOCUMENTATION = '''
module: ecs_taskdefinition
short_description: register a task definition in ecs
description:
- Registers or deregisters task definitions in the Amazon Web Services (AWS) EC2 Container Service (ECS)
- Registers or deregisters task definitions in the Amazon Web Services (AWS) EC2 Container Service (ECS).
version_added: "2.0"
author: Mark Chance (@Java1Guy)
requirements: [ json, botocore, boto3 ]
options:
state:
description:
- State whether the task definition should exist or be deleted
- State whether the task definition should exist or be deleted.
required: true
choices: ['present', 'absent']
type: str
arn:
description:
- The arn of the task description to delete
- The ARN of the task description to delete.
required: false
type: str
family:
description:
- A Name that would be given to the task definition
- A Name that would be given to the task definition.
required: false
type: str
revision:
description:
- A revision number for the task definition
- A revision number for the task definition.
required: False
type: int
force_create:
description:
- Always create new task definition
- Always create new task definition.
required: False
version_added: 2.5
type: bool
containers:
description:
- A list of containers definitions
- A list of containers definitions.
required: False
type: list
elements: str
network_mode:
description:
- The Docker networking mode to use for the containers in the task.
@ -64,39 +62,52 @@ options:
default: bridge
choices: [ 'bridge', 'host', 'none', 'awsvpc' ]
version_added: 2.3
type: str
task_role_arn:
description:
- The Amazon Resource Name (ARN) of the IAM role that containers in this task can assume. All containers in this task are granted
the permissions that are specified in this role.
required: false
version_added: 2.3
type: str
execution_role_arn:
description:
- The Amazon Resource Name (ARN) of the task execution role that the Amazon ECS container agent and the Docker daemon can assume.
required: false
version_added: 2.7
type: str
volumes:
description:
- A list of names of volumes to be attached
- A list of names of volumes to be attached.
required: False
type: list
elements: dict
suboptions:
name:
type: str
description: The name of the volume.
required: true
launch_type:
description:
- The launch type on which to run your task
- The launch type on which to run your task.
required: false
version_added: 2.7
type: str
choices: ["EC2", "FARGATE"]
cpu:
description:
- The number of cpu units used by the task. If using the EC2 launch type, this field is optional and any value can be used.
If using the Fargate launch type, this field is required and you must use one of [256, 512, 1024, 2048, 4096]
- If using the Fargate launch type, this field is required and you must use one of C(256), C(512), C(1024), C(2048), C(4096).
required: false
version_added: 2.7
type: str
memory:
description:
- The amount (in MiB) of memory used by the task. If using the EC2 launch type, this field is optional and any value can be used.
If using the Fargate launch type, this field is required and is limited by the cpu
- If using the Fargate launch type, this field is required and is limited by the cpu.
required: false
version_added: 2.7
type: str
extends_documentation_fragment:
- aws
- ec2

View file

@ -13,13 +13,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = '''
---
module: ecs_taskdefinition_info
short_description: describe a task definition in ecs
short_description: Describe a task definition in ECS
notes:
- for details of the parameters and returns see
- For details of the parameters and returns see
U(http://boto3.readthedocs.io/en/latest/reference/services/ecs.html#ECS.Client.describe_task_definition)
- This module was called C(ecs_taskdefinition_facts) before Ansible 2.9. The usage did not change.
description:
- Describes a task definition in ecs.
- Describes a task definition in ECS.
version_added: "2.5"
author:
- Gustavo Maia (@gurumaia)
@ -31,6 +31,7 @@ options:
description:
- The name of the task definition to get details for
required: true
type: str
extends_documentation_fragment:
- aws
- ec2

View file

@ -16,7 +16,7 @@ DOCUMENTATION = '''
module: efs
short_description: create and maintain EFS file systems
description:
- Module allows create, search and destroy Amazon EFS file systems
- Module allows create, search and destroy Amazon EFS file systems.
version_added: "2.2"
requirements: [ boto3 ]
author:
@ -25,10 +25,9 @@ author:
options:
encrypt:
description:
- A boolean value that, if true, creates an encrypted file system. This can not be modified after the file
system is created.
- If I(encrypt=true) creates an encrypted file system. This can not be modified after the file system is created.
type: bool
default: 'no'
default: false
version_added: 2.5
kms_key_id:
description:
@ -36,46 +35,63 @@ options:
required if you want to use a non-default CMK. If this parameter is not specified, the default CMK for
Amazon EFS is used. The key id can be Key ID, Key ID ARN, Key Alias or Key Alias ARN.
version_added: 2.5
type: str
purge_tags:
description:
- If yes, existing tags will be purged from the resource to match exactly what is defined by I(tags) parameter. If the I(tags) parameter
is not set then tags will not be modified.
type: bool
default: 'yes'
default: true
version_added: 2.5
state:
description:
- Allows to create, search and destroy Amazon EFS file system
- Allows to create, search and destroy Amazon EFS file system.
default: 'present'
choices: ['present', 'absent']
type: str
name:
description:
- Creation Token of Amazon EFS file system. Required for create and update. Either name or ID required for delete.
type: str
id:
description:
- ID of Amazon EFS. Either name or ID required for delete.
type: str
performance_mode:
description:
- File system's performance mode to use. Only takes effect during creation.
default: 'general_purpose'
choices: ['general_purpose', 'max_io']
type: str
tags:
description:
- "List of tags of Amazon EFS. Should be defined as dictionary
In case of 'present' state with list of tags and existing EFS (matched by 'name'), tags of EFS will be replaced with provided data."
type: dict
targets:
description:
- "List of mounted targets. It should be a list of dictionaries, every dictionary should include next attributes:
- subnet_id - Mandatory. The ID of the subnet to add the mount target in.
- ip_address - Optional. A valid IPv4 address within the address range of the specified subnet.
- security_groups - Optional. List of security group IDs, of the form 'sg-xxxxxxxx'. These must be for the same VPC as subnet specified
This data may be modified for existing EFS using state 'present' and new list of mount targets."
type: list
elements: dict
suboptions:
subnet_id:
required: true
description: The ID of the subnet to add the mount target in.
ip_address:
type: str
description: A valid IPv4 address within the address range of the specified subnet.
security_groups:
type: list
elements: str
description: List of security group IDs, of the form 'sg-xxxxxxxx'. These must be for the same VPC as subnet specified
throughput_mode:
description:
- The throughput_mode for the file system to be created.
- Requires botocore >= 1.10.57
choices: ['bursting', 'provisioned']
version_added: 2.8
type: str
provisioned_throughput_in_mibps:
description:
- If the throughput_mode is provisioned, select the amount of throughput to provisioned in Mibps.
@ -87,11 +103,12 @@ options:
- "In case of 'present' state should wait for EFS 'available' life cycle state (of course, if current state not 'deleting' or 'deleted')
In case of 'absent' state should wait for EFS 'deleted' life cycle state"
type: bool
default: 'no'
default: false
wait_timeout:
description:
- How long the module should wait (in seconds) for desired state before returning. Zero means wait as long as necessary.
default: 0
type: int
extends_documentation_fragment:
- aws
@ -714,7 +731,7 @@ def main():
if not HAS_BOTO3:
module.fail_json(msg='boto3 required for this module')
region, _, aws_connect_params = get_aws_connection_info(module, boto3=True)
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True)
connection = EFSConnection(module, region, **aws_connect_params)
name = module.params.get('name')

View file

@ -28,16 +28,21 @@ options:
description:
- Creation Token of Amazon EFS file system.
aliases: [ creation_token ]
type: str
id:
description:
- ID of Amazon EFS.
type: str
tags:
description:
- List of tags of Amazon EFS. Should be defined as dictionary.
type: dict
targets:
description:
- List of targets on which to filter the returned results.
- Result must match all of the specified targets, each of which can be a security group ID, a subnet ID or an IP address.
type: list
elements: str
extends_documentation_fragment:
- aws
- ec2
@ -370,7 +375,7 @@ def main():
module.deprecate("The 'efs_facts' module has been renamed to 'efs_info', "
"and the renamed one no longer returns ansible_facts", version='2.13')
region, _, aws_connect_params = get_aws_connection_info(module, boto3=True)
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True)
connection = EFSConnection(module, region, **aws_connect_params)
name = module.params.get('name')

View file

@ -1,8 +1,12 @@
#!/usr/bin/python
#
# Copyright (c) 2017 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
@ -11,9 +15,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = """
---
module: elasticache
short_description: Manage cache clusters in Amazon Elasticache.
short_description: Manage cache clusters in Amazon ElastiCache
description:
- Manage cache clusters in Amazon Elasticache.
- Manage cache clusters in Amazon ElastiCache.
- Returns information about the specified cache cluster.
version_added: "1.4"
requirements: [ boto3 ]
@ -21,62 +25,80 @@ author: "Jim Dalton (@jsdalton)"
options:
state:
description:
- C(absent) or C(present) are idempotent actions that will create or destroy a cache cluster as needed. C(rebooted) will reboot the cluster,
resulting in a momentary outage.
- C(absent) or C(present) are idempotent actions that will create or destroy a cache cluster as needed.
- C(rebooted) will reboot the cluster, resulting in a momentary outage.
choices: ['present', 'absent', 'rebooted']
required: true
type: str
name:
description:
- The cache cluster identifier
- The cache cluster identifier.
required: true
type: str
engine:
description:
- Name of the cache engine to be used.
- Supported values are C(redis) and C(memcached).
default: memcached
choices: ['redis', 'memcached']
type: str
cache_engine_version:
description:
- The version number of the cache engine
- The version number of the cache engine.
type: str
node_type:
description:
- The compute and memory capacity of the nodes in the cache cluster
default: cache.m1.small
- The compute and memory capacity of the nodes in the cache cluster.
default: cache.t2.small
type: str
num_nodes:
description:
- The initial number of cache nodes that the cache cluster will have. Required when state=present.
- The initial number of cache nodes that the cache cluster will have.
- Required when I(state=present).
type: int
default: 1
cache_port:
description:
- The port number on which each of the cache nodes will accept connections
- The port number on which each of the cache nodes will accept
connections.
type: int
cache_parameter_group:
description:
- The name of the cache parameter group to associate with this cache cluster. If this argument is omitted, the default cache parameter group
for the specified engine will be used.
version_added: "2.0"
aliases: [ 'parameter_group' ]
type: str
cache_subnet_group:
description:
- The subnet group name to associate with. Only use if inside a vpc. Required if inside a vpc
- The subnet group name to associate with. Only use if inside a vpc.
- Required if inside a vpc
version_added: "2.0"
type: str
security_group_ids:
description:
- A list of vpc security group IDs to associate with this cache cluster. Only use if inside a vpc
- A list of vpc security group IDs to associate with this cache cluster. Only use if inside a vpc.
type: list
elements: str
version_added: "1.6"
cache_security_groups:
description:
- A list of cache security group names to associate with this cache cluster. Must be an empty list if inside a vpc
- A list of cache security group names to associate with this cache cluster. Must be an empty list if inside a vpc.
type: list
elements: str
zone:
description:
- The EC2 Availability Zone in which the cache cluster will be created
- The EC2 Availability Zone in which the cache cluster will be created.
type: str
wait:
description:
- Wait for cache cluster result before returning
- Wait for cache cluster result before returning.
type: bool
default: 'yes'
default: true
hard_modify:
description:
- Whether to destroy and recreate an existing cache cluster if necessary in order to modify its state
- Whether to destroy and recreate an existing cache cluster if necessary in order to modify its state.
type: bool
default: 'no'
default: false
extends_documentation_fragment:
- aws
- ec2

View file

@ -2,21 +2,26 @@
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
module: elasticache_info
short_description: Retrieve information for AWS Elasticache clusters
short_description: Retrieve information for AWS ElastiCache clusters
description:
- Retrieve information from AWS Elasticache clusters
- Retrieve information from AWS ElastiCache clusters
- This module was called C(elasticache_facts) before Ansible 2.9. The usage did not change.
version_added: "2.5"
options:
name:
description:
- The name of an Elasticache cluster
- The name of an ElastiCache cluster.
type: str
author:
- Will Thames (@willthames)
@ -26,17 +31,17 @@ extends_documentation_fragment:
'''
EXAMPLES = '''
- name: obtain all Elasticache information
- name: obtain all ElastiCache information
elasticache_info:
- name: obtain all information for a single Elasticache cluster
- name: obtain all information for a single ElastiCache cluster
elasticache_info:
name: test_elasticache
'''
RETURN = '''
elasticache_clusters:
description: List of elasticache clusters
description: List of ElastiCache clusters
returned: always
type: complex
contains:
@ -56,17 +61,17 @@ elasticache_clusters:
type: str
sample: abcd-1234-001
cache_cluster_status:
description: Status of Elasticache cluster
description: Status of ElastiCache cluster
returned: always
type: str
sample: available
cache_node_type:
description: Instance type of Elasticache nodes
description: Instance type of ElastiCache nodes
returned: always
type: str
sample: cache.t2.micro
cache_nodes:
description: List of Elasticache nodes in the cluster
description: List of ElastiCache nodes in the cluster
returned: always
type: complex
contains:
@ -137,7 +142,7 @@ elasticache_clusters:
sample:
- 'sg-abcd1234'
cache_subnet_group_name:
description: Elasticache Subnet Group used by the cache
description: ElastiCache Subnet Group used by the cache
returned: always
type: str
sample: abcd-subnet-group
@ -147,12 +152,12 @@ elasticache_clusters:
type: str
sample: 'https://console.aws.amazon.com/elasticache/home#client-download:'
engine:
description: Engine used by elasticache
description: Engine used by ElastiCache
returned: always
type: str
sample: redis
engine_version:
description: Version of elasticache engine
description: Version of ElastiCache engine
returned: always
type: str
sample: 3.2.4
@ -197,7 +202,7 @@ elasticache_clusters:
type: str
sample: replication-001
security_groups:
description: List of Security Groups associated with Elasticache
description: List of Security Groups associated with ElastiCache
returned: always
type: complex
contains:
@ -212,9 +217,10 @@ elasticache_clusters:
type: str
sample: active
tags:
description: Tags applied to the elasticache cluster
description: Tags applied to the ElastiCache cluster
returned: always
type: complex
contains: {}
sample:
Application: web
Environment: test

View file

@ -1,18 +1,10 @@
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
@ -22,9 +14,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = """
---
module: elasticache_parameter_group
short_description: Manage cache security groups in Amazon Elasticache.
short_description: Manage cache security groups in Amazon ElastiCache.
description:
- Manage cache security groups in Amazon Elasticache.
- Manage cache security groups in Amazon ElastiCache.
- Returns information about the specified cache cluster.
version_added: "2.3"
author: "Sloane Hertel (@s-hertel)"
@ -38,21 +30,26 @@ options:
- The name of the cache parameter group family that the cache parameter group can be used with.
Required when creating a cache parameter group.
choices: ['memcached1.4', 'memcached1.5', 'redis2.6', 'redis2.8', 'redis3.2', 'redis4.0', 'redis5.0']
type: str
name:
description:
- A user-specified name for the cache parameter group.
required: yes
type: str
description:
description:
- A user-specified description for the cache parameter group.
type: str
state:
description:
- Idempotent actions that will create/modify, destroy, or reset a cache parameter group as needed.
choices: ['present', 'absent', 'reset']
required: true
type: str
values:
description:
- A user-specified dictionary of parameters to reset or modify for the cache parameter group.
type: dict
"""
EXAMPLES = """
@ -288,7 +285,7 @@ def main():
group_family=dict(type='str', choices=['memcached1.4', 'memcached1.5', 'redis2.6', 'redis2.8', 'redis3.2', 'redis4.0', 'redis5.0']),
name=dict(required=True, type='str'),
description=dict(default='', type='str'),
state=dict(required=True),
state=dict(required=True, choices=['present', 'absent', 'reset']),
values=dict(type='dict'),
)
)

View file

@ -14,9 +14,9 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = """
---
module: elasticache_snapshot
short_description: Manage cache snapshots in Amazon Elasticache.
short_description: Manage cache snapshots in Amazon ElastiCache.
description:
- Manage cache snapshots in Amazon Elasticache.
- Manage cache snapshots in Amazon ElastiCache.
- Returns information about the specified snapshot.
version_added: "2.3"
author: "Sloane Hertel (@s-hertel)"
@ -27,24 +27,30 @@ requirements: [ boto3, botocore ]
options:
name:
description:
- The name of the snapshot we want to create, copy, delete
- The name of the snapshot we want to create, copy, delete.
required: yes
type: str
state:
description:
- Actions that will create, destroy, or copy a snapshot.
choices: ['present', 'absent', 'copy']
type: str
replication_id:
description:
- The name of the existing replication group to make the snapshot.
type: str
cluster_id:
description:
- The name of an existing cache cluster in the replication group to make the snapshot.
type: str
target:
description:
- The name of a snapshot copy
- The name of a snapshot copy.
type: str
bucket:
description:
- The s3 bucket to which the snapshot is exported
- The s3 bucket to which the snapshot is exported.
type: str
"""
EXAMPLES = """
@ -125,7 +131,7 @@ from ansible.module_utils.ec2 import boto3_conn, get_aws_connection_info, ec2_ar
def create(module, connection, replication_id, cluster_id, name):
""" Create an Elasticache backup. """
""" Create an ElastiCache backup. """
try:
response = connection.create_snapshot(ReplicationGroupId=replication_id,
CacheClusterId=cluster_id,
@ -141,7 +147,7 @@ def create(module, connection, replication_id, cluster_id, name):
def copy(module, connection, name, target, bucket):
""" Copy an Elasticache backup. """
""" Copy an ElastiCache backup. """
try:
response = connection.copy_snapshot(SourceSnapshotName=name,
TargetSnapshotName=target,
@ -153,7 +159,7 @@ def copy(module, connection, name, target, bucket):
def delete(module, connection, name):
""" Delete an Elasticache backup. """
""" Delete an ElastiCache backup. """
try:
response = connection.delete_snapshot(SnapshotName=name)
changed = True

View file

@ -15,26 +15,30 @@ DOCUMENTATION = '''
---
module: elasticache_subnet_group
version_added: "2.0"
short_description: manage Elasticache subnet groups
short_description: manage ElastiCache subnet groups
description:
- Creates, modifies, and deletes Elasticache subnet groups. This module has a dependency on python-boto >= 2.5.
- Creates, modifies, and deletes ElastiCache subnet groups. This module has a dependency on python-boto >= 2.5.
options:
state:
description:
- Specifies whether the subnet should be present or absent.
required: true
default: present
choices: [ 'present' , 'absent' ]
type: str
name:
description:
- Database subnet group identifier.
required: true
type: str
description:
description:
- Elasticache subnet group description. Only set when a new group is added.
- ElastiCache subnet group description. Only set when a new group is added.
type: str
subnets:
description:
- List of subnet IDs that make up the Elasticache subnet group.
- List of subnet IDs that make up the ElastiCache subnet group.
type: list
elements: str
author: "Tim Mahoney (@timmahoney)"
extends_documentation_fragment:
- aws

View file

@ -489,53 +489,6 @@ lib/ansible/modules/cloud/alicloud/ali_instance.py validate-modules:parameter-ty
lib/ansible/modules/cloud/alicloud/ali_instance.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/alicloud/ali_instance_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/alicloud/ali_instance_info.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudformation.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/cloudformation.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/cloudformation.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudformation_info.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudformation_stack_set.py validate-modules:undocumented-parameter
lib/ansible/modules/cloud/amazon/cloudformation_stack_set.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/cloudformation_stack_set.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudformation_stack_set.py validate-modules:missing-suboption-docs
lib/ansible/modules/cloud/amazon/cloudfront_distribution.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/cloudfront_distribution.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/cloudfront_distribution.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/cloudfront_distribution.py validate-modules:doc-choices-do-not-match-spec
lib/ansible/modules/cloud/amazon/cloudfront_distribution.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/cloudfront_distribution.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudfront_info.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/cloudfront_info.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/cloudfront_info.py validate-modules:nonexistent-parameter-documented
lib/ansible/modules/cloud/amazon/cloudfront_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/cloudfront_invalidation.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/cloudfront_invalidation.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/cloudfront_invalidation.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/cloudfront_invalidation.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/cloudfront_invalidation.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudfront_origin_access_identity.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/cloudfront_origin_access_identity.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/cloudfront_origin_access_identity.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/cloudfront_origin_access_identity.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudtrail.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/cloudtrail.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/cloudtrail.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/cloudwatchevent_rule.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/cloudwatchlogs_log_group_info.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/data_pipeline.py pylint:blacklisted-name
lib/ansible/modules/cloud/amazon/data_pipeline.py validate-modules:undocumented-parameter
lib/ansible/modules/cloud/amazon/data_pipeline.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/data_pipeline.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/dms_endpoint.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/dms_endpoint.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/dms_endpoint.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/dms_replication_subnet_group.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/dynamodb_table.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/dynamodb_table.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/dynamodb_ttl.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/dynamodb_ttl.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/ec2.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/ec2.py validate-modules:undocumented-parameter
@ -643,52 +596,6 @@ lib/ansible/modules/cloud/amazon/ec2_vol.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ec2_vol_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_win_password.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ec2_win_password.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ecs_attribute.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ecs_attribute.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ecs_cluster.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/ecs_cluster.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ecs_cluster.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ecs_ecr.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ecs_ecr.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ecs_service.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/ecs_service.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/ecs_service.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ecs_service.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ecs_service.py validate-modules:return-syntax-error
lib/ansible/modules/cloud/amazon/ecs_service_info.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/ecs_service_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ecs_service_info.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ecs_task.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ecs_task.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/ecs_taskdefinition_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/efs.py pylint:blacklisted-name
lib/ansible/modules/cloud/amazon/efs.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/efs_info.py pylint:blacklisted-name
lib/ansible/modules/cloud/amazon/efs_info.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/efs_info.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/elasticache.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/elasticache.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/elasticache.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/elasticache.py validate-modules:doc-choices-do-not-match-spec
lib/ansible/modules/cloud/amazon/elasticache.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/elasticache.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/elasticache_info.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/elasticache_info.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/elasticache_info.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/elasticache_info.py validate-modules:return-syntax-error
lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py validate-modules:doc-choices-do-not-match-spec
lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/elasticache_parameter_group.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/elasticache_snapshot.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/elasticache_subnet_group.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/cloud/amazon/elasticache_subnet_group.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/cloud/amazon/elasticache_subnet_group.py validate-modules:doc-missing-type
lib/ansible/modules/cloud/amazon/execute_lambda.py future-import-boilerplate
lib/ansible/modules/cloud/amazon/execute_lambda.py metaclass-boilerplate
lib/ansible/modules/cloud/amazon/execute_lambda.py validate-modules:doc-default-does-not-match-spec