@@ -0,0 +1,1735 @@
+from troposphere import (%0A    ec2,%0A    Parameter,%0A    elasticache,%0A    Ref,%0A)%0A%0Afrom .template import template%0Afrom .vpc import (%0A    vpc,%0A    container_a_subnet,%0A    container_a_subnet_cidr,%0A    container_b_subnet,%0A    container_b_subnet_cidr,%0A)%0A%0A%0Acache_node_type = template.add_parameter(Parameter(%0A    %22CacheNodeType%22,%0A    Default=%22cache.t2.micro%22,%0A    Description=%22Cache instance class%22,%0A    Type=%22String%22,%0A    AllowedValues=%5B%0A        'cache.t2.micro',%0A        'cache.t2.small',%0A        'cache.t2.medium',%0A        'cache.t2.large',%0A    %5D,%0A    ConstraintDescription=%22must select a valid cache node type.%22,%0A))%0A%0A%0Acache_security_group = ec2.SecurityGroup(%0A    'CacheSecurityGroup',%0A    template=template,%0A    GroupDescription=%22Cache security group.%22,%0A    VpcId=Ref(vpc),%0A    SecurityGroupIngress=%5B%0A        # Redis in from web clusters%0A        ec2.SecurityGroupRule(%0A            IpProtocol=%22tcp%22,%0A            FromPort=%226379%22,%0A            ToPort=%226379%22,%0A            CidrIp=container_a_subnet_cidr,%0A        ),%0A        ec2.SecurityGroupRule(%0A            IpProtocol=%22tcp%22,%0A            FromPort=%226379%22,%0A            ToPort=%226379%22,%0A            CidrIp=container_b_subnet_cidr,%0A        ),%0A    %5D,%0A)%0A%0A%0Acache_subnet_group = elasticache.SubnetGroup(%0A    %22CacheSubnetGroup%22,%0A    template=template,%0A    Description=%22Subnets available for the cache instance%22,%0A    SubnetIds=%5BRef(container_a_subnet), Ref(container_b_subnet)%5D,%0A)%0A%0A%0Aredis_instance = elasticache.CacheCluster(%0A    %22Redis%22,%0A    template=template,%0A    Engine=%22redis%22,%0A    CacheNodeType=Ref(cache_node_type),%0A    NumCacheNodes=1,  # Must be 1 for redis, but still required%0A    Port=6379,%0A    VpcSecurityGroupIds=%5BRef(cache_security_group)%5D,%0A    CacheSubnetGroupName=Ref(cache_subnet_group),%0A)%0A

add configuration for Redis instance creation