通过ROS一键创建满足多可用区需求的ECS、SLB、RDS、ESS<资源编排服务>

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS MySQL,高可用系列 2核4GB
简介: 案例需求:在多个可用区创建多个ECS实例,弹性伸缩SLB、RDS、ECS资源 资源编排介绍: 简单介绍下:ROS 点击跳转关于ROS详细介绍 阿里云资源编排服务(ROS)可帮助用户简化云计算资源管理和自动化运维的服务。

案例需求:

在多个可用区创建多个ECS实例,弹性伸缩SLB、RDS、ECS资源。

资源编排介绍:

简单介绍下:ROS  ROS详细介绍
阿里云资源编排服务(ROS)可帮助用户简化云计算资源管理和自动化运维的服务。
用户遵循ROS定义的模板规范,编写模板文件,在模板中定义所需云计算资源的集合及资源间的依赖关系、资源配置细节等,ROS通过编排引擎自动完成所有资源的创建和配置,以达到自动化部署、运维的目的。

涉及资源类型简介:

ALIYUN::ECS::InstanceGroup: 用于创建一组 ECS 实例;详细介绍
ALIYUN::ECS::VSwitch:用于新建交换机;详细介绍
ALIYUN::ECS::VPC:用于新建专有网络;详细介绍
ALIYUN::ESS::ScalingGroup:用于创建伸缩组;详细介绍
ALIYUN::RDS::DBInstance:用于创建数据库实例;详细介绍
ALIYUN::SLB::LoadBalancer:用于创建负载均衡;详细介绍
ALIYUN::SLB::Listener:用于创建负载均衡监听器;详细介绍
ALIYUN::SLB::BackendServerAttachment:用于添加后端服务器;详细介绍
ALIYUN::ESS::ScalingConfiguration:用于创建伸缩配置;详细介绍
ALIYUN::ESS::ScalingGroupEnable:用于启用伸缩组;详细介绍

方案介绍:

相信大家熟知传统的交换网络,下图采用阿里云VPC产品的示意图,可以看出如果需要在多个可用区域创建资源,可采取下面的方式,创建一个VPC(专有网络),接下来创建多个VSwitch(虚拟交换机),可以完成将多个资源部署在多个可用区域内的:_1_zone_001_jpeg




注意:
本文代码示例完成双可用区创建资源栈;__关于模版代码中的参数具体含义就不一一介绍了, 详情请参考<涉及资源类型简介>。
资源栈感性理解:通过ROS模版的方式创建出一个或多个资源的集合。
   

需求拆分

  • 创建多个虚拟交换机完成多可用区需求,此处举例创建一个VSwitch:
"VSwitch1": {
  "Type": "ALIYUN::ECS::VSwitch",
  "DependsOn": "Vpc",
  "Properties": {
    "VSwitchName": {
      "Ref": "VSwitch1Name"
    },
    "VpcId": {
      "Ref": "Vpc"
    },
    "CidrBlock": {
      "Ref": "VSW1CidrBlock"
    },
    "Description": {
      "Ref": "VSW1Description"
    },
    "ZoneId": {
      "Ref": "VSW1ZoneId"
    }
  }
}
  • 创建多个ECS实例完成多ECS实例创建的需求,此处举例创建一组ECS实例,并将其部署与一个可用区,同样第二个可用区也创建一组ECS实例:
"EcsInstanceGroup1": {
  "Type": "ALIYUN::ECS::InstanceGroup",
  "DependsOn": "VSwitch1",
  "Properties": {
    "IoOptimized": "optimized",
    "ImageId": {
      "Ref": "EcsGroupImageId"
    },
    "SecurityGroupId": {
      "Ref": "SG"
    },
    "Password": {
      "Ref": "EcsPassword"
    },
    "MinAmount": {
      "Ref": "EcsGroup1MaxAmount"
    },
    "AllocatePublicIP": "false",
    "SystemDiskCategory": {
      "Ref": "EcsSystemDiskCategory"
    },
    "MaxAmount": {
      "Ref": "EcsGroup1MaxAmount"
    },
    "VSwitchId": {
      "Fn::GetAtt": [
        "VSwitch1",
        "VSwitchId"
      ]
    },
    "VpcId": {
      "Ref": "Vpc"
    },
    "InstanceType": {
      "Ref": "EcsGroupInstanceType"
    }
  }
}
  • 创建弹性伸缩组完成,将RDS和SLB实例都加入到组内,代码示例如下:
