community.aws.elasticache module – Manage cache clusters in Amazon ElastiCache
Note
This module is part of the community.aws collection (version 5.0.0).
To install it, use: ansible-galaxy collection install community.aws.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.aws.elasticache.
New in community.aws 1.0.0
Synopsis
Manage cache clusters in Amazon ElastiCache.
Returns information about the specified cache cluster.
Requirements
The below requirements are needed on the host that executes this module.
python >= 3.6
boto3 >= 1.18.0
botocore >= 1.21.0
Parameters
Parameter |
Comments |
|---|---|
The aws_access_key and profile options are mutually exclusive. |
|
The location of a CA Bundle to use when validating SSL certificates. Note: The CA Bundle is read ‘module’ side and may need to be explicitly copied from the controller if not run locally. |
|
A dictionary to modify the botocore configuration. Parameters can be found at https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html#botocore.config.Config. |
|
The aws_secret_key and profile options are mutually exclusive. |
|
The version number of the cache engine. |
|
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. |
|
The port number on which each of the cache nodes will accept connections. |
|
A list of cache security group names to associate with this cache cluster. Don’t use if your Cache is inside a VPC. In that case use security_group_ids instead! |
|
The subnet group name to associate with. Only use if inside a VPC. Required if inside a VPC. |
|
Use a botocore.endpoint logger to parse the unique (rather than total) “resource:action” API calls made during a task, outputing the set to the resource_actions key in the task results. Use the aws_resource_action callback to output to total list made during a playbook. The ANSIBLE_DEBUG_BOTOCORE_LOGS environment variable may also be used. Choices:
|
|
URL to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Ignored for modules where region is required. Must be specified for all other modules if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used. |
|
Name of the cache engine to be used. Supported values are Default: “memcached” |
|
Whether to destroy and recreate an existing cache cluster if necessary in order to modify its state. Defaults to Choices:
|
|
The cache cluster identifier. |
|
The compute and memory capacity of the nodes in the cache cluster. Default: “cache.t2.small” |
|
The initial number of cache nodes that the cache cluster will have. Required when state=present. Default: 1 |
|
The profile option is mutually exclusive with the aws_access_key, aws_secret_key and security_token options. |
|
The AWS region to use. If not specified then the value of the AWS_REGION or EC2_REGION environment variable, if any, is used. See http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region |
|
A list of VPC security group IDs to associate with this cache cluster. Only use if inside a VPC. |
|
The security_token and profile options are mutually exclusive. Aliases aws_session_token and session_token have been added in version 3.2.0. |
|
Choices:
|
|
When set to “no”, SSL certificates will not be validated for communication with the AWS APIs. Choices:
|
|
Wait for cache cluster result before returning. Choices:
|
|
The EC2 Availability Zone in which the cache cluster will be created. |
Notes
Note
If parameters are not set within the module, the following environment variables can be used in decreasing order of precedence
AWS_URLorEC2_URL,AWS_PROFILEorAWS_DEFAULT_PROFILE,AWS_ACCESS_KEY_IDorAWS_ACCESS_KEYorEC2_ACCESS_KEY,AWS_SECRET_ACCESS_KEYorAWS_SECRET_KEYorEC2_SECRET_KEY,AWS_SECURITY_TOKENorEC2_SECURITY_TOKEN,AWS_REGIONorEC2_REGION,AWS_CA_BUNDLEWhen no credentials are explicitly provided the AWS SDK (boto3) that Ansible uses will fall back to its configuration files (typically
~/.aws/credentials). See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html for more information.AWS_REGIONorEC2_REGIONcan be typically be used to specify the AWS region, when required, but this can also be defined in the configuration files.
Examples
# Note: None of these examples set aws_access_key, aws_secret_key, or region.
# It is assumed that their matching environment variables are set.
- name: Basic example
community.aws.elasticache:
name: "test-please-delete"
state: present
engine: memcached
cache_engine_version: 1.4.14
node_type: cache.m1.small
num_nodes: 1
cache_port: 11211
cache_security_groups:
- default
zone: us-east-1d
- name: Ensure cache cluster is gone
community.aws.elasticache:
name: "test-please-delete"
state: absent
- name: Reboot cache cluster
community.aws.elasticache:
name: "test-please-delete"
state: rebooted