AWSTemplateFormatVersion: 2010-09-09 Description: DataStax OSS in new VPC (qs-1r0baum3l) Metadata: QuickStartDocumentation: EntrypointName: "Parameters for launching into a new VPC" AWS::CloudFormation::Interface: ParameterGroups: - Label: default: 'VPC network configuration' Parameters: - AvailabilityZones - VPCCIDR - PrivateSubnet1CIDR - PrivateSubnet2CIDR - PrivateSubnet3CIDR - PublicSubnet1CIDR - PublicSubnet2CIDR - PublicSubnet3CIDR - Label: default: 'Cassandra cluster/nodes configuration' Parameters: - OSSVersion - ClusterSize - ClusterName - DatacenterName - NodeInstanceType - NodeVolumeSize - Label: default: 'Cassandra cluster access' Parameters: - CreateClusterWithPublicIP - RemoteAccessCIDR - KeyPairName - Label: default: 'DevOps/bastion configuration' Parameters: - CreateDevInstance - DevInstanceType - DevVolumeSize - Label: default: 'AWS Quick Start configuration' Parameters: - S3BucketName - S3KeyPrefix ParameterLabels: AvailabilityZones: default: Availability Zones VPCCIDR: default: VPC CIDR PrivateSubnet1CIDR: default: Private subnet 1 CIDR PrivateSubnet2CIDR: default: Private subnet 2 CIDR PrivateSubnet3CIDR: default: Private subnet 3 CIDR PublicSubnet1CIDR: default: Public subnet 1 CIDR PublicSubnet2CIDR: default: Public subnet 2 CIDR PublicSubnet3CIDR: default: Public subnet 3 CIDR OSSVersion: default: Apache Cassandra version to install ClusterSize: default: Choose from "1 - 32" for number of Cassandra nodes to install ClusterName: default: The name of the Cassandra cluster DatacenterName: default: Name of the Cassandra data center NodeInstanceType: default: Amazon EC2 instance type for Cassandra nodes NodeVolumeSize: default: Amazon EBS volume size of the Cassandra cluster nodes in GB CreateClusterWithPublicIP: default: Create the Cassandra cluster nodes in public subnet RemoteAccessCIDR: default: Permitted CIDR block for remote access KeyPairName: default: AWS key pair CreateDevInstance: default: Whether to create the jump box DevInstanceType: default: Amazon EC2 instance type for the DevOps/bastion host DevVolumeSize: default: The Amazon EBS volume size in GB for the DevOps host S3BucketName: default: S3 bucket where the templates are stored S3KeyPrefix: default: S3 key prefix Parameters: S3BucketName: AllowedPattern: '^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$' ConstraintDescription: >- Bucket name can include numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen (-). Default: aws-quickstart Description: >- S3 bucket name for the Quick Start assets. Quick Start bucket name can include numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen (-). Type: String S3KeyPrefix: AllowedPattern: '^[0-9a-zA-Z-/]*$' ConstraintDescription: >- Quick Start key prefix can include numbers, lowercase letters, uppercase letters, hyphens (-), and forward slash (/). Default: quickstart-datastax-oss Description: >- S3 key prefix for the Quick Start assets. Quick Start key prefix can include numbers, lowercase letters, uppercase letters, hyphens (-), and forward slash (/). Type: String OSSVersion: AllowedValues: # - 3.11.5 # - 3.11.6 - 4.0 Default: 4.0 Description: "Apache Cassandra version to install." Type: String ClusterSize: Description: "Number of Cassandra nodes to create." Type: String Default: 3 AllowedValues: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 AvailabilityZones: Description: Select 3 Availability Zones from this list to use for the subnets in the VPC. The logical order of your selections is preserved. Type: List ClusterName: Description: The name of the Cassandra cluster. Type: String Default: Cassandra-Cluster DatacenterName: Description: The name of the Cassandra data center. Type: String Default: OSS-dc0 NodeInstanceType: AllowedValues: - t2.medium - t2.large - t2.xlarge - t2.2xlarge - m4.large - m4.xlarge - m4.2xlarge - m4.4xlarge - m4.10xlarge - m4.16xlarge - c4.large - c4.xlarge - c4.2xlarge - c4.4xlarge - c4.8xlarge - r4.large - r4.xlarge - r4.2xlarge - r4.4xlarge - r4.8xlarge - r4.16xlarge ConstraintDescription: "Must be a valid Amazon EC2 instance type." Default: m4.large Description: "Amazon EC2 instance type of each node in the Cassandra cluster." Type: String NodeVolumeSize: Type: Number Description: "Amazon EBS volume size of each node in the Cassandra cluster in GB." Default: 512 CreateDevInstance: Description: "Determines whether to create the jump box." Type: String Default: "true" AllowedValues: - "false" - "true" DevInstanceType: AllowedValues: - t2.micro - t2.small - t2.medium - t2.large - t2.xlarge - t2.2xlarge - t3.micro - t3.small - t3.medium - t3.large - t3.xlarge - t3.2xlarge ConstraintDescription: "Must be a valid Amazon EC2 instance type." Default: t3.medium Description: "EC2 instance type of the DevOps instance." Type: String DevVolumeSize: Type: Number Description: "Amazon EBS volume size of the DevOps instance in GB." Default: 16 KeyPairName: Type: "AWS::EC2::KeyPair::KeyName" AllowedPattern : ".+" Description: "Select an existing key pair." ConstraintDescription: "Name of an existing Amazon EC2 key pair." PrivateSubnet1CIDR: AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28. Default: 10.0.0.0/19 Description: CIDR block for private subnet 1 located in Availability Zone 1. Type: String PrivateSubnet2CIDR: AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28. Default: 10.0.32.0/19 Description: CIDR block for private subnet 2 located in Availability Zone 2. Type: String PrivateSubnet3CIDR: AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28. Default: 10.0.64.0/19 Description: CIDR block for private subnet 3 located in Availability Zone 3. Type: String PublicSubnet1CIDR: AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28. Default: 10.0.128.0/20 Description: CIDR block for the public (DMZ) subnet 1 located in Availability Zone 1. Type: String PublicSubnet2CIDR: AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28. Default: 10.0.144.0/20 Description: CIDR block for the public (DMZ) subnet 2 located in Availability Zone 2. Type: String PublicSubnet3CIDR: AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28. Default: 10.0.160.0/20 Description: CIDR block for the public (DMZ) subnet 3 located in Availability Zone 3. Type: String VPCCIDR: AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/(1[6-9]|2[0-8]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28. Default: 10.0.0.0/16 Description: CIDR block for the VPC. Type: String RemoteAccessCIDR: AllowedPattern: "^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\\/([0-9]|[1-2][0-9]|3[0-2]))$" ConstraintDescription: "CIDR block parameter must be in the form x.x.x.x/x." Description: "Allowed CIDR block for external SSH access and for application access to the Cassandra cluster, if the cluster is created with CreateClusterWithPublicIP=true" Type: String CreateClusterWithPublicIP: Description: "Whether to create the Cassandra cluster nodes in public subnet." Type: String Default: "false" AllowedValues: - "false" - "true" Conditions: CreateDev: !Equals - !Ref CreateDevInstance - true Create2ndNode: !Or - !Equals [!Ref ClusterSize, 2] - !Not [!Equals [!Ref ClusterSize, 1]] Resources: VPCStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: !Sub >- https://${S3BucketName}.s3.amazonaws.com/${S3KeyPrefix}/submodules/quickstart-aws-vpc/templates/aws-vpc.template.yaml Parameters: AvailabilityZones: !Join - "," - !Ref AvailabilityZones NumberOfAZs: "3" PrivateSubnet1ACIDR: !Ref PrivateSubnet1CIDR PrivateSubnet2ACIDR: !Ref PrivateSubnet2CIDR PrivateSubnet3ACIDR: !Ref PrivateSubnet3CIDR PublicSubnet1CIDR: !Ref PublicSubnet1CIDR PublicSubnet2CIDR: !Ref PublicSubnet2CIDR PublicSubnet3CIDR: !Ref PublicSubnet3CIDR VPCCIDR: !Ref VPCCIDR CassandraStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: !Sub >- https://${S3BucketName}.s3.amazonaws.com/${S3KeyPrefix}/templates/datastax-oss-existing-vpc.template.yaml Parameters: ClusterName: !Ref ClusterName CreateClusterWithPublicIP: !Ref CreateClusterWithPublicIP DatacenterName: !Ref DatacenterName ClusterSize: !Ref ClusterSize NodeInstanceType: !Ref NodeInstanceType NodeVolumeSize: !Ref NodeVolumeSize DevInstanceType: !Ref DevInstanceType DevVolumeSize: !Ref DevVolumeSize KeyPairName: !Ref KeyPairName PublicSubnet1ID: !GetAtt VPCStack.Outputs.PublicSubnet1ID PublicSubnet2ID: !GetAtt VPCStack.Outputs.PublicSubnet2ID PublicSubnet3ID: !GetAtt VPCStack.Outputs.PublicSubnet3ID PrivateSubnet1ID: !GetAtt VPCStack.Outputs.PrivateSubnet1AID PrivateSubnet2ID: !GetAtt VPCStack.Outputs.PrivateSubnet2AID PrivateSubnet3ID: !GetAtt VPCStack.Outputs.PrivateSubnet3AID RemoteAccessCIDR: !Ref RemoteAccessCIDR VPCID: !GetAtt VPCStack.Outputs.VPCID OSSVersion: !Ref OSSVersion CreateDevInstance: !Ref CreateDevInstance S3BucketName: !Ref S3BucketName S3KeyPrefix: !Ref S3KeyPrefix Outputs: ApacheCassandraVersion: Value: !Ref OSSVersion Description: Apache Cassandra Cluster Version. DevIpAddress: Condition: CreateDev Value: !GetAtt CassandraStack.Outputs.DevIpAddress Description: Dev Jump box Public IP DevUrl: Value: "http://oss-getting-started.s3-website-us-east-1.amazonaws.com" Description: Dev Url Seed1PrivateIpAddress: Value: !GetAtt - CassandraStack - Outputs.Seed1PrivateIpAddress Description: 1st Seed Private IP Seed1PublicIpAddress: Value: !GetAtt - CassandraStack - Outputs.Seed1PublicIpAddress Description: 1st Seed Public IP Seed2PrivateIpAddress: Condition: Create2ndNode Value: !GetAtt - CassandraStack - Outputs.Seed2PrivateIpAddress Description: 2nd Seed Private IP Seed2PublicIpAddress: Condition: Create2ndNode Value: !GetAtt - CassandraStack - Outputs.Seed2PublicIpAddress Description: 2nd Seed Public IP