AWSTemplateFormatVersion: '2010-09-09' Description: Deploy NebulaGraph on Amazon Web Services in a existing VPC. (qs-1t9ums4k2) Metadata: LICENSE: Apache License Version 2.0 AWS::CloudFormation::Interface: ParameterGroups: - Label: default: Network configuration Parameters: - VPCID - PrivateSubnetsID - PublicSubnet1ID - AccessCIDR - Label: default: Amazon EC2 configuration Parameters: - KeyPairName - Label: default: NebulaGraph configuration Parameters: - LicenseLink - GraphNodeCount - GraphInstanceType - StorageNodeCount - StorageInstanceType - StorageVolumeSize - WorkbenchInstanceType - Label: default: Quick Start configuration Parameters: - QSS3BucketName - QSS3BucketRegion - QSS3KeyPrefix ParameterLabels: VPCID: default: VPC ID PrivateSubnetsID: default: Private subnets ID PublicSubnet1ID: default: Public subnet 1 ID AccessCIDR: default: Permitted IP range KeyPairName: default: Key-pair name LicenseLink: default: NebulaGraph License Link GraphNodeCount: default: Number of Graph nodes GraphInstanceType: default: Graph Node Instance Type. StorageNodeCount: default: Number of Storage nodes StorageInstanceType: default: Storage Node Instance Type. StorageVolumeSize: default: Volume size of Storage nodes WorkbenchInstanceType: default: Tools Instance Type. QSS3BucketName: default: Quick Start S3 bucket name QSS3BucketRegion: default: Quick Start S3 bucket Region QSS3KeyPrefix: default: Quick Start S3 key prefix Parameters: VPCID: Description: Existing VPC ID. Type: AWS::EC2::VPC::Id PrivateSubnetsID: Description: Private subnets ID(Select 1 if the number of Storage nodes is 1, otherwise select 3). Type: List PublicSubnet1ID: Description: Public subnet 1 ID. Type: AWS::EC2::Subnet::Id AccessCIDR: 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: Must be a valid IP range in the form x.x.x.x/x. Description: CIDR IP range permitted to access NebulaGraph instances. A value of 0.0.0.0/0 allows access from any IP address. Default: 10.0.0.0/16 Type: String KeyPairName: AllowedPattern: ^.+$ ConstraintDescription: Cannot be empty. Description: Key pairs allow you to connect to your instance after it launches. Type: AWS::EC2::KeyPair::KeyName LicenseLink: Description: You can skip this for 3-day free trial, or you can contact us for an enterprise license via https://www.nebula-graph.io/contact. Type: String GraphNodeCount: AllowedValues: - 1 - 2 - 3 Default: 1 Description: Number of Graph nodes. It is strongly recommended to have a minimum 2 Graph nodes in order to ensure high availability. Type: Number GraphInstanceType: Description: Amazon EC2 instance type for the Graph nodes. Type: String Default: t3.large AllowedValues: - t3.large - t3.xlarge - t3.2xlarge - m6i.large - m6i.xlarge - m6i.2xlarge - m6i.4xlarge - m6i.8xlarge - m6i.12xlarge - m6i.16xlarge - m6i.24xlarge - m6i.32xlarge - m6i.metal - m6a.large - m6a.xlarge - m6a.2xlarge - m6a.4xlarge - m6a.8xlarge - m6a.12xlarge - m6a.16xlarge - m6a.24xlarge - m6a.32xlarge - m6a.48xlarge - m5a.large - m5a.xlarge - m5a.2xlarge - m5a.4xlarge - m5a.8xlarge - m5a.12xlarge - m5a.16xlarge - m5a.24xlarge - m5n.large - m5n.xlarge - m5n.2xlarge - m5n.4xlarge - m5n.8xlarge - m5n.12xlarge - m5n.16xlarge - m5n.24xlarge - m5n.metal - m5zn.large - m5zn.xlarge - m5zn.2xlarge - m5zn.3xlarge - m5zn.6xlarge - m5zn.12xlarge - m5zn.metal - r5a.large - r5a.xlarge - r5a.2xlarge - r5a.4xlarge - r5a.8xlarge - r5a.12xlarge - r5a.16xlarge - r5a.24xlarge - r6i.large - r6i.xlarge - r6i.2xlarge - r6i.4xlarge - r6i.8xlarge - r6i.12xlarge - r6i.16xlarge - r6i.24xlarge - r6i.32xlarge - r6i.metal StorageNodeCount: AllowedValues: - 1 - 3 - 5 - 7 Default: 1 Description: Number of storage node. It is strongly recommended to have a minimum 3 storage nodes in order to ensure high availability. Type: Number StorageInstanceType: Description: Amazon EC2 instance type for the Storage nodes. Type: String Default: c5.large AllowedValues: - c5.large - c5.xlarge - c5.2xlarge - c5.4xlarge - c5.9xlarge - c5.12xlarge - c5a.large - c5a.xlarge - c5a.2xlarge - c5a.4xlarge - c5a.8xlarge - c5a.12xlarge - c5a.16xlarge - c6a.large - c6a.xlarge - c6a.2xlarge - c6a.4xlarge - c6a.8xlarge - c6a.12xlarge - c6a.16xlarge - c6i.large - c6i.xlarge - c6i.2xlarge - c6i.4xlarge - c6i.8xlarge - c6i.12xlarge - c6i.16xlarge StorageVolumeSize: Description: 'Amazon EBS data-volume to be attached to Storage node in GBs, range of values [32-16384].The cluster size you need is: the_sum_of_edge_number_and_vertex_number * average_bytes_of_properties * 7.5 * 120%.' Type: Number Default: 32 MinValue: 32 MaxValue: 16384 WorkbenchInstanceType: Description: Amazon EC2 instance type for NebulaGraph Workbench node.(NebulaGraph Explorer, NebulaGraph Dashboard, NebulaGraph Analytics and NebulaGraph Exchange are included in the workbench.) Type: String Default: t3.medium AllowedValues: - t3.medium - t3.large - t3.xlarge - t3.2xlarge - m5.large - m5.xlarge - m5.2xlarge - m5.4xlarge - m5a.large - m5a.xlarge - m5a.2xlarge - m5a.4xlarge - c5.large - c5.xlarge - c5.2xlarge - c5.4xlarge QSS3BucketName: AllowedPattern: ^[0-9a-zA-Z]+([0-9a-zA-Z-]*[0-9a-zA-Z])*$ ConstraintDescription: The S3 bucket name can include numbers, lowercase letters, and hyphens (-), but it cannot start or end with a hyphen. Default: aws-quickstart Description: Name of the S3 bucket for your copy of the deployment assets. Keep the default name unless you are customizing the template. Changing the name updates code references to point to a new location. Type: String QSS3KeyPrefix: AllowedPattern: ^[0-9a-zA-Z-/.]*$ ConstraintDescription: The S3 key prefix can include numbers, lowercase letters, uppercase letters, hyphens (-), underscores (_), periods (.), asterisks (*), single quotes ('), open parenthesis ((), close parenthesis ()), and forward slashes (/). End the prefix with a forward slash. Default: quickstart-vesoft-nebula-graph-cloud/ Description: S3 key prefix that is used to simulate a folder for your copy of the deployment assets. Keep the default prefix unless you are customizing the template. Changing the prefix updates code references to point to a new location. Type: String QSS3BucketRegion: Default: 'us-east-1' Description: AWS Region where the S3 bucket (QSS3BucketName) is hosted. Keep the default Region unless you are customizing the template. Changing the Region updates code references to point to a new location. When using your own bucket, specify the Region. Type: String Conditions: UsingDefaultBucket: !Equals [ !Ref QSS3BucketName, 'aws-quickstart' ] 3MetaNodesCondition: !Not - !Equals [ !Ref StorageNodeCount, '1' ] MoreThan2GraphNodesCondition: !Or - !Equals [!Ref GraphNodeCount, '2'] - !Equals [!Ref GraphNodeCount, '3'] Resources: SecurityGroupStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: Fn::Sub: - https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/securitygroups.template.yaml - S3Region: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion S3Bucket: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName Parameters: VPCID: !Ref VPCID SecurityGroupRulesStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: Fn::Sub: - https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/securitygroups-rules.template.yaml - S3Region: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion S3Bucket: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName Parameters: SecurityGroupID: !GetAtt SecurityGroupStack.Outputs.SecurityGroupID AccessCIDR: !Ref AccessCIDR IAMRoleStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: Fn::Sub: - https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/nebulagraph-iam.template.yaml - S3Region: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion S3Bucket: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName MetaInterfacesStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: Fn::Sub: - https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/meta-interface.template.yaml - S3Region: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion S3Bucket: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName Parameters: PrivateSubnet1ID: !Select [ 0, !Ref PrivateSubnetsID ] PrivateSubnet2ID: !If - 3MetaNodesCondition - !Select [ 1, !Ref PrivateSubnetsID ] - !Select [ 0, !Ref PrivateSubnetsID ] PrivateSubnet3ID: !If - 3MetaNodesCondition - !Select [ 2, !Ref PrivateSubnetsID ] - !Select [ 0, !Ref PrivateSubnetsID ] SecurityGroupID: !GetAtt SecurityGroupStack.Outputs.SecurityGroupID MetaNodeCount: !If - 3MetaNodesCondition - '3' - '1' GraphNodesStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: Fn::Sub: - https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/graph-cluster.template.yaml - S3Region: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion S3Bucket: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName Parameters: DeploymentID: !Select [ 2, !Split [ "/", !Ref AWS::StackId ] ] PrivateSubnet1ID: !Select [ 0, !Ref PrivateSubnetsID ] PrivateSubnet2ID: !If - 3MetaNodesCondition - !Select [ 1, !Ref PrivateSubnetsID ] - !Select [ 0, !Ref PrivateSubnetsID ] PrivateSubnet3ID: !If - 3MetaNodesCondition - !Select [ 2, !Ref PrivateSubnetsID ] - !Select [ 0, !Ref PrivateSubnetsID ] SecurityGroupID: !GetAtt SecurityGroupStack.Outputs.SecurityGroupID IAMRoleName: !GetAtt IAMRoleStack.Outputs.NebulaGraphIAMRole IAMProfileID: !GetAtt IAMRoleStack.Outputs.NebulaGraphIAMProfile KeyPairName: !Ref KeyPairName GraphInstanceType: !Ref GraphInstanceType GraphNodeCount: !Ref GraphNodeCount VolumeSize: '10' VolumeType: 'gp2' MetaEndpoints: !GetAtt MetaInterfacesStack.Outputs.MetaEndpoints NebulaGraphVersion: '3.1.3' QSS3BucketName: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName QSS3KeyPrefix: !Ref QSS3KeyPrefix QSS3BucketRegion: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion StorageNodesStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: Fn::Sub: - https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/storage-cluster.template.yaml - S3Region: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion S3Bucket: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName Parameters: DeploymentID: !Select [ 2, !Split [ "/", !Ref AWS::StackId ] ] PrivateSubnet1ID: !Select [ 0, !Ref PrivateSubnetsID ] PrivateSubnet2ID: !If - 3MetaNodesCondition - !Select [ 1, !Ref PrivateSubnetsID ] - !Select [ 0, !Ref PrivateSubnetsID ] PrivateSubnet3ID: !If - 3MetaNodesCondition - !Select [ 2, !Ref PrivateSubnetsID ] - !Select [ 0, !Ref PrivateSubnetsID ] SecurityGroupID: !GetAtt SecurityGroupStack.Outputs.SecurityGroupID IAMRoleName: !GetAtt IAMRoleStack.Outputs.NebulaGraphIAMRole IAMProfileID: !GetAtt IAMRoleStack.Outputs.NebulaGraphIAMProfile KeyPairName: !Ref KeyPairName LicenseLink: !Ref LicenseLink StorageInstanceType: !Ref StorageInstanceType StorageNodeCount: !Ref StorageNodeCount NetworkInterface1ID: !GetAtt MetaInterfacesStack.Outputs.NetworkInterface1ID NetworkInterface2ID: !GetAtt MetaInterfacesStack.Outputs.NetworkInterface2ID NetworkInterface3ID: !GetAtt MetaInterfacesStack.Outputs.NetworkInterface3ID VolumeSize: !Ref StorageVolumeSize VolumeType: 'gp2' MetaEndpoints: !GetAtt MetaInterfacesStack.Outputs.MetaEndpoints NebulaGraphVersion: '3.1.3' QSS3BucketName: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName QSS3KeyPrefix: !Ref QSS3KeyPrefix QSS3BucketRegion: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion WorkbenchNodeStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: Fn::Sub: - https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/workbench.template.yaml - S3Region: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion S3Bucket: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName Parameters: DeploymentID: !Select [ 2, !Split [ "/", !Ref AWS::StackId ] ] KeyPairName: !Ref KeyPairName LicenseLink: !Ref LicenseLink IAMRoleName: !GetAtt IAMRoleStack.Outputs.NebulaGraphIAMRole IAMRoleArn: !GetAtt IAMRoleStack.Outputs.NebulaGraphIAMRoleArn IAMProfileID: !GetAtt IAMRoleStack.Outputs.NebulaGraphIAMProfile InstanceType: !Ref WorkbenchInstanceType QSS3BucketName: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName QSS3KeyPrefix: !Ref QSS3KeyPrefix QSS3BucketRegion: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion SubnetID: !Select [ 0, !Ref PrivateSubnetsID ] SecurityGroupID: !GetAtt SecurityGroupStack.Outputs.SecurityGroupID NlbStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: Fn::Sub: - https://${S3Bucket}.s3.${S3Region}.${AWS::URLSuffix}/${QSS3KeyPrefix}templates/nlb.template.yaml - S3Region: !If - UsingDefaultBucket - !Ref 'AWS::Region' - !Ref QSS3BucketRegion S3Bucket: !If - UsingDefaultBucket - !Sub '${QSS3BucketName}-${AWS::Region}' - !Ref QSS3BucketName Parameters: VPCID: !Ref VPCID Subnets: !Join - ',' - [ !Ref PublicSubnet1ID ] ExplorerPort: '7002' ExplorerInstanceID: !GetAtt WorkbenchNodeStack.Outputs.InstanceID DashboardPort: '7005' DashboardInstanceID: !GetAtt WorkbenchNodeStack.Outputs.InstanceID Outputs: DeploymentID: Description: The Deployment ID Value: !Select [ 2, !Split [ "/", !Ref AWS::StackId ] ] DatabaseVersion: Value: '3.4.1' GraphEndpoint1: Description: The endpoint of Graph Node 1 Value: !Sub ['${PrivateIp}:9669', { PrivateIp: !GetAtt GraphNodesStack.Outputs.GraphInstance1PrivateIP }] GraphEndpoint2: Description: The endpoint of Graph Node 2 Condition: MoreThan2GraphNodesCondition Value: !Sub ['${PrivateIp}:9669', { PrivateIp: !GetAtt GraphNodesStack.Outputs.GraphInstance2PrivateIP }] GraphEndpoint3: Description: The endpoint of Graph Node 3 Condition: MoreThan2GraphNodesCondition Value: !Sub ['${PrivateIp}:9669', { PrivateIp: !GetAtt GraphNodesStack.Outputs.GraphInstance3PrivateIP }] Explorer: Description: Explorer is a browser-based visualization tool. Value: !Sub [ 'http://${ElbDNSName}:7002', { ElbDNSName: !GetAtt NlbStack.Outputs.ElbDNSName } ] ExplorerLoginInfo: Value: !Sub [ 'Default login username: root, password: nebula, connect host: ${PrivateIp}:9669', { PrivateIp: !GetAtt GraphNodesStack.Outputs.GraphInstance1PrivateIP } ] Dashboard: Description: Dashboard is a visualization tool that monitors and manages the status of machines and services in NebulaGraph clusters. Value: !Sub [ 'http://${ElbDNSName}:7005?lang=EN_US', { ElbDNSName: !GetAtt NlbStack.Outputs.ElbDNSName } ] DashboardLoginInfo: Value: 'The default login username/password is: nebula/nebula, use SSH username ubuntu, authorize the instance via key-pair secret and use sudo to import your cluster to Dashboard'