salt.modules.boto3_elasticache

Execution module for Amazon Elasticache using boto3

New in version 2017.7.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 a pillar or 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
depends:

boto3

salt.modules.boto3_elasticache.add_tags_to_resource(name, region=None, key=None, keyid=None, profile=None, **args)

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'}]"
salt.modules.boto3_elasticache.authorize_cache_security_group_ingress(name, region=None, key=None, keyid=None, profile=None, **args)

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
salt.modules.boto3_elasticache.cache_cluster_exists(name, conn=None, region=None, key=None, keyid=None, profile=None)

Check to see if a cache cluster exists.

Example:

salt myminion boto3_elasticache.cache_cluster_exists myelasticache
salt.modules.boto3_elasticache.cache_security_group_exists(name, region=None, key=None, keyid=None, profile=None)

Check to see if an ElastiCache security group exists.

Example:

salt myminion boto3_elasticache.cache_security_group_exists mysecuritygroup
salt.modules.boto3_elasticache.cache_subnet_group_exists(name, region=None, key=None, keyid=None, profile=None)

Check to see if an ElastiCache subnet group exists.

Example:

salt myminion boto3_elasticache.cache_subnet_group_exists my-subnet-group
salt.modules.boto3_elasticache.copy_snapshot(name, region=None, key=None, keyid=None, profile=None, **args)

Make a copy of an existing snapshot.

Example:

salt myminion boto3_elasticache.copy_snapshot name=mySnapshot                                                       TargetSnapshotName=copyOfMySnapshot
salt.modules.boto3_elasticache.create_cache_cluster(name, wait=600, security_groups=None, region=None, key=None, keyid=None, profile=None, **args)

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
salt.modules.boto3_elasticache.create_cache_parameter_group(name, region=None, key=None, keyid=None, profile=None, **args)

Create a cache parameter group.

Example:

salt myminion boto3_elasticache.create_cache_parameter_group                 name=myParamGroup                 CacheParameterGroupFamily=redis2.8                 Description="My Parameter Group"
salt.modules.boto3_elasticache.create_cache_security_group(name, region=None, key=None, keyid=None, profile=None, **args)

Create a cache security group.

Example:

salt myminion boto3_elasticache.create_cache_security_group mycachesecgrp Description='My Cache Security Group'
salt.modules.boto3_elasticache.create_cache_subnet_group(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args)

Create an ElastiCache subnet group

Example:

salt myminion boto3_elasticache.create_cache_subnet_group name=my-subnet-group                                               CacheSubnetGroupDescription="description"                                               subnets='[myVPCSubnet1,myVPCSubnet2]'
salt.modules.boto3_elasticache.create_replication_group(name, wait=600, security_groups=None, region=None, key=None, keyid=None, profile=None, **args)

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
salt.modules.boto3_elasticache.delete_cache_cluster(name, wait=600, region=None, key=None, keyid=None, profile=None, **args)

Delete a cache cluster.

Example:

salt myminion boto3_elasticache.delete myelasticache
salt.modules.boto3_elasticache.delete_cache_parameter_group(name, region=None, key=None, keyid=None, profile=None, **args)

Delete a cache parameter group.

Example:

salt myminion boto3_elasticache.delete_cache_parameter_group myParamGroup
salt.modules.boto3_elasticache.delete_cache_security_group(name, region=None, key=None, keyid=None, profile=None, **args)

Delete a cache security group.

Example:

salt myminion boto3_elasticache.delete_cache_security_group myelasticachesg
salt.modules.boto3_elasticache.delete_cache_subnet_group(name, region=None, key=None, keyid=None, profile=None, **args)

Delete an ElastiCache subnet group.

Example:

salt myminion boto3_elasticache.delete_subnet_group my-subnet-group region=us-east-1
salt.modules.boto3_elasticache.delete_replication_group(name, wait=600, region=None, key=None, keyid=None, profile=None, **args)

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

Example:

salt myminion boto3_elasticache.delete_replication_group my-replication-group
salt.modules.boto3_elasticache.describe_cache_clusters(name=None, conn=None, region=None, key=None, keyid=None, profile=None, **args)

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
salt.modules.boto3_elasticache.describe_cache_parameter_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None)

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
salt.modules.boto3_elasticache.describe_cache_security_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None)

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
salt.modules.boto3_elasticache.describe_cache_subnet_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None)

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

Example:

salt myminion boto3_elasticache.describe_cache_subnet_groups region=us-east-1
salt.modules.boto3_elasticache.describe_replication_groups(name=None, conn=None, region=None, key=None, keyid=None, profile=None)

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
salt.modules.boto3_elasticache.list_cache_subnet_groups(region=None, key=None, keyid=None, profile=None)

Return a list of all cache subnet group names

Example:

salt myminion boto3_elasticache.list_cache_subnet_groups region=us-east-1
salt.modules.boto3_elasticache.list_tags_for_resource(name, region=None, key=None, keyid=None, profile=None, **args)

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'
salt.modules.boto3_elasticache.modify_cache_cluster(name, wait=600, security_groups=None, region=None, key=None, keyid=None, profile=None, **args)

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
salt.modules.boto3_elasticache.modify_cache_subnet_group(name, subnets=None, region=None, key=None, keyid=None, profile=None, **args)

Modify an ElastiCache subnet group

Example:

salt myminion boto3_elasticache.modify_cache_subnet_group                                               name=my-subnet-group                                               subnets='[myVPCSubnet3]'
salt.modules.boto3_elasticache.modify_replication_group(name, wait=600, security_groups=None, region=None, key=None, keyid=None, profile=None, **args)

Modify a replication group.

Example:

salt myminion boto3_elasticache.modify_replication_group                                                   name=myelasticache                                                   ReplicationGroupDescription=newDescription
salt.modules.boto3_elasticache.remove_tags_from_resource(name, region=None, key=None, keyid=None, profile=None, **args)

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']"
salt.modules.boto3_elasticache.replication_group_exists(name, region=None, key=None, keyid=None, profile=None)

Check to see if a replication group exists.

Example:

salt myminion boto3_elasticache.replication_group_exists myelasticache
salt.modules.boto3_elasticache.revoke_cache_security_group_ingress(name, region=None, key=None, keyid=None, profile=None, **args)

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