New in version 2017.7.0.
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
boto3
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'}]"
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
Check to see if a cache cluster exists.
Example:
salt myminion boto3_elasticache.cache_cluster_exists myelasticache
Check to see if an ElastiCache security group exists.
Example:
salt myminion boto3_elasticache.cache_security_group_exists mysecuritygroup
Check to see if an ElastiCache subnet group exists.
Example:
salt myminion boto3_elasticache.cache_subnet_group_exists my-subnet-group
Make a copy of an existing snapshot.
Example:
salt myminion boto3_elasticache.copy_snapshot name=mySnapshot TargetSnapshotName=copyOfMySnapshot
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
Create a cache parameter group.
Example:
salt myminion boto3_elasticache.create_cache_parameter_group name=myParamGroup CacheParameterGroupFamily=redis2.8 Description="My Parameter Group"
Create a cache security group.
Example:
salt myminion boto3_elasticache.create_cache_security_group mycachesecgrp Description='My Cache Security Group'
Create an ElastiCache subnet group
Example:
salt myminion boto3_elasticache.create_cache_subnet_group name=my-subnet-group CacheSubnetGroupDescription="description" subnets='[myVPCSubnet1,myVPCSubnet2]'
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
Delete a cache cluster.
Example:
salt myminion boto3_elasticache.delete myelasticache
Delete a cache parameter group.
Example:
salt myminion boto3_elasticache.delete_cache_parameter_group myParamGroup
Delete a cache security group.
Example:
salt myminion boto3_elasticache.delete_cache_security_group myelasticachesg
Delete an ElastiCache subnet group.
Example:
salt myminion boto3_elasticache.delete_subnet_group my-subnet-group region=us-east-1
Delete an ElastiCache replication group, optionally taking a snapshot first.
Example:
salt myminion boto3_elasticache.delete_replication_group my-replication-group
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
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
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
Return details about all (or just one) Elasticache replication groups.
Example:
salt myminion boto3_elasticache.describe_cache_subnet_groups region=us-east-1
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
Return a list of all cache subnet group names
Example:
salt myminion boto3_elasticache.list_cache_subnet_groups region=us-east-1
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'
Update a cache cluster in place.
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
Modify an ElastiCache subnet group
Example:
salt myminion boto3_elasticache.modify_cache_subnet_group name=my-subnet-group subnets='[myVPCSubnet3]'
Modify a replication group.
Example:
salt myminion boto3_elasticache.modify_replication_group name=myelasticache ReplicationGroupDescription=newDescription
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']"
Check to see if a replication group exists.
Example:
salt myminion boto3_elasticache.replication_group_exists myelasticache
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