Skip to content

Commit fe1cb11

Browse files
committed
switch to ReplicationGroup for multi AZ support
1 parent fc70e63 commit fe1cb11

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

service-ecs.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ Parameters:
22
NumCacheNodes:
33
Type: String
44
Description: Number of cache nodes
5-
Default: 1
5+
Default: 2
66
CacheNodeType:
77
Type: String
88
Description: The compute and memory capacity of the node(s) in the Redis Cluster
9-
Default: "cache.m3.medium"
9+
Default: "cache.t2.micro"
1010
AllowedValues:
1111
- cache.t2.micro
1212
- cache.t2.small
@@ -43,6 +43,10 @@ Parameters:
4343
- cache.r3.2xlarge
4444
- cache.r3.4xlarge
4545
- cache.r3.8xlarge
46+
AutomaticFailoverEnabled:
47+
Type: String
48+
Description: Indicates whether Multi-AZ is enabled. When Multi-AZ is enabled, a read-only replica is automatically promoted to a read-write primary cluster if the existing primary cluster fails.
49+
Default: "true"
4650

4751
Resources:
4852
ElasticacheSubnetGroup:
@@ -72,15 +76,19 @@ Resources:
7276
Ref: ServiceSecurityGroup
7377

7478
ElasticacheCluster:
75-
Type: "AWS::ElastiCache::CacheCluster"
79+
Type: "AWS::ElastiCache::ReplicationGroup"
7680
Properties:
7781
Engine: "redis"
7882
CacheNodeType:
7983
Ref: CacheNodeType
80-
NumCacheNodes:
84+
NumCacheClusters:
8185
Ref: NumCacheNodes
8286
CacheSubnetGroupName:
8387
Ref: ElasticacheSubnetGroup
84-
VpcSecurityGroupIds:
88+
AutomaticFailoverEnabled:
89+
Ref: AutomaticFailoverEnabled
90+
ReplicationGroupDescription:
91+
Fn::Sub: ${Namespace}-${ServiceName}-${EnvironmentName}-cache
92+
SecurityGroupIds:
8593
- Fn::ImportValue:
8694
Ref: ServiceSecurityGroup

0 commit comments

Comments
 (0)