boto3_elasticache

Execution module for Amazon Elasticache using boto3.

depends:
  • boto3 >= 1.28.0

  • botocore >= 1.31.0

configuration:

This module accepts explicit elasticache credentials but can also utilize IAM roles assigned to the instance through Instance Profiles. Dynamic credentials are then automatically obtained from AWS API and no further configuration is necessary. More Information available at:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

If IAM roles are not used you need to specify them either in the minion’s config file or as a profile. For example, to specify them in the minion’s config file:

elasticache.keyid: GKTADJGHEIQSXMKKRBJ08H
elasticache.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

A region may also be specified in the configuration:

elasticache.region: us-east-1

If a region is not specified, the default is us-east-1.

It’s also possible to specify key, keyid and region via a profile, either as a passed in dict, or as a string to pull from pillars or minion config:

myprofile:
    keyid: GKTADJGHEIQSXMKKRBJ08H
    key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
    region: us-east-1

Added in version 1.0.0.

saltext.boto3.modules.boto3_elasticache.__virtual__()[source]

Only load if boto3 is available. Minimum version is enforced via the project’s pyproject.toml dependency declaration.

saltext.boto3.modules.boto3_elasticache.describe_cache_clusters(name=None, conn=None, region=None, key=None, keyid=None, profile=None, **args)[source]

Return details about all (or just one) Elasticache cache clusters.

name (str, optional):

The name of the cache cluster to describe. If not provided, all cache clusters will be described.

conn (boto3.client, optional):

The boto3 connection object. If not provided, a new connection will be created using the provided AWS credentials.

region (str, optional):

The AWS region where the cache cluster is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional parameters that are passed to the boto3 client method.

CLI Example:

salt-call boto3_elasticache.describe_cache_clusters myelasticache
saltext.boto3.modules.boto3_elasticache.cache_cluster_exists(name, conn=None, region=None, key=None, keyid=None, profile=None)[source]

Check to see if a cache cluster exists.

name (str):

The name of the cache cluster to check for existence.

conn (boto3.client, optional):

The boto3 connection object. If not provided, a new connection will be created using the provided AWS credentials.

region (str, optional):

The AWS region where the cache cluster is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional parameters that are passed to the boto3 client method.

CLI Example:

salt-call boto3_elasticache.cache_cluster_exists myelasticache
saltext.boto3.modules.boto3_elasticache.create_cache_cluster(name, wait=600, security_groups=None, region=None, key=None, keyid=None, profile=None, **args)[source]

Create a cache cluster.

name (str):

The name of the cache cluster to create.

wait (int, optional):

The number of seconds to wait for the cache cluster to become available.

security_groups (list[str], optional):

A list of security group IDs to associate with the cache cluster.

region (str, optional):

The AWS region where the cache cluster will be created.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional parameters that are passed to the boto3 client method.

CLI Example:

salt-call boto3_elasticache.create_cache_cluster myelasticache
saltext.boto3.modules.boto3_elasticache.modify_cache_cluster(name, wait=600, security_groups=None, region=None, key=None, keyid=None, profile=None, **args)[source]

Update a cache cluster in place.

Note

{ApplyImmediately: False} is pretty danged silly in the context of salt. You can pass it, but for fairly obvious reasons the results over multiple runs will be undefined and probably contrary to your desired state. Reducing the number of nodes requires an EXPLICIT CacheNodeIdsToRemove be passed, which until a reasonable heuristic for programmatically deciding which nodes to remove has been established, MUST be decided and populated intentionally before a state call, and removed again before the next. In practice this is not particularly useful and should probably be avoided.

name (str):

The name of the cache cluster to modify.

wait (int, optional):

The number of seconds to wait for the cache cluster to become available.

security_groups (list[str], optional):

A list of security group IDs to associate with the cache cluster.

region (str, optional):

The AWS region where the cache cluster is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional parameters that are passed to the boto3 client method.

CLI Example:

salt-call boto3_elasticache.modify_cache_cluster myelasticache --security-groups sg-11223344
saltext.boto3.modules.boto3_elasticache.delete_cache_cluster(name, wait=600, region=None, key=None, keyid=None, profile=None, **args)[source]

