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.

Example:

salt myminion boto3_elasticache.describe_cache_clusters
salt myminion boto3_elasticache.describe_cache_clusters myelasticache

CLI Example:

salt-call boto3_elasticache.describe_cache_clusters
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.

Example:

salt myminion boto3_elasticache.cache_cluster_exists myelasticache

CLI Example:

salt-call boto3_elasticache.cache_cluster_exists
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.

Example:

salt myminion boto3_elasticache.create_cache_cluster name=myCacheCluster                                                              Engine=redis                                                              CacheNodeType=cache.t2.micro                                                              NumCacheNodes=1                                                              SecurityGroupIds='[sg-11223344]'                                                              CacheSubnetGroupName=myCacheSubnetGroup

CLI Example:

salt-call boto3_elasticache.create_cache_cluster
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.

Notes: {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.

Example:

salt myminion boto3_elasticache.create_cache_cluster name=myCacheCluster                                                              NotificationTopicStatus=inactive

CLI Example:

salt-call boto3_elasticache.modify_cache_cluster
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.

Example:

salt myminion boto3_elasticache.delete myelasticache

CLI Example:

salt-call boto3_elasticache.delete_cache_cluster
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.

Example:

salt myminion boto3_elasticache.describe_replication_groups
salt myminion boto3_elasticache.describe_replication_groups myelasticache

CLI Example:

salt-call boto3_elasticache.describe_replication_groups
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.

Example:

salt myminion boto3_elasticache.replication_group_exists myelasticache

CLI Example:

salt-call boto3_elasticache.replication_group_exists
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.

Example:

salt myminion boto3_elasticache.create_replication_group                                                   name=myelasticache                                                   ReplicationGroupDescription=description

CLI Example:

salt-call boto3_elasticache.create_replication_group
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.

Example:

salt myminion boto3_elasticache.modify_replication_group                                                   name=myelasticache                                                   ReplicationGroupDescription=newDescription

CLI Example:

salt-call boto3_elasticache.modify_replication_group
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.

Example:

salt myminion boto3_elasticache.delete_replication_group my-replication-group

CLI Example:

salt-call boto3_elasticache.delete_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.

Example:

salt myminion boto3_elasticache.describe_cache_subnet_groups region=us-east-1

CLI Example:

salt-call boto3_elasticache.describe_cache_subnet_groups
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.

Example:

salt myminion boto3_elasticache.cache_subnet_group_exists my-subnet-group

CLI Example:

salt-call boto3_elasticache.cache_subnet_group_exists
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

Example:

salt myminion boto3_elasticache.list_cache_subnet_groups region=us-east-1

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

Example:

salt myminion boto3_elasticache.create_cache_subnet_group name=my-subnet-group                                               CacheSubnetGroupDescription="description"                                               subnets='[myVPCSubnet1,myVPCSubnet2]'

CLI Example:

salt-call boto3_elasticache.create_cache_subnet_group
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

Example:

salt myminion boto3_elasticache.modify_cache_subnet_group                                               name=my-subnet-group                                               subnets='[myVPCSubnet3]'

CLI Example:

salt-call boto3_elasticache.modify_cache_subnet_group
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.

Example:

salt myminion boto3_elasticache.delete_subnet_group my-subnet-group region=us-east-1

CLI Example:

salt-call boto3_elasticache.delete_cache_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.

Example:

salt myminion boto3_elasticache.describe_cache_security_groups
salt myminion boto3_elasticache.describe_cache_security_groups mycachesecgrp

CLI Example:

salt-call boto3_elasticache.describe_cache_security_groups
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.

Example:

salt myminion boto3_elasticache.cache_security_group_exists mysecuritygroup

CLI Example:

salt-call boto3_elasticache.cache_security_group_exists
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.

Example:

salt myminion boto3_elasticache.create_cache_security_group mycachesecgrp Description='My Cache Security Group'

CLI Example:

salt-call boto3_elasticache.create_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.

Example:

salt myminion boto3_elasticache.delete_cache_security_group myelasticachesg

CLI Example:

salt-call boto3_elasticache.delete_cache_security_group
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.

Example:

salt myminion boto3_elasticache.authorize_cache_security_group_ingress                                         mycachesecgrp                                         EC2SecurityGroupName=someEC2sg                                         EC2SecurityGroupOwnerId=SOMEOWNERID

CLI Example:

salt-call boto3_elasticache.authorize_cache_security_group_ingress
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.

Example:

salt myminion boto3_elasticache.revoke_cache_security_group_ingress                                         mycachesecgrp                                         EC2SecurityGroupName=someEC2sg                                         EC2SecurityGroupOwnerId=SOMEOWNERID

CLI Example:

salt-call boto3_elasticache.revoke_cache_security_group_ingress
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 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 handy, feel free to utilize this however…

Example:

salt myminion boto3_elasticache.list_tags_for_resource                 name'=arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot'

CLI Example:

salt-call boto3_elasticache.list_tags_for_resource
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 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…

Example:

salt myminion boto3_elasticache.add_tags_to_resource                 name'=arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot'                 Tags="[{'Key': 'TeamOwner', 'Value': 'infrastructure'}]"

CLI Example:

salt-call boto3_elasticache.add_tags_to_resource
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…

Example:

salt myminion boto3_elasticache.remove_tags_from_resource                 name'=arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot'                 TagKeys="['TeamOwner']"

CLI Example:

salt-call boto3_elasticache.remove_tags_from_resource
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.

Example:

salt myminion boto3_elasticache.copy_snapshot name=mySnapshot                                                       TargetSnapshotName=copyOfMySnapshot

CLI Example:

salt-call boto3_elasticache.copy_snapshot
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.

Example:

salt myminion boto3_elasticache.describe_cache_parameter_groups
salt myminion boto3_elasticache.describe_cache_parameter_groups myParameterGroup

CLI Example:

salt-call boto3_elasticache.describe_cache_parameter_groups
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.

Example:

salt myminion boto3_elasticache.create_cache_parameter_group                 name=myParamGroup                 CacheParameterGroupFamily=redis2.8                 Description="My Parameter Group"

CLI Example:

salt-call boto3_elasticache.create_cache_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.

Example:

salt myminion boto3_elasticache.delete_cache_parameter_group myParamGroup

CLI Example:

salt-call boto3_elasticache.delete_cache_parameter_group