This CloudFormation template creates an ElastiCache subnet group in a VPC with two subnets. The subnet group is used to specify the subnets where ElastiCache clusters can be created.

CloudFormation Template