"ScalingGroup": {
  "Type": "ALIYUN::ESS::ScalingGroup",
  "DependsOn": "CreateListener",
  "Properties": {
    "DBInstanceIds": [
      {
        "Fn::GetAtt": [
          "Database",
          "DBInstanceId"
        ]
      }
    ],
    "DefaultCooldown": {
      "Ref": "EssDefaultCooldown"
    },
    "LoadBalancerIds": [
      {
        "Fn::GetAtt": [
          "LoadBalancer",
          "LoadBalancerId"
        ]
      }
    ],
    "MaxSize": {
      "Ref": "EssMaxSize"
    },
    "MinSize": {
      "Ref": "EssMinSize"
    },
    "VpcId": {
      "Ref": "Vpc"
    },
    "VSwitchIds": [
      {
        "Fn::GetAtt": [
          "VSwitch1",
          "VSwitchId"
        ]
      },
      {
        "Fn::GetAtt": [
          "VSwitch2",
          "VSwitchId"
        ]
      }
    ]
  }
}
  • 将创建的所有ECS实例,在启用伸缩组时候加入到伸缩组内,代码示例如下:
"ScalingGroupEnable": {
  "Type": "ALIYUN::ESS::ScalingGroupEnable",
  "DependsOn": "ScalingGroup",
  "Properties": {
    "ScalingGroupId": {
      "Fn::GetAtt": [
        "ScalingGroup",
        "ScalingGroupId"
      ]
    },
    "ScalingConfigurationId": {
      "Fn::GetAtt": [
        "ScalingConfiguration",
        "ScalingConfigurationId"
      ]
    },
    "InstanceIds": {
      "Fn::ListMerge": [
        {
          "Fn::GetAtt": [
            "EcsInstanceGroup1",
            "InstanceIds"
          ]
        },
        {
          "Fn::GetAtt": [
            "EcsInstanceGroup2",
            "InstanceIds"
          ]
        }
      ]
    }
  }
}
  • 创建需要的单个资源,如RDS、SLB资源,代码详见<相关模版>。

总结:

使用阿里云资源编排服务 ,不需要支付额外的费用。
传统部署打造一个这样的环境,还是需要一定物力、人力、时间的,利用本文中提供的ROS模板,可以很好,很方便的帮你一键部署此类环境,让你把更多的精力放在自己的业务上。
资源编排服务

