From ef87f4740acdcdeca7ba474425504dfb32f94129 Mon Sep 17 00:00:00 2001 From: Brian Jakovich Date: Sun, 31 Dec 2017 11:24:41 -0500 Subject: [PATCH] Added parameter for number of cache nodes --- service-ecs.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/service-ecs.yml b/service-ecs.yml index 3e59a84..54415e5 100644 --- a/service-ecs.yml +++ b/service-ecs.yml @@ -1,3 +1,7 @@ +Parameters: + NumCacheNodes: + Type: String + Description: Number of cache nodes Resources: ElasticacheSubnetGroup: Type: "AWS::ElastiCache::SubnetGroup" @@ -6,15 +10,15 @@ Resources: SubnetIds: Fn::Split: - "," - - Fn::ImportValue: + - Fn::ImportValue: Ref: ServiceSubnetIds ElasticacheSecurityGroup: Type: "AWS::EC2::SecurityGroup" Properties: GroupDescription: "Elasticache Security Group" - VpcId: - Fn::ImportValue: + VpcId: + Fn::ImportValue: Ref: VpcId SecurityGroupIngress: - @@ -22,7 +26,7 @@ Resources: FromPort: "6379" ToPort: "6379" SourceSecurityGroupId: - Fn::ImportValue: + Fn::ImportValue: Ref: ServiceSecurityGroup ElasticacheCluster: @@ -30,9 +34,10 @@ Resources: Properties: CacheNodeType: "cache.m3.medium" Engine: "redis" - NumCacheNodes: "1" - CacheSubnetGroupName: + NumCacheNodes: + Ref: NumCacheNodes + CacheSubnetGroupName: Ref: ElasticacheSubnetGroup VpcSecurityGroupIds: - - Fn::ImportValue: + - Fn::ImportValue: Ref: ServiceSecurityGroup