Delete a cache cluster.

name (str):

The name of the cache cluster to delete.

wait (int, optional):

The number of seconds to wait for the cache cluster to be deleted.

region (str, optional):

The AWS region where the cache cluster is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional parameters that are passed to the boto3 client method.

CLI Example:

salt-call boto3_elasticache.delete_cache_cluster myelasticache
saltext.boto3.modules.boto3_elasticache.describe_replication_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None)[source]

Return details about all (or just one) Elasticache replication groups.

name (str, optional):

The name of the replication group to describe. If not provided, all replication groups will be returned.

region (str, optional):

The AWS region where the replication group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt-call boto3_elasticache.describe_replication_groups myelasticache
saltext.boto3.modules.boto3_elasticache.replication_group_exists(name, region=None, key=None, keyid=None, profile=None)[source]

Check to see if a replication group exists.

name (str):

The name of the replication group to check for existence.

region (str, optional):

The AWS region where the replication group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt-call boto3_elasticache.replication_group_exists myelasticache
saltext.boto3.modules.boto3_elasticache.create_replication_group(name, wait=600, security_groups=None, region=None, key=None, keyid=None, profile=None, **args)[source]

Create a replication group. Params are extensive and variable - see http://boto3.readthedocs.io/en/latest/reference/services/elasticache.html?#ElastiCache.Client.create_replication_group for in-depth usage documentation.

name (str):

The name of the replication group to create.

wait (int, optional):

The number of seconds to wait for the replication group to be created.

security_groups (list, optional):

A list of security groups to associate with the replication group.

region (str, optional):

The AWS region where the replication group will be created.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (dict, optional):

Additional arguments to pass to the create_replication_group call.

CLI Example:

salt-call boto3_elasticache.create_replication_group myelasticache
saltext.boto3.modules.boto3_elasticache.modify_replication_group(name, wait=600, security_groups=None, region=None, key=None, keyid=None, profile=None, **args)[source]

Modify a replication group.

name (str):

The name of the replication group to modify.

wait (int, optional):

The number of seconds to wait for the replication group to be modified.

security_groups (list, optional):

A list of security groups to associate with the replication group.

region (str, optional):

The AWS region where the replication group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (dict, optional):

Additional arguments to pass to the modify_replication_group call.

CLI Example:

salt-call boto3_elasticache.modify_replication_group myelasticache
saltext.boto3.modules.boto3_elasticache.delete_replication_group(name, wait=600, region=None, key=None, keyid=None, profile=None, **args)[source]

Delete an ElastiCache replication group, optionally taking a snapshot first.

name (str):

The name of the replication group to delete.

wait (int, optional):

The number of seconds to wait for the replication group to be deleted.

region (str, optional):

The AWS region where the replication group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (dict, optional):

Additional arguments to pass to the delete_replication_group call.

CLI Example:

salt-call boto3_elasticache.delete_replication_group my-replication-group
saltext.boto3.modules.boto3_elasticache.describe_cache_subnet_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None)[source]

Return details about all (or just one) Elasticache replication groups.

name (str, optional):

The name of the cache subnet group to describe. If not provided, all cache subnet groups will be returned.

region (str, optional):

The AWS region where the cache subnet group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt-call boto3_elasticache.describe_cache_subnet_groups my-subnet-group
saltext.boto3.modules.boto3_elasticache.cache_subnet_group_exists(name, region=None, key=None, keyid=None, profile=None)[source]

Check to see if an ElastiCache subnet group exists.

name (str):

The name of the cache subnet group to check for existence.

region (str, optional):

The AWS region where the cache subnet group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt-call boto3_elasticache.cache_subnet_group_exists my-subnet-group
saltext.boto3.modules.boto3_elasticache.list_cache_subnet_groups(region=None, key=None, keyid=None, profile=None)[source]

Return a list of all cache subnet group names

region (str, optional):

The AWS region where the cache subnet groups are located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt-call boto3_elasticache.list_cache_subnet_groups
saltext.boto3.modules.boto3_elasticache.create_cache_subnet_group(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args)[source]

Create an ElastiCache subnet group

name (str):

The name of the cache subnet group to create.

subnets (list, optional):