相关模板

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Create Multi-ECS And Scaling Group And Rds And Slb In Double Zone.",
  "Conditions": {
    "CreateInstacneGroup2": {
      "Fn::Not": {
        "Fn::Equals": [
          0,
          {
            "Ref": "EcsGroup2MaxAmount"
          }
        ]
      }
    }
  },
  "Resources": {
    "Vpc": {
      "Type": "ALIYUN::ECS::VPC",
      "Properties": {
        "VpcName": {
          "Ref": "VpcName"
        },
        "CidrBlock": {
          "Ref": "VPCCidrBlock"
        },
        "Description": {
          "Ref": "VPCDescription"
        }
      }
    },
    "VSwitch1": {
      "Type": "ALIYUN::ECS::VSwitch",
      "DependsOn": "Vpc",
      "Properties": {
        "VSwitchName": {
          "Ref": "VSwitch1Name"
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": {
          "Ref": "VSW1CidrBlock"
        },
        "Description": {
          "Ref": "VSW1Description"
        },
        "ZoneId": {
          "Ref": "VSW1ZoneId"
        }
      }
    },
    "VSwitch2": {
      "Type": "ALIYUN::ECS::VSwitch",
      "DependsOn": "Vpc",
      "Properties": {
        "VSwitchName": {
          "Ref": "VSwitch2Name"
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": {
          "Ref": "VSW2CidrBlock"
        },
        "Description": {
          "Ref": "VSW2Description"
        },
        "ZoneId": {
          "Ref": "VSW2ZoneId"
        }
      }
    },
    "SG": {
      "Type": "ALIYUN::ECS::SecurityGroup",
      "DependsOn": "Vpc",
      "Properties": {
        "VpcId": {
          "Ref": "Vpc"
        },
        "SecurityGroupName": "mysg",
        "SecurityGroupIngress": [
          {
            "PortRange": "-1/-1",
            "Priority": 1,
            "SourceCidrIp": "0.0.0.0/0",
            "IpProtocol": "all",
            "NicType": "intranet"
          }
        ],
        "SecurityGroupEgress": [
          {
            "PortRange": "-1/-1",
            "Priority": 1,
            "IpProtocol": "all",
            "DestCidrIp": "0.0.0.0/0",
            "NicType": "intranet"
          }
        ]
      }
    },
    "EcsInstanceGroup1": {
      "Type": "ALIYUN::ECS::InstanceGroup",
      "DependsOn": "VSwitch1",
      "Properties": {
        "IoOptimized": "optimized",
        "ImageId": {
          "Ref": "EcsGroupImageId"
        },
        "SecurityGroupId": {
          "Ref": "SG"
        },
        "Password": {
          "Ref": "EcsPassword"
        },
        "MinAmount": {
          "Ref": "EcsGroup1MaxAmount"
        },
        "AllocatePublicIP": "false",
        "SystemDiskCategory": {
          "Ref": "EcsSystemDiskCategory"
        },
        "MaxAmount": {
          "Ref": "EcsGroup1MaxAmount"
        },
        "VSwitchId": {
          "Fn::GetAtt": [
            "VSwitch1",
            "VSwitchId"
          ]
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "InstanceType": {
          "Ref": "EcsGroupInstanceType"
        }
      }
    },
    "EcsInstanceGroup2": {
      "Type": "ALIYUN::ECS::InstanceGroup",
      "DependsOn": "VSwitch2",
      "Condition": "CreateInstacneGroup2",
      "Properties": {
        "IoOptimized": "optimized",
        "ImageId": {
          "Ref": "EcsGroupImageId"
        },
        "SecurityGroupId": {
          "Ref": "SG"
        },
        "Password": {
          "Ref": "EcsPassword"
        },
        "MinAmount": {
          "Ref": "EcsGroup2MaxAmount"
        },
        "AllocatePublicIP": "false",
        "SystemDiskCategory": {
          "Ref": "EcsSystemDiskCategory"
        },
        "MaxAmount": {
          "Ref": "EcsGroup2MaxAmount"
        },
        "VSwitchId": {
          "Fn::GetAtt": [
            "VSwitch2",
            "VSwitchId"
          ]
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "InstanceType": {
          "Ref": "EcsGroupInstanceType"
        }
      }
    },
    "ScalingGroup": {
      "Type": "ALIYUN::ESS::ScalingGroup",
      "DependsOn": "CreateListener",
      "Properties": {
        "DBInstanceIds": [
          {
            "Fn::GetAtt": [
              "Database",
              "DBInstanceId"
            ]
          }
        ],
        "DefaultCooldown": {
          "Ref": "EssDefaultCooldown"
        },
        "LoadBalancerIds": [
          {
            "Fn::GetAtt": [
              "LoadBalancer",
              "LoadBalancerId"
            ]
          }
        ],
        "MaxSize": {
          "Ref": "EssMaxSize"
        },
        "MinSize": {
          "Ref": "EssMinSize"
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "VSwitchIds": [
          {
            "Fn::GetAtt": [
              "VSwitch1",
              "VSwitchId"
            ]
          },
          {
            "Fn::GetAtt": [
              "VSwitch2",
              "VSwitchId"
            ]
          }
        ]
      }
    },
    "Database": {
      "Type": "ALIYUN::RDS::DBInstance",
      "DependOn": "EcsInstanceGroup1",
      "Properties": {
        "DBInstanceClass": {
          "Ref": "RdsDBInstanceClass"
        },
        "DBInstanceNetType": {
          "Ref": "RdsDBInstanceNetType"
        },
        "DBInstanceStorage": {
          "Ref": "RdsDBInstanceStorage"
        },
        "Engine": {
          "Ref": "RdsEngine"
        },
        "EngineVersion": {
          "Ref": "RdsEngineVersion"
        },
        "SecurityIPList": {
          "Ref": "RdsSecurityIPList"
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "VSwitchId": {
          "Fn::GetAtt": [
            "VSwitch1",
            "VSwitchId"
          ]
        }
      }
    },
    "LoadBalancer": {
      "Type": "ALIYUN::SLB::LoadBalancer",
      "Properties": {
        "AddressType": "internet"
      }
    },
    "CreateListener": {
      "Type": "ALIYUN::SLB::Listener",
      "DependOn": "LoadBalancer",
      "Properties": {
        "BackendServerPort": 8080,
        "Bandwidth": 50,
        "ListenerPort": "80",
        "LoadBalancerId": {
          "Ref": "LoadBalancer"
        },
        "Protocol": "http",
        "Scheduler": "wrr"
      }
    },
    "Attachment": {
      "Type": "ALIYUN::SLB::BackendServerAttachment",
      "DependOn": "Database",
      "Properties": {
        "BackendServerList": {
          "Fn::ListMerge": [
            {
              "Fn::GetAtt": [
                "EcsInstanceGroup1",
                "InstanceIds"
              ]
            },
            {
              "Fn::GetAtt": [
                "EcsInstanceGroup2",
                "InstanceIds"
              ]
            }
          ]
        },
        "LoadBalancerId": {
          "Ref": "LoadBalancer"
        }
      }
    },
    "ScalingConfiguration": {
      "Type": "ALIYUN::ESS::ScalingConfiguration",
      "Properties": {
        "DiskMappings": [
          {
            "Category": "cloud_efficiency",
            "Device": "/dev/xvdb",
            "Size": 100
          }
        ],
        "SystemDisk_Category": "cloud_efficiency",
        "ScalingGroupId": {
          "Fn::GetAtt": [
            "ScalingGroup",
            "ScalingGroupId"
          ]
        },
        "SecurityGroupId": {
          "Fn::GetAtt": [
            "SG",
            "SecurityGroupId"
          ]
        },
        "UserData": {
          "Fn::Join": [
            "",
            [
              "#!/bin/sh\n",
              "echo \"nihao\" > /tmp/test_result.log\n"
            ]
          ]
        },
        "ImageId": {
          "Ref": "EcsGroupImageId"
        },
        "InstanceType": {
          "Ref": "EcsGroupInstanceType"
        }
      }
    },
    "ScalingGroupEnable": {
      "Type": "ALIYUN::ESS::ScalingGroupEnable",
      "DependsOn": "ScalingGroup",
      "Properties": {
        "ScalingGroupId": {
          "Fn::GetAtt": [
            "ScalingGroup",
            "ScalingGroupId"
          ]
        },
        "ScalingConfigurationId": {
          "Fn::GetAtt": [
            "ScalingConfiguration",
            "ScalingConfigurationId"
          ]
        },
        "InstanceIds": {
          "Fn::ListMerge": [
            {
              "Fn::GetAtt": [
                "EcsInstanceGroup1",
                "InstanceIds"
              ]
            },
            {
              "Fn::GetAtt": [
                "EcsInstanceGroup2",
                "InstanceIds"
              ]
            }
          ]
        }
      }
    }
  },
  "Parameters": {
    "VpcName": {
      "Type": "String",
      "Label": "Name For Create VPC",
      "Description": "Display name of the vpc instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'",
      "Default": "TwoAvailableZonesVPC"
    },
    "VPCCidrBlock": {
      "Type": "String",
      "Label": "The VPC Cidrblock",
      "Description": "The IP address range of the VPC in the CIDR block form. You can use the following IP address ranges and their subnets:\n10.0.0.0/8\n172.16.0.0/12 (Default)\n192.168.0.0/16",
      "Default": "192.168.0.0/16"
    },
    "VPCDescription": {
      "Type": "String",
      "Label": "The Description Of VPC",
      "Description": "Description of the vpc, [2, 256] characters. Do not fill or empty, the default is empty.",
      "Default": "Description of the two available zones VPC"
    },
    "VSwitch1Name": {
      "Type": "String",
      "Label": "Name For Create Zone 1 VSwitch",
      "Description": "Display name of the vSwitch instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'",
      "Default": "Zone1VSitchName"
    },
    "VSW1CidrBlock": {
      "Type": "String",
      "Label": "The VSwitch 1 Cidrblock",
      "Description": "CIDR Block of created VSwitch, It must belong to itself VPC CIDR block.",
      "Default": "192.168.1.0/24"
    },
    "VSW1Description": {
      "Type": "String",
      "Label": "The Description Of The Zone 1 VSwitch",
      "Description": "Description of the VSwitch, [2, 256] characters. Do not fill or empty, the default is empty.",
      "Default": "Description of the available zone 1 VSwitch"
    },
    "VSW1ZoneId": {
      "Type": "String",
      "Label": " The VSwitch 1 Available Zone ID",
      "Description": "VSwitch Available Zone ID, <a href='#/product/cn-beijing/list/zoneList' target='_blank'>View zoneid info</a>"
    },
    "VSwitch2Name": {
      "Type": "String",
      "Label": "Name For Create Zone 2 VSwitch",
      "Description": "Display name of the vSwitch instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'",
      "Default": "Zone2VSitchName"
    },
    "VSW2CidrBlock": {
      "Type": "String",
      "Label": "The VSwitch 2 Cidrblock",
      "Description": "CIDR Block of created VSwitch, It must belong to itself VPC CIDR block.",
      "Default": "192.168.2.0/24"
    },
    "VSW2Description": {
      "Type": "String",
      "Label": "The Description Of The Zone 2 VSwitch",
      "Description": "Description of the VSwitch, [2, 256] characters. Do not fill or empty, the default is empty.",
      "Default": "Description of the available zone 2 VSwitch"
    },
    "VSW2ZoneId": {
      "Type": "String",
      "Label": "The VSwitch 2 Available Zone ID",
      "Description": "VSwitch Available Zone ID, <a href='#/product/cn-beijing/list/zoneList' target='_blank'>View zoneid info</a>"
    },
    "EcsGroupImageId": {
      "Type": "String",
      "Label": "Ecs Image Id",
      "Description": "Image Id, represents the image resource to startup the ECS instance, <a href='#/product/cn-beijing/list/imageList' target='_blank'>View image resources</a>",
      "Default": "centos_7_04_64_20G_alibase_201701015.vhd"
    },
    "EcsGroupInstanceType": {
      "Type": "String",
      "Label": "Ecs Instance type",
      "Description": "The ECS instance type, <a href='#/product/cn-beijing/list/typeList' target='_blank'>View instance types</a>",
      "Default": "ecs.c5.large",
      "AllowedValues": [
        "ecs.c5.large",
        "ecs.c5.xlarge",
        "ecs.g5.large",
        "ecs.g5.xlarge"
      ]
    },
    "EcsPassword": {
      "Type": "String",
      "Label": "Ecs Password",
      "ConstraintDescription": "[8, 30] characters, consists of 3 types of uppercase letter, lowercase letter, number or special characters.",
      "Description": "The login password of ECS instance",
      "MaxLength": 30,
      "MinLength": 8,
      "NoEcho": true,
      "Confirm": true
    },
    "EcsSystemDiskCategory": {
      "Type": "String",
      "Label": "Ecs System Disk Category",
      "Description": "System disk category: efficient cloud disk(cloud_efficiency) or SSD cloud disk(cloud_ssd)",
      "Default": "cloud_ssd",
      "AllowedValues": [
        "cloud_efficiency",
        "cloud_ssd"
      ]
    },
    "EssDefaultCooldown": {
      "Type": "Number",
      "Label": "The Default Cooldown",
      "Description": "The Default cooldown in seconds",
      "Default": 300
    },
    "EcsGroup1MaxAmount": {
      "Type": "Number",
      "Description": "The number of Ecs Group1 instance.",
      "Label": "Number of Ecs Group1 instance",
      "Default": 2,
      "AllowedValues": [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10
      ]
    },
    "EcsGroup2MaxAmount": {
      "Type": "Number",
      "Label": "Number of Ecs Group2 instance",
      "Description": "The number of Ecs Group2 iinstance.",
      "Default": 2,
      "AllowedValues": [
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10
      ]
    },
    "EssMaxSize": {
      "Type": "Number",
      "Label": "The Max Number Of ECS In Scaling Group",
      "Description": "The maximum of ECS instances in scaling group",
      "MaxValue": 100,
      "MinValue": 1,
      "Default": 20
    },
    "EssMinSize": {
      "Type": "Number",
      "Label": "The Min Number Of ECS In Scaling Group",
      "Description": "The minimum of ECS instances in scaling group",
      "MaxValue": 100,
      "MinValue": 1,
      "Default": 1
    },
    "RdsDBInstanceClass": {
      "Type": "String",
      "Label": "Rds Instance Class",
      "Description": "Database instance type. Refer the RDS database instance type,<a href='https://help.aliyun.com/document_detail/26312.html' target='_blank'>View RDS resources type</a>",
      "AllowedValues": [
        "rds.mysql.t1.small",
        "rds.mysql.s1.small",
        "rds.mysql.s2.large",
        "rds.mysql.s2.xlarge",
        "rds.mysql.s3.large",
        "rds.mysql.m1.medium",
        "rds.mysql.c1.large",
        "rds.mysql.c1.xlarge",
        "rds.mysql.c2.xlarge",
        "rds.mysql.c2.xlp2"
      ],
      "Default": "rds.mysql.t1.small"
    },
    "RdsDBInstanceNetType": {
      "Type": "String",
      "Label": "Database Instance Net Type",
      "Description": "Database instance net type, default is Intranet.Internet for public access, Intranet for private access.",
      "AllowedValues": [
        "Internet",
        "Intranet"
      ],
      "Default": "Intranet"
    },
    "RdsDBInstanceStorage": {
      "Type": "Number",
      "Label": "Database Instance Storage Size",
      "Description": "Incrementing in every 5G, unit: GB",
      "ConstraintDescription": "Incrementing in every 5G, unit: GB",
      "MaxValue": 2000,
      "MinValue": 5,
      "Default": 10
    },
    "RdsEngine": {
      "Type": "String",
      "Label": "Database Instance Engine Type",
      "Description": "Database instance engine type. Support MySQL/SQLServer/PostgreSQL/PPAS/MariaDB now.",
      "AllowedValues": [
        "MySQL",
        "SQLServer",
        "PostgreSQL",
        "PPAS"
      ],
      "Default": "MySQL"
    },
    "RdsEngineVersion": {
      "Type": "String",
      "Label": "Database Engine Version",
      "AllowedValues": [
        "5.5",
        "5.6",
        "2008r2",
        "9.4",
        "9.3"
      ],
      "Description": "MySQL:5.5/5.6; SQLServer:2008r2; PostgreSQL:9.4; PPAS:9.3",
      "Default": "5.6"
    },
    "RdsSecurityIPList": {
      "Type": "String",
      "Label": "Security Ip To access The Database",
      "Description": "The ECS instances IP list access database, separated by commas, do not be repeated",
      "Default": "0.0.0.0/0"
    }
  },
  "Outputs": {
    "RouteTableId": {
      "Description": "The router table id of created VPC.",
      "Value": {
        "Fn::GetAtt": [
          "Vpc",
          "RouteTableId"
        ]
      }
    },
    "VpcId": {
      "Description": "Id of created VPC.",
      "Value": {
        "Fn::GetAtt": [
          "Vpc",
          "VpcId"
        ]
      }
    },
    "VRouterId": {
      "Description": "Router id of created VPC.",
      "Value": {
        "Fn::GetAtt": [
          "Vpc",
          "VRouterId"
        ]
      }
    },
    "VSwitchId1": {
      "Description": "Id of created VSwitch1.",
      "Value": {
        "Fn::GetAtt": [
          "VSwitch1",
          "VSwitchId"
        ]
      }
    },
    "VSwitchId2": {
      "Description": "Id of created VSwitch2.",
      "Value": {
        "Fn::GetAtt": [
          "VSwitch2",
          "VSwitchId"
        ]
      }
    },
    "SecurityGroupId": {
      "Description": "The Security group id.",
      "Value": {
        "Fn::GetAtt": [
          "SG",
          "SecurityGroupId"
        ]
      }
    },
    "BackendServerList": {
      "Description": "Backend server list",
      "Value": {
        "Fn::ListMerge": [
          {
            "Fn::GetAtt": [
              "EcsInstanceGroup1",
              "InstanceIds"
            ]
          },
          {
            "Fn::GetAtt": [
              "EcsInstanceGroup2",
              "InstanceIds"
            ]
          }
        ]
      }
    }
  }
}
相关实践学习
2分钟自动化部署人生模拟器
本场景将带你借助云效流水线Flow实现人生模拟器小游戏的自动化部署
7天玩转云服务器
云服务器ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,可降低 IT 成本,提升运维效率。本课程手把手带你了解ECS、掌握基本操作、动手实操快照管理、镜像管理等。了解产品详情:&nbsp;https://www.aliyun.com/product/ecs
目录
相关文章
|
29天前
|
弹性计算 监控 负载均衡
|
1月前
|
监控 负载均衡 算法
slb管理后端服务器
【10月更文挑战第18天】
28 5
|
1月前
|
关系型数据库 MySQL Linux
Linux系统如何设置自启动服务在MySQL数据库启动后执行?
【10月更文挑战第25天】Linux系统如何设置自启动服务在MySQL数据库启动后执行?
87 3
|
1月前
|
关系型数据库 MySQL Linux
在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。
本文介绍了在 CentOS 7 中通过编译源码方式安装 MySQL 数据库的详细步骤,包括准备工作、下载源码、编译安装、配置 MySQL 服务、登录设置等。同时,文章还对比了编译源码安装与使用 RPM 包安装的优缺点,帮助读者根据需求选择最合适的方法。通过具体案例,展示了编译源码安装的灵活性和定制性。
89 2
|
2月前
|
关系型数据库 MySQL 数据库
vertx 的http服务表单提交与mysql验证
本文介绍了如何使用Vert.x处理HTTP服务中的表单提交,并通过集成MySQL数据库进行验证,包括项目依赖配置、表单HTML代码和完整的Vert.x服务代码。
21 2
|
3月前
|
SQL JavaScript 关系型数据库
Node服务连接Mysql数据库
本文介绍了如何在Node服务中连接MySQL数据库,并实现心跳包连接机制。
47 0
Node服务连接Mysql数据库
|
3月前
|
弹性计算 负载均衡 监控
slb分发流量到ecs一般是如何判断?
【9月更文挑战第1天】
62 1
|
4月前
|
关系型数据库 MySQL Java
【Azure 应用服务】App Service 无法连接到Azure MySQL服务,报错:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
【Azure 应用服务】App Service 无法连接到Azure MySQL服务,报错:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
176 0
|
4月前
|
Kubernetes 关系型数据库 MySQL
k8s练习--通过NFS+PV+PVC+POD,部署一个MySQL服务,并将MySQL的数据进行持久化存储
本文档介绍了如何使用Kubernetes (K8s)、NFS、PersistentVolume (PV)、PersistentVolumeClaim (PVC)和Pod来部署并实现MySQL服务的数据持久化存储。Kubernetes是一个用于自动化部署、扩展和管理容器化应用的强大平台。NFS作为一种网络文件系统协议,能够使Kubernetes集群中的Pod跨节点访问共享文件。PV和PVC机制则提供了持久化的存储解决方案,确保数据即使在Pod生命周期结束后仍得以保留。
180 0
|
4月前
|
SQL Oracle 关系型数据库
实时计算 Flink版产品使用问题之连接到MySQL的从库时遇到其他服务也连接到了从库,该如何处理
实时计算Flink版作为一种强大的流处理和批处理统一的计算框架,广泛应用于各种需要实时数据处理和分析的场景。实时计算Flink版通常结合SQL接口、DataStream API、以及与上下游数据源和存储系统的丰富连接器,提供了一套全面的解决方案,以应对各种实时计算需求。其低延迟、高吞吐、容错性强的特点,使其成为众多企业和组织实时数据处理首选的技术平台。以下是实时计算Flink版的一些典型使用合集。

推荐镜像

更多