Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create AWS cache clusters in VPC with CloudFormation

I am creating an AWS stack inside a VPC using CloudFormation and need to create ElastiCache clusters on it. I have investigated and there is no support in CloudFormation to create cache clusters in VPCs. Our "workaround" was to to create the cache cluster when some "fixed" instance (like a bastion for example) bootstrap using CloudInit and AWS AmazonElastiCacheCli tools (elasticache-create-cache-subnet-group, elasticache-create-cache-cluster). Then, when front end machines bootstrap (we are using autoscaling), they use elasticache-describe-cache-clusters to get cache cluster nodes and update configuration.

I would like to know if you have different solutions to this problem.

like image 251
Luciano Afranllie Avatar asked Mar 31 '13 14:03

Luciano Afranllie


1 Answers

VPC support has now been added for Elasticache in Cloudformation Templates.

To launch a AWS::ElastiCache::CacheCluster in your VPC, create a AWS::ElastiCache::SubnetGroup that defines which subnet in your VPC you want Elasticache and assign it to the CacheSubnetGroupName property of AWS::ElastiCache::CacheCluster.

like image 194
theon Avatar answered Sep 30 '22 12:09

theon