Skip to content

Commit

Permalink
Added parameter for number of cache nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Jakovich committed Dec 31, 2017
1 parent db6c5b3 commit ef87f47
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions service-ecs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Parameters:
NumCacheNodes:
Type: String
Description: Number of cache nodes
Resources:
ElasticacheSubnetGroup:
Type: "AWS::ElastiCache::SubnetGroup"
Expand All @@ -6,33 +10,34 @@ 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:
-
IpProtocol: "tcp"
FromPort: "6379"
ToPort: "6379"
SourceSecurityGroupId:
Fn::ImportValue:
Fn::ImportValue:
Ref: ServiceSecurityGroup

ElasticacheCluster:
Type: "AWS::ElastiCache::CacheCluster"
Properties:
CacheNodeType: "cache.m3.medium"
Engine: "redis"
NumCacheNodes: "1"
CacheSubnetGroupName:
NumCacheNodes:
Ref: NumCacheNodes
CacheSubnetGroupName:
Ref: ElasticacheSubnetGroup
VpcSecurityGroupIds:
- Fn::ImportValue:
- Fn::ImportValue:
Ref: ServiceSecurityGroup

0 comments on commit ef87f47

Please sign in to comment.