A list of subnet IDs or names to include in the cache subnet group.

region (str, optional):

The AWS region where the cache subnet group will be created.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 create_cache_subnet_group call.

CLI Example:

salt-call boto3_elasticache.create_cache_subnet_group name=my-subnet-group                                               CacheSubnetGroupDescription="description"                                               subnets='[myVPCSubnet1,myVPCSubnet2]'
saltext.boto3.modules.boto3_elasticache.modify_cache_subnet_group(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args)[source]

Modify an ElastiCache subnet group

name (str):

The name of the cache subnet group to modify.

subnets (list, optional):

A list of subnet IDs or names to include in the cache subnet group.

region (str, optional):

The AWS region where the cache subnet group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 modify_cache_subnet_group call.

CLI Example:

salt-call boto3_elasticache.modify_cache_subnet_group                                               name=my-subnet-group                                               subnets='[myVPCSubnet3]'
saltext.boto3.modules.boto3_elasticache.delete_cache_subnet_group(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Delete an ElastiCache subnet group.

name (str):

The name of the cache subnet group to delete.

region (str, optional):

The AWS region where the cache subnet group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 delete_cache_subnet_group call.

CLI Example:

salt-call boto3_elasticache.delete_cache_subnet_group my-subnet-group
saltext.boto3.modules.boto3_elasticache.describe_cache_security_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None)[source]

Return details about all (or just one) Elasticache cache clusters.

name (str, optional):

The name of the cache security group to describe. If not provided, details about all cache security groups will be returned.

region (str, optional):

The AWS region where the cache security group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 describe_cache_security_groups call.

CLI Example:

salt-call boto3_elasticache.describe_cache_security_groups mycachesecgrp
saltext.boto3.modules.boto3_elasticache.cache_security_group_exists(name, region=None, key=None, keyid=None, profile=None)[source]

Check to see if an ElastiCache security group exists.

name (str):

The name of the cache security group to check for existence.

region (str, optional):

