{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Resources": {
        "ClassroomIGW": {
            "Type": "AWS::EC2::InternetGateway",
            "Properties": {
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training"
                    }
                ]
            },
            "DependsOn": [
                "ClassroomVPC"
            ]
        },
        "ClassroomVPC": {
            "Type": "AWS::EC2::VPC",
            "Properties": {
                "CidrBlock": "10.10.0.0/16",
                "EnableDnsSupport": "true",
                "EnableDnsHostnames": "true",
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training"
                    },
                    {
                        "Key": "Name",
                        "Value": "pe-classroom-vpc"
                    }
                ]
            }
        },
        "IGWAttachment": {
            "Type": "AWS::EC2::VPCGatewayAttachment",
            "Properties": {
                "InternetGatewayId": {
                    "Ref": "ClassroomIGW"
                },
                "VpcId": {
                    "Ref": "ClassroomVPC"
                }
            }
        },
        "PublicRouteTable": {
            "Type": "AWS::EC2::RouteTable",
            "Properties": {
                "VpcId": {
                    "Ref": "ClassroomVPC"
                },
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training"
                    }
                ]
            }
        },
        "PublicRoute": {
            "Type": "AWS::EC2::Route",
            "Properties": {
                "DestinationCidrBlock": "0.0.0.0/0",
                "GatewayId": {
                    "Ref": "ClassroomIGW"
                },
                "RouteTableId": {
                    "Ref": "PublicRouteTable"
                }
            },
            "DependsOn": [
                "IGWAttachment"
            ]
        },
        "ClassroomSubnet": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "VpcId": {
                    "Ref": "ClassroomVPC"
                },
                "CidrBlock": "10.10.0.0/24",
                "AvailabilityZone": "us-west-2b",
                "PrivateDnsNameOptionsOnLaunch": {
                    "EnableResourceNameDnsAAAARecord": false,
                    "EnableResourceNameDnsARecord": true,
                    "HostnameType": "ip-name"
                },
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training"
                    },
                    {
                        "Key": "Name",
                        "Value": "classroom-subnet"
                    }
                ]
            }
        },
        "SubnetRouteTableAssociation": {
            "Type": "AWS::EC2::SubnetRouteTableAssociation",
            "Properties": {
                "SubnetId": {
                    "Ref": "ClassroomSubnet"
                },
                "RouteTableId": {
                    "Ref": "PublicRouteTable"
                }
            }
        },
        "ClassroomSecurityGroup": {
            "Type": "AWS::EC2::SecurityGroup",
            "Properties": {
                "GroupDescription": "Allow nodes communication.",
                "VpcId": {
                    "Ref": "ClassroomVPC"
                },
                "SecurityGroupIngress": [
                    {
                        "IpProtocol": "tcp",
                        "FromPort": 22,
                        "ToPort": 22,
                        "CidrIp": "0.0.0.0/0"
                    },
                    {
                        "IpProtocol": "tcp",
                        "FromPort": 2379,
                        "ToPort": 2379,
                        "CidrIp": "0.0.0.0/0"
                    },
                    {
                        "IpProtocol": "tcp",
                        "FromPort": 4000,
                        "ToPort": 4002,
                        "CidrIp": "0.0.0.0/0"
                    },
                    {
                        "IpProtocol": "tcp",
                        "FromPort": 3000,
                        "ToPort": 3000,
                        "CidrIp": "0.0.0.0/0"
                    },
                    {
                        "IpProtocol": "icmp",
                        "FromPort": -1,
                        "ToPort": -1,
                        "CidrIp": "0.0.0.0/0"
                    }
                ],
                "SecurityGroupEgress": [
                    {
                        "IpProtocol": "-1",
                        "CidrIp": "0.0.0.0/0"
                    }
                ],
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training"
                    },
                    {
                        "Key": "Name",
                        "Value": "classroom-sg"
                    }
                ]
            }
        },
        "NodeSecurityGroupRefInboundRule": {
            "Type": "AWS::EC2::SecurityGroupIngress",
            "Properties": {
                "IpProtocol": "-1",
                "SourceSecurityGroupId": {
                    "Fn::GetAtt": [
                        "ClassroomSecurityGroup",
                        "GroupId"
                    ]
                },
                "GroupId": {
                    "Fn::GetAtt": [
                        "ClassroomSecurityGroup",
                        "GroupId"
                    ]
                }
            }
        },
        "TiKVLT": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "VersionDescription": "v1",
                "LaunchTemplateName": {
                    "Fn::Sub": "${AWS::StackName}-classroom-tikv-lt"
                },
                "LaunchTemplateData": {
                    "IamInstanceProfile": {
                        "Name": "pe-service-instance-role"
                    },
                    "BlockDeviceMappings": [
                        {
                            "DeviceName": "/dev/xvda",
                            "Ebs": {
                                "DeleteOnTermination": true,
                                "Encrypted": false,
                                "VolumeSize": 100,
                                "VolumeType": "gp2"
                            }
                        }
                    ],
                    "NetworkInterfaces": [
                        {
                            "DeviceIndex": 0,
                            "AssociatePublicIpAddress": true,
                            "Groups": [
                                {
                                    "Ref": "ClassroomSecurityGroup"
                                }
                            ],
                            "DeleteOnTermination": true
                        }
                    ],
                    "ImageId": "ami-094125af156557ca2",
                    "InstanceType": "c5.xlarge",
                    "KeyName": "pe-apac-class-key",
                    "TagSpecifications": [
                        {
                            "ResourceType": "instance",
                            "Tags": [
                                {
                                    "Key": "owner",
                                    "Value": "chenhao.huang@pingcap.com - APAC customer training"
                                },
                                {
                                    "Key": "Name",
                                    "Value": "kv"
                                }
                            ]
                        }
                    ],
                    "UserData": {
                        "Fn::Base64": {
                            "Fn::Join": [
                                "",
                                [
                                    "#!/bin/bash\n",
                                    "echo LANG=en_US.utf-8 >> /etc/environment\n",
                                    "echo LC_ALL=en_US.utf-8 >> /etc/environment\n",
                                    "mkdir ~ec2-user/stage/\n",
                                    "cd ~ec2-user/stage/\n",
                                    "rm -rf tidb-course-201-lab/\n",
                                    "yum -y update\n",
                                    "yum -y install git numactl awscli\n",
                                    "rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022\n",
                                    "wget https://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm\n",
                                    "yum -y install mysql57-community-release-el7-10.noarch.rpm\n",
                                    "yum -y install mysql-community-client\n",
                                    "wget https://pingcap-edu.s3.us-west-2.amazonaws.com/mysql-community-server-5.7.41-1.el7.x86_64.rpm\n",
                                    "rpm -ivh mysql-community-server-5.7.41-1.el7.x86_64.rpm\n",
                                    "wget https://pingcap-edu.s3.us-west-2.amazonaws.com/tidb-admin-dataset.zip\n",
                                    "git clone https://github.com/pingcap/tidb-course-201-lab.git\n",
                                    "REGION_CODE=`curl http://169.254.169.254/latest/meta-data/placement/region`\n",
                                    "echo export REGION_CODE=${REGION_CODE} > ~ec2-user/cloud-env.sh\n",
                                    "alias cp='cp'\n",
                                    "cp -R tidb-course-201-lab/setup/tidb-lab-aws-8-nodes-amz2/* ~ec2-user/\n",
                                    "cp -R tidb-course-201-lab/setup/tidb-lab-mysql-init-amz2/show-mysql-password.sh ~ec2-user/\n",
                                    "cd ~\n",
                                    "chown -R ec2-user:ec2-user ~ec2-user/*\n",
                                    "chmod +x ~ec2-user/*.sh\n",
                                    "echo \"if [ -f /home/ec2-user/hosts-env.sh ]; then\" >> ~ec2-user/.bashrc\n",
                                    "echo \"    source /home/ec2-user/hosts-env.sh\" >> ~ec2-user/.bashrc\n",
                                    "echo \"fi;\" >> ~ec2-user/.bashrc\n",
                                    "chown ec2-user:ec2-user ~ec2-user/.bashrc\n"
                                ]
                            ]
                        }
                    }
                }
            }
        },
        "PDLT": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "VersionDescription": "v1",
                "LaunchTemplateName": {
                    "Fn::Sub": "${AWS::StackName}-classroom-pd-lt"
                },
                "LaunchTemplateData": {
                    "IamInstanceProfile": {
                        "Name": "pe-service-instance-role"
                    },
                    "BlockDeviceMappings": [
                        {
                            "DeviceName": "/dev/xvda",
                            "Ebs": {
                                "DeleteOnTermination": true,
                                "Encrypted": false,
                                "VolumeSize": 30,
                                "VolumeType": "gp2"
                            }
                        }
                    ],
                    "NetworkInterfaces": [
                        {
                            "DeviceIndex": 0,
                            "AssociatePublicIpAddress": true,
                            "Groups": [
                                {
                                    "Ref": "ClassroomSecurityGroup"
                                }
                            ],
                            "DeleteOnTermination": true
                        }
                    ],
                    "ImageId": "ami-094125af156557ca2",
                    "InstanceType": "c5.xlarge",
                    "KeyName": "pe-apac-class-key",
                    "TagSpecifications": [
                        {
                            "ResourceType": "instance",
                            "Tags": [
                                {
                                    "Key": "owner",
                                    "Value": "chenhao.huang@pingcap.com - APAC customer training"
                                },
                                {
                                    "Key": "Name",
                                    "Value": "pd"
                                }
                            ]
                        }
                    ],
                    "UserData": {
                        "Fn::Base64": {
                            "Fn::Join": [
                                "",
                                [
                                    "#!/bin/bash\n",
                                    "echo LANG=en_US.utf-8 >> /etc/environment\n",
                                    "echo LC_ALL=en_US.utf-8 >> /etc/environment\n",
                                    "mkdir ~ec2-user/stage/\n",
                                    "cd ~ec2-user/stage/\n",
                                    "rm -rf tidb-course-201-lab/\n",
                                    "yum -y update\n",
                                    "yum -y install git numactl awscli\n",
                                    "rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022\n",
                                    "wget https://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm\n",
                                    "yum -y install mysql57-community-release-el7-10.noarch.rpm\n",
                                    "yum -y install mysql-community-client\n",
                                    "wget https://pingcap-edu.s3.us-west-2.amazonaws.com/mysql-community-server-5.7.41-1.el7.x86_64.rpm\n",
                                    "rpm -ivh mysql-community-server-5.7.41-1.el7.x86_64.rpm\n",
                                    "wget https://pingcap-edu.s3.us-west-2.amazonaws.com/tidb-admin-dataset.zip\n",
                                    "git clone https://github.com/pingcap/tidb-course-201-lab.git\n",
                                    "REGION_CODE=`curl http://169.254.169.254/latest/meta-data/placement/region`\n",
                                    "echo export REGION_CODE=${REGION_CODE} > ~ec2-user/cloud-env.sh\n",
                                    "alias cp='cp'\n",
                                    "cp -R tidb-course-201-lab/setup/tidb-lab-aws-8-nodes-amz2/* ~ec2-user/\n",
                                    "cp -R tidb-course-201-lab/setup/tidb-lab-mysql-init-amz2/show-mysql-password.sh ~ec2-user/\n",
                                    "cd ~\n",
                                    "chown -R ec2-user:ec2-user ~ec2-user/*\n",
                                    "chmod +x ~ec2-user/*.sh\n",
                                    "echo \"if [ -f /home/ec2-user/hosts-env.sh ]; then\" >> ~ec2-user/.bashrc\n",
                                    "echo \"    source /home/ec2-user/hosts-env.sh\" >> ~ec2-user/.bashrc\n",
                                    "echo \"fi;\" >> ~ec2-user/.bashrc\n",
                                    "chown ec2-user:ec2-user ~ec2-user/.bashrc\n"
                                ]
                            ]
                        }
                    }
                }
            }
        },
        "TiDBLT": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "VersionDescription": "v1",
                "LaunchTemplateName": {
                    "Fn::Sub": "${AWS::StackName}-classroom-tidb-lt"
                },
                "LaunchTemplateData": {
                    "IamInstanceProfile": {
                        "Name": "pe-service-instance-role"
                    },
                    "BlockDeviceMappings": [
                        {
                            "DeviceName": "/dev/xvda",
                            "Ebs": {
                                "DeleteOnTermination": true,
                                "Encrypted": false,
                                "VolumeSize": 30,
                                "VolumeType": "gp2"
                            }
                        }
                    ],
                    "NetworkInterfaces": [
                        {
                            "DeviceIndex": 0,
                            "AssociatePublicIpAddress": true,
                            "Groups": [
                                {
                                    "Ref": "ClassroomSecurityGroup"
                                }
                            ],
                            "DeleteOnTermination": true
                        }
                    ],
                    "ImageId": "ami-094125af156557ca2",
                    "InstanceType": "c5.xlarge",
                    "KeyName": "pe-apac-class-key",
                    "TagSpecifications": [
                        {
                            "ResourceType": "instance",
                            "Tags": [
                                {
                                    "Key": "owner",
                                    "Value": "chenhao.huang@pingcap.com - APAC customer training"
                                },
                                {
                                    "Key": "Name",
                                    "Value": "db"
                                }
                            ]
                        }
                    ],
                    "UserData": {
                        "Fn::Base64": {
                            "Fn::Join": [
                                "",
                                [
                                    "#!/bin/bash\n",
                                    "echo LANG=en_US.utf-8 >> /etc/environment\n",
                                    "echo LC_ALL=en_US.utf-8 >> /etc/environment\n",
                                    "mkdir ~ec2-user/stage/\n",
                                    "cd ~ec2-user/stage/\n",
                                    "rm -rf tidb-course-201-lab/\n",
                                    "yum -y update\n",
                                    "yum -y install git numactl awscli\n",
                                    "rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022\n",
                                    "wget https://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm\n",
                                    "yum -y install mysql57-community-release-el7-10.noarch.rpm\n",
                                    "yum -y install mysql-community-client\n",
                                    "wget https://pingcap-edu.s3.us-west-2.amazonaws.com/mysql-community-server-5.7.41-1.el7.x86_64.rpm\n",
                                    "rpm -ivh mysql-community-server-5.7.41-1.el7.x86_64.rpm\n",
                                    "wget https://pingcap-edu.s3.us-west-2.amazonaws.com/tidb-admin-dataset.zip\n",
                                    "git clone https://github.com/pingcap/tidb-course-201-lab.git\n",
                                    "REGION_CODE=`curl http://169.254.169.254/latest/meta-data/placement/region`\n",
                                    "echo export REGION_CODE=${REGION_CODE} > ~ec2-user/cloud-env.sh\n",
                                    "alias cp='cp'\n",
                                    "cp -R tidb-course-201-lab/setup/tidb-lab-aws-8-nodes-amz2/* ~ec2-user/\n",
                                    "cp -R tidb-course-201-lab/setup/tidb-lab-mysql-init-amz2/show-mysql-password.sh ~ec2-user/\n",
                                    "cd ~\n",
                                    "chown -R ec2-user:ec2-user ~ec2-user/*\n",
                                    "chmod +x ~ec2-user/*.sh\n",
                                    "echo \"if [ -f /home/ec2-user/hosts-env.sh ]; then\" >> ~ec2-user/.bashrc\n",
                                    "echo \"    source /home/ec2-user/hosts-env.sh\" >> ~ec2-user/.bashrc\n",
                                    "echo \"fi;\" >> ~ec2-user/.bashrc\n",
                                    "chown ec2-user:ec2-user ~ec2-user/.bashrc\n"
                                ]
                            ]
                        }
                    }
                }
            }
        },
        "TiFlashLT": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "VersionDescription": "v1",
                "LaunchTemplateName": {
                    "Fn::Sub": "${AWS::StackName}-classroom-tiflash-lt"
                },
                "LaunchTemplateData": {
                    "IamInstanceProfile": {
                        "Name": "pe-service-instance-role"
                    },
                    "BlockDeviceMappings": [
                        {
                            "DeviceName": "/dev/xvda",
                            "Ebs": {
                                "DeleteOnTermination": true,
                                "Encrypted": false,
                                "VolumeSize": 100,
                                "VolumeType": "gp2"
                            }
                        }
                    ],
                    "NetworkInterfaces": [
                        {
                            "DeviceIndex": 0,
                            "AssociatePublicIpAddress": true,
                            "Groups": [
                                {
                                    "Ref": "ClassroomSecurityGroup"
                                }
                            ],
                            "DeleteOnTermination": true
                        }
                    ],
                    "ImageId": "ami-094125af156557ca2",
                    "InstanceType": "c5.xlarge",
                    "KeyName": "pe-apac-class-key",
                    "TagSpecifications": [
                        {
                            "ResourceType": "instance",
                            "Tags": [
                                {
                                    "Key": "owner",
                                    "Value": "chenhao.huang@pingcap.com - APAC customer training"
                                },
                                {
                                    "Key": "Name",
                                    "Value": "tiflash"
                                }
                            ]
                        }
                    ],
                    "UserData": {
                        "Fn::Base64": {
                            "Fn::Join": [
                                "",
                                [
                                    "#!/bin/bash\n",
                                    "echo LANG=en_US.utf-8 >> /etc/environment\n",
                                    "echo LC_ALL=en_US.utf-8 >> /etc/environment\n",
                                    "mkdir ~ec2-user/stage/\n",
                                    "cd ~ec2-user/stage/\n",
                                    "rm -rf tidb-course-201-lab/\n",
                                    "yum -y update\n",
                                    "yum -y install git numactl awscli\n",
                                    "rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022\n",
                                    "wget https://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm\n",
                                    "yum -y install mysql57-community-release-el7-10.noarch.rpm\n",
                                    "yum -y install mysql-community-client\n",
                                    "wget https://pingcap-edu.s3.us-west-2.amazonaws.com/mysql-community-server-5.7.41-1.el7.x86_64.rpm\n",
                                    "rpm -ivh mysql-community-server-5.7.41-1.el7.x86_64.rpm\n",
                                    "wget https://pingcap-edu.s3.us-west-2.amazonaws.com/tidb-admin-dataset.zip\n",
                                    "git clone https://github.com/pingcap/tidb-course-201-lab.git\n",
                                    "REGION_CODE=`curl http://169.254.169.254/latest/meta-data/placement/region`\n",
                                    "echo export REGION_CODE=${REGION_CODE} > ~ec2-user/cloud-env.sh\n",
                                    "alias cp='cp'\n",
                                    "cp -R tidb-course-201-lab/setup/tidb-lab-aws-8-nodes-amz2/* ~ec2-user/\n",
                                    "cp -R tidb-course-201-lab/setup/tidb-lab-mysql-init-amz2/show-mysql-password.sh ~ec2-user/\n",
                                    "cd ~\n",
                                    "chown -R ec2-user:ec2-user ~ec2-user/*\n",
                                    "chmod +x ~ec2-user/*.sh\n",
                                    "echo \"if [ -f /home/ec2-user/hosts-env.sh ]; then\" >> ~ec2-user/.bashrc\n",
                                    "echo \"    source /home/ec2-user/hosts-env.sh\" >> ~ec2-user/.bashrc\n",
                                    "echo \"fi;\" >> ~ec2-user/.bashrc\n",
                                    "chown ec2-user:ec2-user ~ec2-user/.bashrc\n"
                                ]
                            ]
                        }
                    }
                }
            }
        },
        "TonyKVASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "AutoScalingGroupName": "classroom-tony-kv-asg",
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "TiKVLT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "TiKVLT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "0",
                "MinSize": "0",
                "DesiredCapacity": "0",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "ClassroomSubnet"
                    }
                ],
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training",
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": "tony",
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWAttachment"
            ]
        },
        "TonyPDASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "AutoScalingGroupName": "classroom-tony-pd-asg",
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "PDLT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "PDLT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "0",
                "MinSize": "0",
                "DesiredCapacity": "0",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "ClassroomSubnet"
                    }
                ],
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training",
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": "tony",
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWAttachment"
            ]
        },
        "TonyTiFlashASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "AutoScalingGroupName": "classroom-tony-tiflash-asg",
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "TiFlashLT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "TiFlashLT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "0",
                "MinSize": "0",
                "DesiredCapacity": "0",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "ClassroomSubnet"
                    }
                ],
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training",
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": "tony",
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWAttachment"
            ]
        },
        "TonyDBASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "AutoScalingGroupName": "classroom-tony-db-asg",
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "TiDBLT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "TiDBLT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "0",
                "MinSize": "0",
                "DesiredCapacity": "0",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "ClassroomSubnet"
                    }
                ],
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training",
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": "tony",
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWAttachment"
            ]
        },
        "FeiKVASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "AutoScalingGroupName": "classroom-fei-kv-asg",
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "TiKVLT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "TiKVLT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "0",
                "MinSize": "0",
                "DesiredCapacity": "0",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "ClassroomSubnet"
                    }
                ],
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training",
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": "fei",
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWAttachment"
            ]
        },
        "FeiPDASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "AutoScalingGroupName": "classroom-fei-pd-asg",
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "PDLT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "PDLT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "0",
                "MinSize": "0",
                "DesiredCapacity": "0",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "ClassroomSubnet"
                    }
                ],
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training",
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": "fei",
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWAttachment"
            ]
        },
        "FeiTiFlashASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "AutoScalingGroupName": "classroom-fei-tiflash-asg",
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "TiFlashLT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "TiFlashLT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "0",
                "MinSize": "0",
                "DesiredCapacity": "0",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "ClassroomSubnet"
                    }
                ],
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training",
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": "fei",
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWAttachment"
            ]
        },
        "FeiDBASG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "AutoScalingGroupName": "classroom-fei-db-asg",
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "TiDBLT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "TiDBLT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "0",
                "MinSize": "0",
                "DesiredCapacity": "0",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "ClassroomSubnet"
                    }
                ],
                "Tags": [
                    {
                        "Key": "owner",
                        "Value": "chenhao.huang@pingcap.com - APAC customer training",
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": "fei",
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWAttachment"
            ]
        }
    }
}