{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Parameters": {
        "OwnerName": {
            "Type": "String"
        },
        "OwnerEmail": {
            "Type": "String"
        },
        "AZIdx": {
            "Type": "Number",
            "Default": 0,
            "MinValue": 0,
            "MaxValue": 2,
            "Description": "Resources from which AZ"
        }
    },
    "Mappings": {
        "ValueMap": {
            "us-west-2": {
                "AMI": "ami-0e730665a8d8eebb5",
                "key": "pe-class-key-oregon"
            },
            "ap-southeast-1": {
                "AMI": "ami-0dfb40636949bfea8",
                "key": "pe-class-key-singapore"
            },
            "ap-northeast-1": {
                "AMI": "ami-04de4c1fd6ee71a79",
                "key": "pe-class-key-tokyo"
            },
            "eu-central-1": {
                "AMI": "ami-01701ef283e1af183",
                "key": "pe-class-key-frankfurt"
            }
        },
        "UserDataMap": {
            "general": {
                "common": "#!/bin/bash\nmkdir ~ec2-user/stage/\ncd ~ec2-user/stage/\nrm -rf tidb-course-labs/\nrm -f /home/ec2-user/nohup*\ngit clone https://github.com/pingcap-inc/tidb-course-labs.git\nREGION_CODE=`curl http://169.254.169.254/latest/meta-data/placement/region`\necho export REGION_CODE=${REGION_CODE} > ~ec2-user/cloud-env.sh\nalias cp='cp'\ncp -R tidb-course-labs/labs/demo_016/* ~ec2-user/\ncd ~\nchown -R ec2-user:ec2-user ~ec2-user/*\nchmod +x ~ec2-user/*.sh\necho \"if [ -f /home/ec2-user/hosts-env.sh ]; then\" >> ~ec2-user/.bashrc\necho \"    source /home/ec2-user/hosts-env.sh\" >> ~ec2-user/.bashrc\necho \"fi;\" >> ~ec2-user/.bashrc\nchown ec2-user:ec2-user ~ec2-user/.bashrc\necho \"export PATH=\\$PATH:/usr/local/sysbench-1.0.17\" >> /home/ec2-user/.bash_profile\nchown ec2-user:ec2-user /home/ec2-user/.bash_profile\nchown -R ec2-user:ec2-user /home/ec2-user/stage/"
            }
        }
    },
    "Resources": {
        "DemoIGW": {
            "Type": "AWS::EC2::InternetGateway",
            "Properties": {
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        }
                    }
                ]
            },
            "DependsOn": [
                "DemoVPC"
            ]
        },
        "DemoVPC": {
            "Type": "AWS::EC2::VPC",
            "Properties": {
                "CidrBlock": "10.90.0.0/16",
                "EnableDnsSupport": "true",
                "EnableDnsHostnames": "true",
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        }
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Ref": "OwnerName"
                        }
                    }
                ]
            }
        },
        "CageNACL": {
            "Type": "AWS::EC2::NetworkAcl",
            "Properties": {
                "VpcId": {
                    "Ref": "DemoVPC"
                },
                "Tags": [
                    {
                        "Key": "Name",
                        "Value": "cage"
                    }
                ]
            }
        },
        "CageInboundRule": {
            "Type": "AWS::EC2::NetworkAclEntry",
            "Properties": {
                "NetworkAclId": {
                    "Ref": "CageNACL"
                },
                "RuleNumber": 100,
                "Protocol": -1,
                "RuleAction": "deny",
                "CidrBlock": "0.0.0.0/0"
            }
        },
        "CageOutboundRule": {
            "Type": "AWS::EC2::NetworkAclEntry",
            "Properties": {
                "NetworkAclId": {
                    "Ref": "CageNACL"
                },
                "RuleNumber": 100,
                "Protocol": -1,
                "Egress": true,
                "RuleAction": "deny",
                "CidrBlock": "0.0.0.0/0"
            }
        },
        "IGWA": {
            "Type": "AWS::EC2::VPCGatewayAttachment",
            "Properties": {
                "InternetGatewayId": {
                    "Ref": "DemoIGW"
                },
                "VpcId": {
                    "Ref": "DemoVPC"
                }
            }
        },
        "PublicRouteTable": {
            "Type": "AWS::EC2::RouteTable",
            "Properties": {
                "VpcId": {
                    "Ref": "DemoVPC"
                },
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        }
                    },
                    {
                        "Key": "Name",
                        "Value": "PE Quick Demo Public Route"
                    }
                ]
            }
        },
        "PublicRoute": {
            "Type": "AWS::EC2::Route",
            "Properties": {
                "DestinationCidrBlock": "0.0.0.0/0",
                "GatewayId": {
                    "Ref": "DemoIGW"
                },
                "RouteTableId": {
                    "Ref": "PublicRouteTable"
                }
            },
            "DependsOn": [
                "IGWA"
            ]
        },
        "SN1": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "VpcId": {
                    "Ref": "DemoVPC"
                },
                "CidrBlock": "10.90.1.0/24",
                "AvailabilityZone": {
                    "Fn::Select": [
                        {
                            "Ref": "AZIdx"
                        },
                        {
                            "Fn::GetAZs": ""
                        }
                    ]
                },
                "PrivateDnsNameOptionsOnLaunch": {
                    "EnableResourceNameDnsAAAARecord": false,
                    "EnableResourceNameDnsARecord": true,
                    "HostnameType": "ip-name"
                },
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        }
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Join": [
                                "-",
                                [
                                    "demo",
                                    "subnet",
                                    "1"
                                ]
                            ]
                        }
                    }
                ]
            }
        },
        "SN2": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "VpcId": {
                    "Ref": "DemoVPC"
                },
                "CidrBlock": "10.90.2.0/24",
                "AvailabilityZone": {
                    "Fn::Select": [
                        {
                            "Ref": "AZIdx"
                        },
                        {
                            "Fn::GetAZs": ""
                        }
                    ]
                },
                "PrivateDnsNameOptionsOnLaunch": {
                    "EnableResourceNameDnsAAAARecord": false,
                    "EnableResourceNameDnsARecord": true,
                    "HostnameType": "ip-name"
                },
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        }
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Join": [
                                "-",
                                [
                                    "demo",
                                    "subnet",
                                    "2"
                                ]
                            ]
                        }
                    }
                ]
            }
        },
        "SN3": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "VpcId": {
                    "Ref": "DemoVPC"
                },
                "CidrBlock": "10.90.3.0/24",
                "AvailabilityZone": {
                    "Fn::Select": [
                        {
                            "Ref": "AZIdx"
                        },
                        {
                            "Fn::GetAZs": ""
                        }
                    ]
                },
                "PrivateDnsNameOptionsOnLaunch": {
                    "EnableResourceNameDnsAAAARecord": false,
                    "EnableResourceNameDnsARecord": true,
                    "HostnameType": "ip-name"
                },
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        }
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Join": [
                                "-",
                                [
                                    "demo",
                                    "subnet",
                                    "3"
                                ]
                            ]
                        }
                    }
                ]
            }
        },
        "SN4": {
            "Type": "AWS::EC2::Subnet",
            "Properties": {
                "VpcId": {
                    "Ref": "DemoVPC"
                },
                "CidrBlock": "10.90.4.0/24",
                "AvailabilityZone": {
                    "Fn::Select": [
                        {
                            "Ref": "AZIdx"
                        },
                        {
                            "Fn::GetAZs": ""
                        }
                    ]
                },
                "PrivateDnsNameOptionsOnLaunch": {
                    "EnableResourceNameDnsAAAARecord": false,
                    "EnableResourceNameDnsARecord": true,
                    "HostnameType": "ip-name"
                },
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        }
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Join": [
                                "-",
                                [
                                    "demo",
                                    "subnet",
                                    "4"
                                ]
                            ]
                        }
                    }
                ]
            }
        },
        "SRTA1": {
            "Type": "AWS::EC2::SubnetRouteTableAssociation",
            "Properties": {
                "SubnetId": {
                    "Ref": "SN1"
                },
                "RouteTableId": {
                    "Ref": "PublicRouteTable"
                }
            }
        },
        "SRTA2": {
            "Type": "AWS::EC2::SubnetRouteTableAssociation",
            "Properties": {
                "SubnetId": {
                    "Ref": "SN2"
                },
                "RouteTableId": {
                    "Ref": "PublicRouteTable"
                }
            }
        },
        "SRTA3": {
            "Type": "AWS::EC2::SubnetRouteTableAssociation",
            "Properties": {
                "SubnetId": {
                    "Ref": "SN3"
                },
                "RouteTableId": {
                    "Ref": "PublicRouteTable"
                }
            }
        },
        "SRTA4": {
            "Type": "AWS::EC2::SubnetRouteTableAssociation",
            "Properties": {
                "SubnetId": {
                    "Ref": "SN4"
                },
                "RouteTableId": {
                    "Ref": "PublicRouteTable"
                }
            }
        },
        "DemoSG": {
            "Type": "AWS::EC2::SecurityGroup",
            "Properties": {
                "GroupDescription": "Allow nodes communication.",
                "VpcId": {
                    "Ref": "DemoVPC"
                },
                "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": "tcp",
                        "FromPort": 10080,
                        "ToPort": 10080,
                        "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": {
                            "Ref": "OwnerEmail"
                        }
                    },
                    {
                        "Key": "Name",
                        "Value": {
                            "Fn::Join": [
                                "-",
                                [
                                    {
                                        "Ref": "OwnerName"
                                    },
                                    "-sg"
                                ]
                            ]
                        }
                    }
                ]
            }
        },
        "IRule": {
            "Type": "AWS::EC2::SecurityGroupIngress",
            "Properties": {
                "IpProtocol": "-1",
                "SourceSecurityGroupId": {
                    "Fn::GetAtt": [
                        "DemoSG",
                        "GroupId"
                    ]
                },
                "GroupId": {
                    "Fn::GetAtt": [
                        "DemoSG",
                        "GroupId"
                    ]
                }
            }
        },
        "TG": {
            "Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
            "Properties": {
                "HealthCheckEnabled": "True",
                "HealthCheckIntervalSeconds": 5,
                "HealthCheckPort": "10080",
                "HealthCheckProtocol": "TCP",
                "HealthCheckTimeoutSeconds": 5,
                "HealthyThresholdCount": 2,
                "Port": 4000,
                "Protocol": "TCP",
                "TargetType": "ip",
                "VpcId": {
                    "Ref": "DemoVPC"
                }
            }
        },
        "NLB": {
            "Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
            "Properties": {
                "Type": "network",
                "Name": {
                    "Ref": "OwnerName"
                },
                "Scheme": "internal",
                "Subnets": [
                    {
                        "Ref": "SN1"
                    }
                ]
            }
        },
        "LSNR": {
            "Type": "AWS::ElasticLoadBalancingV2::Listener",
            "Properties": {
                "DefaultActions": [
                    {
                        "Type": "forward",
                        "ForwardConfig": {
                            "TargetGroups": [
                                {
                                    "TargetGroupArn": {
                                        "Ref": "TG"
                                    }
                                }
                            ]
                        }
                    }
                ],
                "LoadBalancerArn": {
                    "Ref": "NLB"
                },
                "Port": 4000,
                "Protocol": "TCP"
            }
        },
        "KVT": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "VersionDescription": "v1",
                "LaunchTemplateData": {
                    "Monitoring": {
                        "Enabled": false
                    },
                    "IamInstanceProfile": {
                        "Name": "course-303-node-role"
                    },
                    "BlockDeviceMappings": [
                        {
                            "DeviceName": "/dev/xvda",
                            "Ebs": {
                                "DeleteOnTermination": true,
                                "Encrypted": false,
                                "VolumeSize": 100,
                                "VolumeType": "gp3"
                            }
                        }
                    ],
                    "NetworkInterfaces": [
                        {
                            "DeviceIndex": 0,
                            "AssociatePublicIpAddress": true,
                            "Groups": [
                                {
                                    "Ref": "DemoSG"
                                }
                            ],
                            "DeleteOnTermination": true
                        }
                    ],
                    "ImageId": {
                        "Fn::FindInMap": [
                            "ValueMap",
                            {
                                "Ref": "AWS::Region"
                            },
                            "AMI"
                        ]
                    },
                    "InstanceType": "m5.2xlarge",
                    "KeyName": {
                        "Fn::FindInMap": [
                            "ValueMap",
                            {
                                "Ref": "AWS::Region"
                            },
                            "key"
                        ]
                    },
                    "TagSpecifications": [
                        {
                            "ResourceType": "instance",
                            "Tags": [
                                {
                                    "Key": "Owner",
                                    "Value": {
                                        "Ref": "OwnerEmail"
                                    }
                                },
                                {
                                    "Key": "Name",
                                    "Value": "kv"
                                }
                            ]
                        }
                    ],
                    "UserData": {
                        "Fn::Base64": {
                            "Fn::FindInMap": [
                                "UserDataMap",
                                "general",
                                "common"
                            ]
                        }
                    }
                }
            }
        },
        "PDT": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "VersionDescription": "v1",
                "LaunchTemplateData": {
                    "Monitoring": {
                        "Enabled": false
                    },
                    "IamInstanceProfile": {
                        "Name": "course-303-node-role"
                    },
                    "BlockDeviceMappings": [
                        {
                            "DeviceName": "/dev/xvda",
                            "Ebs": {
                                "DeleteOnTermination": true,
                                "Encrypted": false,
                                "VolumeSize": 60,
                                "VolumeType": "gp2"
                            }
                        }
                    ],
                    "NetworkInterfaces": [
                        {
                            "DeviceIndex": 0,
                            "AssociatePublicIpAddress": true,
                            "Groups": [
                                {
                                    "Ref": "DemoSG"
                                }
                            ],
                            "DeleteOnTermination": true
                        }
                    ],
                    "ImageId": {
                        "Fn::FindInMap": [
                            "ValueMap",
                            {
                                "Ref": "AWS::Region"
                            },
                            "AMI"
                        ]
                    },
                    "InstanceType": "c5.xlarge",
                    "KeyName": {
                        "Fn::FindInMap": [
                            "ValueMap",
                            {
                                "Ref": "AWS::Region"
                            },
                            "key"
                        ]
                    },
                    "TagSpecifications": [
                        {
                            "ResourceType": "instance",
                            "Tags": [
                                {
                                    "Key": "Owner",
                                    "Value": {
                                        "Ref": "OwnerEmail"
                                    }
                                },
                                {
                                    "Key": "Name",
                                    "Value": "pd"
                                }
                            ]
                        }
                    ],
                    "UserData": {
                        "Fn::Base64": {
                            "Fn::FindInMap": [
                                "UserDataMap",
                                "general",
                                "common"
                            ]
                        }
                    }
                }
            }
        },
        "DBT": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "VersionDescription": "v1",
                "LaunchTemplateData": {
                    "Monitoring": {
                        "Enabled": false
                    },
                    "IamInstanceProfile": {
                        "Name": "course-303-node-role"
                    },
                    "BlockDeviceMappings": [
                        {
                            "DeviceName": "/dev/xvda",
                            "Ebs": {
                                "DeleteOnTermination": true,
                                "Encrypted": false,
                                "VolumeSize": 60,
                                "VolumeType": "gp2"
                            }
                        }
                    ],
                    "NetworkInterfaces": [
                        {
                            "DeviceIndex": 0,
                            "AssociatePublicIpAddress": true,
                            "Groups": [
                                {
                                    "Ref": "DemoSG"
                                }
                            ],
                            "DeleteOnTermination": true
                        }
                    ],
                    "ImageId": {
                        "Fn::FindInMap": [
                            "ValueMap",
                            {
                                "Ref": "AWS::Region"
                            },
                            "AMI"
                        ]
                    },
                    "InstanceType": "c5.2xlarge",
                    "KeyName": {
                        "Fn::FindInMap": [
                            "ValueMap",
                            {
                                "Ref": "AWS::Region"
                            },
                            "key"
                        ]
                    },
                    "TagSpecifications": [
                        {
                            "ResourceType": "instance",
                            "Tags": [
                                {
                                    "Key": "Owner",
                                    "Value": {
                                        "Ref": "OwnerEmail"
                                    }
                                },
                                {
                                    "Key": "Name",
                                    "Value": "db"
                                }
                            ]
                        }
                    ],
                    "UserData": {
                        "Fn::Base64": {
                            "Fn::FindInMap": [
                                "UserDataMap",
                                "general",
                                "common"
                            ]
                        }
                    }
                }
            }
        },
        "MLT": {
            "Type": "AWS::EC2::LaunchTemplate",
            "Properties": {
                "VersionDescription": "v1",
                "LaunchTemplateData": {
                    "IamInstanceProfile": {
                        "Name": "course-303-node-role"
                    },
                    "BlockDeviceMappings": [
                        {
                            "DeviceName": "/dev/xvda",
                            "Ebs": {
                                "DeleteOnTermination": true,
                                "Encrypted": false,
                                "VolumeSize": 100,
                                "VolumeType": "gp2"
                            }
                        }
                    ],
                    "NetworkInterfaces": [
                        {
                            "DeviceIndex": 0,
                            "AssociatePublicIpAddress": true,
                            "Groups": [
                                {
                                    "Ref": "DemoSG"
                                }
                            ],
                            "DeleteOnTermination": true
                        }
                    ],
                    "ImageId": {
                        "Fn::FindInMap": [
                            "ValueMap",
                            {
                                "Ref": "AWS::Region"
                            },
                            "AMI"
                        ]
                    },
                    "InstanceType": "c5.4xlarge",
                    "KeyName": {
                        "Fn::FindInMap": [
                            "ValueMap",
                            {
                                "Ref": "AWS::Region"
                            },
                            "key"
                        ]
                    },
                    "TagSpecifications": [
                        {
                            "ResourceType": "instance",
                            "Tags": [
                                {
                                    "Key": "Owner",
                                    "Value": {
                                        "Ref": "OwnerEmail"
                                    }
                                },
                                {
                                    "Key": "Name",
                                    "Value": "monitor"
                                }
                            ]
                        }
                    ],
                    "UserData": {
                        "Fn::Base64": {
                            "Fn::Join": [
                                "\n",
                                [
                                    {
                                        "Fn::FindInMap": [
                                            "UserDataMap",
                                            "general",
                                            "common"
                                        ]
                                    },
                                    {
                                        "Fn::Sub": "/usr/bin/cfn-signal -e 0 --stack ${AWS::StackName} --resource MG --region ${AWS::Region} > ~ec2-user/USER_DATA_DONE 2>&1\n"
                                    }
                                ]
                            ]
                        }
                    }
                }
            }
        },
        "KVG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "KVT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "KVT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "4",
                "MinSize": "4",
                "DesiredCapacity": "4",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "SN1"
                    },
                    {
                        "Ref": "SN2"
                    },
                    {
                        "Ref": "SN3"
                    }
                ],
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        },
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": {
                            "Ref": "OwnerName"
                        },
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWA"
            ]
        },
        "PDG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "PDT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "PDT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "1",
                "MinSize": "1",
                "DesiredCapacity": "1",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "SN1"
                    },
                    {
                        "Ref": "SN2"
                    },
                    {
                        "Ref": "SN3"
                    }
                ],
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        },
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": {
                            "Ref": "OwnerName"
                        },
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWA"
            ]
        },
        "DBG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "DBT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "DBT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "2",
                "MinSize": "2",
                "DesiredCapacity": "2",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "SN1"
                    },
                    {
                        "Ref": "SN2"
                    }
                ],
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        },
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": {
                            "Ref": "OwnerName"
                        },
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWA"
            ]
        },
        "MG": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "LaunchTemplate": {
                    "LaunchTemplateId": {
                        "Ref": "MLT"
                    },
                    "Version": {
                        "Fn::GetAtt": [
                            "MLT",
                            "LatestVersionNumber"
                        ]
                    }
                },
                "MaxSize": "1",
                "MinSize": "1",
                "DesiredCapacity": "1",
                "VPCZoneIdentifier": [
                    {
                        "Ref": "SN4"
                    }
                ],
                "Tags": [
                    {
                        "Key": "Owner",
                        "Value": {
                            "Ref": "OwnerEmail"
                        },
                        "PropagateAtLaunch": "true"
                    },
                    {
                        "Key": "trainer",
                        "Value": {
                            "Ref": "OwnerName"
                        },
                        "PropagateAtLaunch": "true"
                    }
                ]
            },
            "DependsOn": [
                "IGWA"
            ],
            "CreationPolicy": {
                "ResourceSignal": {
                    "Timeout": "PT10M",
                    "Count": 1
                }
            }
        }
    }
}