The AWS region where the cache security group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt-call boto3_elasticache.cache_security_group_exists mysecuritygroup
saltext.boto3.modules.boto3_elasticache.create_cache_security_group(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Create a cache security group.

name (str):

The name of the cache security group to create.

region (str, optional):

The AWS region where the cache security group will be created.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 create_cache_security_group call.

CLI Example:

salt-call boto3_elasticache.create_cache_security_group mycachesecgrp Description='My Cache Security Group'
saltext.boto3.modules.boto3_elasticache.delete_cache_security_group(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Delete a cache security group.

name (str):

The name of the cache security group to delete.

region (str, optional):

The AWS region where the cache security group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 delete_cache_security_group call.

CLI Example:

salt-call boto3_elasticache.delete_cache_security_group myelasticachesg
saltext.boto3.modules.boto3_elasticache.authorize_cache_security_group_ingress(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Authorize network ingress from an ec2 security group to a cache security group.

name (str):

The name of the cache security group to authorize ingress for.

region (str, optional):

The AWS region where the cache security group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 authorize_cache_security_group_ingress call.

CLI Example:

salt-call boto3_elasticache.authorize_cache_security_group_ingress myelasticachesg EC2SecurityGroupName=someEC2sg EC2SecurityGroupOwnerId=SOMEOWNERID
saltext.boto3.modules.boto3_elasticache.revoke_cache_security_group_ingress(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Revoke network ingress from an ec2 security group to a cache security group.

name (str):

The name of the cache security group to revoke ingress from.

region (str, optional):

The AWS region where the cache security group is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 revoke_cache_security_group_ingress call.

CLI Example:

salt-call boto3_elasticache.revoke_cache_security_group_ingress mycachesecgrp EC2SecurityGroupName=someEC2sg EC2SecurityGroupOwnerId=SOMEOWNERID
saltext.boto3.modules.boto3_elasticache.list_tags_for_resource(name, region=None, key=None, keyid=None, profile=None, **args)[source]

List tags on an Elasticache resource.

Note

This function is essentially useless as it requires a full AWS ARN for the resource being operated on, but there is no provided API or programmatic way to find the ARN for a given object from its name or ID alone. It requires specific knowledge about the account number, AWS partition, and other magic details to generate.

If you happen to have those handy, feel free to utilize this however…

name (str):

The full ARN of the Elasticache resource to list tags for.

region (str, optional):

The AWS region where the Elasticache resource is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 list_tags_for_resource call.

CLI Example:

salt-call boto3_elasticache.list_tags_for_resource name='arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot'
saltext.boto3.modules.boto3_elasticache.add_tags_to_resource(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Add tags to an Elasticache resource.

Note

This function is essentially useless as it requires a full AWS ARN for the resource being operated on, but there is no provided API or programmatic way to find the ARN for a given object from its name or ID alone. It requires specific knowledge about the account number, AWS partition, and other magic details to generate.

If you happen to have those at hand though, feel free to utilize this function…

name (str):

The full ARN of the Elasticache resource to add tags to.

region (str, optional):

The AWS region where the Elasticache resource is located.

keyid (str, optional):

The AWS access key ID.

key (str, optional):

The AWS secret access key.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 add_tags_to_resource call.

CLI Example:

salt-call boto3_elasticache.add_tags_to_resource name='arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot' Tags="[{'Key': 'TeamOwner', 'Value': 'infrastructure'}]"
saltext.boto3.modules.boto3_elasticache.remove_tags_from_resource(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Remove tags from an Elasticache resource.

Note

That this function is essentially useless as it requires a full AWS ARN for the resource being operated on, but there is no provided API or programmatic way to find the ARN for a given object from its name or ID alone. It requires specific knowledge about the account number, AWS partition, and other magic details to generate.

If you happen to have those at hand though, feel free to utilize this function…

name (str):

The ARN of the Elasticache resource from which to remove tags.

region (str, optional):

The AWS region where the Elasticache resource is located.

key (str, optional):

The AWS secret access key.

keyid (str, optional):

The AWS access key ID.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 remove_tags_from_resource call.

CLI Example:

salt-call boto3_elasticache.remove_tags_from_resource name='arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot' TagKeys="['TeamOwner']"
saltext.boto3.modules.boto3_elasticache.copy_snapshot(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Make a copy of an existing snapshot.

name (str):

The name of the source snapshot to copy.

region (str, optional):

The AWS region where the Elasticache resource is located.

key (str, optional):

The AWS secret access key.

keyid (str, optional):

The AWS access key ID.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 copy_snapshot call.

CLI Example:

salt-call boto3_elasticache.copy_snapshot name='mySnapshot' TargetSnapshotName='copyOfMySnapshot'
saltext.boto3.modules.boto3_elasticache.describe_cache_parameter_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None)[source]

Return details about all (or just one) Elasticache cache clusters.

name (str, optional):

The name of the cache parameter group to describe. If not provided, details about all cache parameter groups will be returned.

region (str, optional):

The AWS region where the Elasticache resource is located.

key (str, optional):

The AWS secret access key.

keyid (str, optional):

The AWS access key ID.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt-call boto3_elasticache.describe_cache_parameter_groups name='myParameterGroup'
saltext.boto3.modules.boto3_elasticache.create_cache_parameter_group(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Create a cache parameter group.

name (str):

The name of the cache parameter group to create.

region (str, optional):

The AWS region where the Elasticache resource is located.

key (str, optional):

The AWS secret access key.

keyid (str, optional):

The AWS access key ID.

profile (str, optional):

The profile to use for AWS credentials.

**args (optional):

Additional arguments to pass to the underlying boto3 create_cache_parameter_group call.

CLI Example:

salt-call boto3_elasticache.create_cache_parameter_group name='myParameterGroup' CacheParameterGroupFamily='redis2.8' Description='My Parameter Group'
saltext.boto3.modules.boto3_elasticache.delete_cache_parameter_group(name, region=None, key=None, keyid=None, profile=None, **args)[source]

Delete a cache parameter group.

name (str):

The name of the cache parameter group to delete.

region (str, optional):

The AWS region where the Elasticache resource is located.

key (str, optional):

The AWS secret access key.

keyid (str, optional):

The AWS access key ID.

profile (str, optional):

The profile to use for AWS credentials.

CLI Example:

salt-call boto3_elasticache.delete_cache_parameter_group name='myParamGroup'