From a452615a012a004c6f1437ee2d3fa62909297ee9 Mon Sep 17 00:00:00 2001 From: John McGrath Date: Thu, 23 Aug 2018 10:00:10 -0700 Subject: [PATCH] Add ElastiCache wrapper templates --- templates/elasticache.cfn.yml | 2 + vpc-bastion-fargate-rds-elasticache.cfn.yml | 806 ++++++++++++++++++++ vpc-elasticache.cfn.yml | 181 +++++ 3 files changed, 989 insertions(+) create mode 100644 vpc-bastion-fargate-rds-elasticache.cfn.yml create mode 100644 vpc-elasticache.cfn.yml diff --git a/templates/elasticache.cfn.yml b/templates/elasticache.cfn.yml index d20e935a..0c917b66 100644 --- a/templates/elasticache.cfn.yml +++ b/templates/elasticache.cfn.yml @@ -28,6 +28,7 @@ Parameters: ClusterName: Description: Custom name of the cluster. Auto generated if you don't supply your own. Type: String + AllowedPattern: "^[a-zA-Z][-a-zA-Z0-9]*$" CacheNodeType: Description: Cache node instance class, e.g. cache.t2.micro(free tier). See https://docs.aws.amazon.com/AmazonElastiCache/latest/UserGuide/CacheNodes.SelectSize.html @@ -107,6 +108,7 @@ Resources: AutoMinorVersionUpgrade: !Ref AutoMinorVersionUpgrade Engine: !Ref CacheEngine CacheNodeType: !Ref CacheNodeType + ClusterName : !Ref ClusterName NumCacheNodes: !If [ IsRedis, 1, !Ref CacheNodeCount] CacheSubnetGroupName: !Ref SubnetGroup VpcSecurityGroupIds: diff --git a/vpc-bastion-fargate-rds-elasticache.cfn.yml b/vpc-bastion-fargate-rds-elasticache.cfn.yml new file mode 100644 index 00000000..8ad0ae6d --- /dev/null +++ b/vpc-bastion-fargate-rds-elasticache.cfn.yml @@ -0,0 +1,806 @@ +--- +AWSTemplateFormatVersion: 2010-09-09 + + +Description: VPC + Bastion + Fargate + Database + ElastiCache + + +Parameters: + + TemplateBucket: + Type: String + Default: awslabs-startup-kit-templates-deploy-v3 + Description: The template bucket for the CloudFormation templates + + # vpc.cfn.yml parameters + AvailabilityZone1: + Description: The first availability zone in the region + Type: AWS::EC2::AvailabilityZone::Name + ConstraintDescription: Must be a valid availability zone + + AvailabilityZone2: + Description: The second availability zone in the region + Type: AWS::EC2::AvailabilityZone::Name + ConstraintDescription: Must be a valid availability zone + + SSHFrom: + Description: Limit SSH access to bastion hosts to a CIDR IP block + Type: String + MinLength: 9 + MaxLength: 18 + Default: 0.0.0.0/0 + + ELBIngressPort: + Description: The ELB ingress port used by security groups + Type: Number + MinValue: 0 + MaxValue: 65535 + ConstraintDescription: TCP ports must be between 0 - 65535 + Default: 80 + + AppIngressPort: + Description: The application ingress port used by security groups + Type: Number + MinValue: 0 + MaxValue: 65535 + ConstraintDescription: TCP ports must be between 0 - 65535 + Default: 80 + + # bastion.cfn.yml parameters + KeyName: + Description: EC2 key pair name for bastion host SSH access + Type: AWS::EC2::KeyPair::KeyName + AllowedPattern : ".+" + + LogRetentionInDays: + Description: Number of days you would like your CloudWatch Logs to be retained + Type: Number + Default: 90 + + # For more information on the google-authenticator PAM module, see: https://github.com/google/google-authenticator-libpam + MFA: + Description: Set to true to install MFA using the google-authenticator PAM module on your bastion host + Type: String + ConstraintDescription: Value must be true or false + Default: false + AllowedValues: + - true + - false + + # fargate.cfn.yml parameters + HostedZoneName: + Type: String + Description: The optional Amazon Route 53 Hosted Zone Name for the optional load balancer alias record - do not include a period at the end + Default: "" + AllowedPattern: "(^$|^((?!-)[A-Za-z0-9-]{1,63}(?