Skip to content

Commit

Permalink
switch to ReplicationGroup for multi AZ support
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbucci committed Mar 29, 2019
1 parent fc70e63 commit fe1cb11
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions service-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Parameters:
NumCacheNodes:
Type: String
Description: Number of cache nodes
Default: 1
Default: 2
CacheNodeType:
Type: String
Description: The compute and memory capacity of the node(s) in the Redis Cluster
Default: "cache.m3.medium"
Default: "cache.t2.micro"
AllowedValues:
- cache.t2.micro
- cache.t2.small
Expand Down Expand Up @@ -43,6 +43,10 @@ Parameters:
- cache.r3.2xlarge
- cache.r3.4xlarge
- cache.r3.8xlarge
AutomaticFailoverEnabled:
Type: String
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.
Default: "true"

Resources:
ElasticacheSubnetGroup:
Expand Down Expand Up @@ -72,15 +76,19 @@ Resources:
Ref: ServiceSecurityGroup

ElasticacheCluster:
Type: "AWS::ElastiCache::CacheCluster"
Type: "AWS::ElastiCache::ReplicationGroup"
Properties:
Engine: "redis"
CacheNodeType:
Ref: CacheNodeType
NumCacheNodes:
NumCacheClusters:
Ref: NumCacheNodes
CacheSubnetGroupName:
Ref: ElasticacheSubnetGroup
VpcSecurityGroupIds:
AutomaticFailoverEnabled:
Ref: AutomaticFailoverEnabled
ReplicationGroupDescription:
Fn::Sub: ${Namespace}-${ServiceName}-${EnvironmentName}-cache
SecurityGroupIds:
- Fn::ImportValue:
Ref: ServiceSecurityGroup

0 comments on commit fe1cb11

Please sign in to comment.