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 8075cbb commit eef4554
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions service-ecs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Parameters:
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,10 +43,10 @@ Parameters:
- cache.r3.2xlarge
- cache.r3.4xlarge
- cache.r3.8xlarge
AZMode:
AutomaticFailoverEnabled:
Type: String
Description: Cross Availability Zone Redundancy, Requires at least 2 Nodes "cross-az" is on, "single-az" is off
Default: "cross-az"
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 @@ -76,17 +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
AZMode:
Ref: AZMode
VpcSecurityGroupIds:
AutomaticFailoverEnabled:
Ref: AutomaticFailoverEnabled
ReplicationGroupDescription:
Fn::Sub: ${Namespace}-${ServiceName}-${EnvironmentName}-cache
SecurityGroupIds:
- Fn::ImportValue:
Ref: ServiceSecurityGroup

0 comments on commit eef4554

Please sign in to comment.