All Products
Search
Document Center

Elastic Compute Service:ROS reference

Last Updated:Nov 21, 2024

You can create templates in Resource Orchestration Service (ROS) to define Alibaba Cloud Elastic Compute Service (ECS) resources, such as ECS instances and security groups, and the dependencies between the resources. The orchestration engine of ROS creates and configures all resources based on the templates to implement automated deployment and O&M. This topic describes how to use a ROS template to automatically create an ECS instance.

ROS is an Alibaba Cloud service that helps simplify the management of cloud computing resources. For more information, see What is ROS?

Supported ECS resources

The resources that can be orchestrated by using ROS include regular and data source resources. For more information, see ECS.

Example

This section describes how to create an ECS instance based on a predefined ROS template.

Permissions

By default, ROS uses the credentials of the user logged on to the ROS console. If you log on to the ROS console by using an Alibaba Cloud account, you do not need to obtain the permissions described in the following table. If you log on to the ROS console as a RAM user, the user must obtain the required permissions. The following table describes the permissions.

Alibaba Cloud service

Required permission

Virtual Private Cloud

AliyunVPCFullAccess: the permissions to query VPCs and vSwitches and create elastic IP addresses (EIPs).

Elastic Compute Service

AliyunECSFullAccess: the permissions to create and manage ECS resources, such as ECS instances.

Resource Orchestration Service

AliyunROSFullAccess: the permissions to create and manage ROS resources, such as stacks.

Elastic IP Address

AliyunEIPFullAccess: the permissions to create and manage EIPs.

Required resources

The following figure shows the architecture of resources required by the Elastic Compute Service instance that you want to create.

  • Region: Select the region in which you want to create an ECS instance. The region that you select in the ECS console is automatically used. You do not need to specify a region.

  • Network and zone: Alibaba Cloud provides a default VPC per region and a default vSwitch per zone in each default VPC.

  • Instance type: Select an instance type, such as an instance type that has 2 vCPUs and 4 GiB of memory.

  • Image: Select an image, such as an Alibaba Cloud Linux image or a Windows Server image. An image contains the operating system and provisioned data that are required to start and run an ECS instance.

  • Storage: Configure Elastic Block Storage (EBS) devices as the system disk and data disks of the ECS instance based on your business requirements.

  • EIP: Create an EIP for the ECS instance. The instance can be accessed by using the EIP.

  • Security group: Select or create a security group for the ECS instance. A security group serves as a virtual firewall to control inbound and outbound traffic for ECS instances.

  • Key pair: Select or create a key pair for the ECS instance. Alibaba Cloud provides the secure and convenient key pair-based authentication method for logons to ECS instances. Key pairs are security credentials used for authentication. After you create a key pair, the public key is stored on the ECS instance, and the private key is stored on your on-premises computer.

    image

The preceding resources correspond to the following Resource Orchestration Service resources:

Create a stack

Note

Click Quick Deploy and perform the following operations.

  1. Log on to the ROS console. In the top navigation bar, select a region from the Region drop-down list.

  2. In the left-side navigation pane, click Stacks. On the Stacks page, choose Create Stack > Use ROS. On the Create Stack page, configure the Specify Template parameter. In this example, the Specify Template parameter is set to Use a Sample Template. In this case, you must select a sample template provided by ROS from the Sample Templates drop-down list.image

  3. Confirm the template content in the Template Content code editor and click Next.

    In this example, a sample template that uses an existing VPC, vSwitch, and security group is selected to create two ECS instances and associate EIPs with the instances. The following code snippets show the sample template content in the YAML and JSON formats:

    Sample template content in the YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Description:
      en: Use Count to create a VPC type ECS, and then bind EIP (existing VPC).
       
    Parameters:
      VPC:
        Type: String
        Label:
          en: VPC ID
           
        Description:
          en: Please search the ID starting with (vpc-xxx)from console-Virtual Private Cloud
           
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
      VSwitch:
        Type: String
        Label:
          en: VSwitch ID
           
        Description:
          en: Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch must be under VPC. ECS will be created under this VSwitch</font>
            
        AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
        AssociationPropertyMetadata:
          VpcId: ${VPC}
          ZoneId: ${ECSZoneId}
      SecurityGroup:
        Type: String
        Label:
          en: Business Security Group ID
           
        Description:
          en: Please search the business security group ID starting with(sg-xxx)from console-ECS-Network & Security
            </font>
        AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
        AssociationPropertyMetadata:
          VpcId: ${VPC}
      EIPBandwidth:
        Type: Number
        Label:
          en: EIP Bandwidth
           
        Description:
          en: 'EIP Bandwidth, Value range: [1,200], unit: Mbps.'
            
        Default: 2
        MinValue: 1
        MaxValue: 200
      EIPInternetChargeType:
        Type: String
        Label:
          en: EIP Charge Type
           
        AssociationPropertyMetadata:
          LocaleKey: InternetChargeType
        Default: PayByTraffic
        AllowedValues:
          - PayByBandwidth
          - PayByTraffic
      Count:
        Type: Number
        Label:
          en: Count
           
        Description:
          en: 'The number of ecs and eip to be created, value range: [1,140]'
           
        Default: 1
        MinValue: 1
        MaxValue: 140
      ECSZoneId:
        Type: String
        Label:
          en: VSwitch Availability Zone
           
        Description:
          en: 'Availability zone ID.<br><b>Note: <font color=''blue''>Before selecting, please confirm whether the availability zone supports the specification of creating ECS resources. It is recommended to be different from other switch availability zones</font></b ><br><font color=''red''>The switch availability zone and the selected switch instance ID must be in the same availability zone.</font>'
            </font>
        AssociationProperty: ALIYUN::ECS::Instance:ZoneId
      ECSImageId:
        Type: String
        Label:
          en: Image
           
        Description:
          en: Image ID. Use a CentOS 7 image. For more information, see <b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html' target='_blank'><font color='blue'>Find an image</font></a></b>.
           
        AssociationProperty: ALIYUN::ECS::Image::ImageId
        AssociationPropertyMetadata:
          InstanceType: ${ECSInstanceType}
          SupportedImageOwnerAlias:
            - system
            - self
            - others
        Default: centos_7_04_64_20G_alibase_201701015.vhd
      ECSInstanceType:
        Type: String
        Label:
          en: Instance Type
           
        Description:
          en: <font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]
           
        AssociationProperty: ALIYUN::ECS::Instance::InstanceType
        AssociationPropertyMetadata:
          ZoneId: ECSZoneId
      ECSDiskCategory:
        Type: String
        Label:
          en: System Disk Type
           
        Description:
          en: '<font color=''blue''><b>Optional values:</b></font><br>[cloud_efficiency: <font color=''green''>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color=''green''>SSD Cloud Disk</font>]<br>[cloud_essd: <font color=''green''>ESSD Cloud Disk</font>]<br>[cloud: <font color=''green''>Cloud Disk</font>]<br>[ephemeral_ssd: <font color=''green''>Local SSD Cloud Disk</font>]'
           
        AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
        AssociationPropertyMetadata:
          LocaleKey: DiskCategory
          InstanceType: ${ECSInstanceType}
      ECSSysDiskSize:
        Type: Number
        Label:
          en: System Disk Space
           
        Description:
          en: 'System disk size, range of values: 40-500, units: GB.'
           
        Default: 40
        MinValue: 40
        MaxValue: 500
      ECSPassword:
        Type: String
        Label:
          en: Instance Password
           
        Description:
          en: Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
           
        ConstraintDescription:
          en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
           
        Default: Null
        AllowedPattern: '[0-9A-Za-z\_\-\&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
        MinLength: 8
        MaxLength: 30
        NoEcho: true
      KeyPairName:
        Type: String
        Label:
          en: Key Pair Name
           
        Description:
          en: If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If you have filled in <font color='green'>key pair name</font>, <font color='green'>instance password< The content of /font> will still be set in the instance, but the password login method in the Linux system will be forbidden.<br><font color='red'>Please enter the name of the existing key pair. If you use the instance password Login, the key pair name does not need to be filled in</font>
               
        AssociationProperty: ALIYUN::ECS::KeyPair::KeyPairName
        Default: Null
      PayType:
        Type: String
        Label:
          en: ECS Instance Charge Type
           
        AssociationProperty: ChargeType
        AssociationPropertyMetadata:
          LocaleKey: InstanceChargeType
        Default: PostPaid
        AllowedValues:
          - PostPaid
          - PrePaid
      PayPeriodUnit:
        Type: String
        Label:
          en: Pay Period Unit
           
        AssociationProperty: PayPeriodUnit
        AssociationPropertyMetadata:
          Visible:
            Condition:
              Fn::Not:
                Fn::Equals:
                  - ${PayType}
                  - PostPaid
        Default: Month
        AllowedValues:
          - Month
          - Year
      PayPeriod:
        Type: Number
        Label:
          en: Period
           
        AssociationProperty: PayPeriod
        AssociationPropertyMetadata:
          Visible:
            Condition:
              Fn::Not:
                Fn::Equals:
                  - ${PayType}
                  - PostPaid
        Default: 1
        AllowedValues:
          - 1
          - 2
          - 3
          - 4
          - 5
          - 6
          - 7
          - 8
          - 9
    Resources:
      ECSInstanceGroup:
        Type: ALIYUN::ECS::InstanceGroup
        Properties:
          ZoneId:
            Ref: ECSZoneId
          VpcId:
            Ref: VPC
          VSwitchId:
            Ref: VSwitch
          SecurityGroupId:
            Ref: SecurityGroup
          ImageId:
            Ref: ECSImageId
          AllocatePublicIP: 'false'
          InstanceChargeType:
            Ref: PayType
          Period:
            Ref: PayPeriod
          PeriodUnit:
            Ref: PayPeriodUnit
          InstanceType:
            Ref: ECSInstanceType
          IoOptimized: optimized
          KeyPairName:
            Ref: KeyPairName
          MaxAmount:
            Ref: Count
          Password:
            Ref: ECSPassword
          SystemDiskCategory:
            Ref: ECSDiskCategory
          SystemDiskSize:
            Ref: ECSSysDiskSize
      ElasticIp:
        Type: ALIYUN::VPC::EIP
        Properties:
          Bandwidth:
            Ref: EIPBandwidth
          InternetChargeType:
            Ref: EIPInternetChargeType
        Count:
          Ref: Count
      ElasticIpAssociation:
        Type: ALIYUN::VPC::EIPAssociation
        Properties:
          InstanceId:
            Fn::Select:
              - Ref: ALIYUN::Index
              - Fn::GetAtt:
                  - ECSInstanceGroup
                  - InstanceIds
          AllocationId:
            Fn::Select:
              - Ref: ALIYUN::Index
              - Ref: ElasticIp
        Count:
          Ref: Count
    Outputs:
      EipAddress:
        Description: IP address of created EIP.
        Value:
          Fn::GetAtt:
            - ElasticIp
            - EipAddress
      SecurityGroupId:
        Description: generated security group id for security group.
        Value:
          Ref: SecurityGroup
      VSwitchId:
        Description: generated security vswitch id for VPC.
        Value:
          Ref: VSwitch
      VpcId:
        Description: generated security vpc id for VPC.
        Value:
          Ref: VPC
    Metadata:
      ALIYUN::ROS::Interface:
        ParameterGroups:
          - Parameters:
              - VPC
              - ECSZoneId
              - VSwitch
              - SecurityGroup
            Label:
              default: 'VPC '
          - Parameters:
              - EIPBandwidth
              - EIPInternetChargeType
            Label:
              default: EIP
          - Parameters:
              - PayType
              - PayPeriodUnit
              - PayPeriod
            Label:
              default:
                en: ECS PayType Configuration
                 
          - Parameters:
              - ECSInstanceType
              - ECSImageId
              - ECSDiskCategory
              - ECSSysDiskSize
              - Count
              - ECSPassword
              - KeyPairName
            Label:
              default: ECS
        TemplateTags:
          - acs:example:Elastic Computing:Specify the Count parameter to create ECS instances in an existing VPC and associate EIPs with the instances

    Sample template content in the JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Description": {
        "en": "Use Count to create a VPC type ECS, and then bind EIP (existing VPC).",
         
      },
      "Parameters": {
        "VPC": {
          "Type": "String",
          "Label": {
            "en": "VPC ID",
             
          },
          "Description": {
            "en": "Please search the ID starting with (vpc-xxx)from console-Virtual Private Cloud",
             
          },
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
        },
        "VSwitch": {
          "Type": "String",
          "Label": {
            "en": "VSwitch ID",
             
          },
          "Description": {
            "en": "Existing VSwitch ID, query under console-VPC-VSwitch, <font color='red'>VSwitch must be under VPC. ECS will be created under this VSwitch</font>",
              
          },
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
          "AssociationPropertyMetadata": {
            "VpcId": "${VPC}",
            "ZoneId": "${ECSZoneId}"
          }
        },
        "SecurityGroup": {
          "Type": "String",
          "Label": {
            "en": "Business Security Group ID",
             
          },
          "Description": {
            "en": "Please search the business security group ID starting with(sg-xxx)from console-ECS-Network & Security",
              </font>"
          },
          "AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
          "AssociationPropertyMetadata": {
            "VpcId": "${VPC}"
          }
        },
        "EIPBandwidth": {
          "Type": "Number",
          "Label": {
            "en": "EIP Bandwidth",
             
          },
          "Description": {
            "en": "EIP Bandwidth, Value range: [1,200], unit: Mbps.",
              
          },
          "Default": 1,
          "MinValue": 1,
          "MaxValue": 200
        },
        "EIPInternetChargeType": {
          "Type": "String",
          "Label": {
            "en": "EIP Charge Type",
             
          },
          "AssociationPropertyMetadata": {
            "LocaleKey": "InternetChargeType"
          },
          "Default": "PayByTraffic",
          "AllowedValues": [
            "PayByBandwidth",
            "PayByTraffic"
          ]
        },
        "Count": {
          "Type": "Number",
          "Label": {
            "en": "Count",
             
          },
          "Description": {
            "en": "The number of ecs and eip to be created, value range: [1,140]",
             
          },
          "Default": 2,
          "MinValue": 1,
          "MaxValue": 140
        },
        "ECSZoneId": {
          "Type": "String",
          "Label": {
            "en": "VSwitch Availability Zone",
             
          },
          "Description": {
            "en": "Availability zone ID.<br><b>Note: <font color='blue'>Before selecting, please confirm whether the availability zone supports the specification of creating ECS resources. It is recommended to be different from other switch availability zones</font></b ><br><font color='red'>The switch availability zone and the selected switch instance ID must be in the same availability zone.</font>",
              </font>"
          },
          "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId"
        },
        "ECSImageId": {
          "Type": "String",
          "Label": {
            "en": "Image",
             
          },
          "Description": {
            "en": "Image ID. Use a CentOS 7 image. For more information, see <b><a href='https://www.alibabacloud.com/help/en/doc-detail/112977.html' target='_blank'><font color='blue'>Find the image</font></a></b>",
             
          },
          "AssociationProperty": "ALIYUN::ECS::Image::ImageId",
          "AssociationPropertyMetadata": {
            "InstanceType": "${ECSInstanceType}",
            "SupportedImageOwnerAlias": [
              "system",
              "self",
              "others"
            ]
          },
          "Default": "centos_7_04_64_20G_alibase_201701015.vhd"
        },
        "ECSInstanceType": {
          "Type": "String",
          "Label": {
            "en": "Instance Type",
             
          },
          "Description": {
            "en": "<font color='blue'><b>1.Before selecting the model please confirm that the current available zone under the model is in stock, some models need to be reported in advance</b></font><br><font color='blue'><b>2.List of optional models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU 16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]",
             
          },
          "AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
          "AssociationPropertyMetadata": {
            "ZoneId": "ECSZoneId"
          }
        },
        "ECSDiskCategory": {
          "Type": "String",
          "Label": {
            "en": "System Disk Type",
             
          },
          "Description": {
            "en": "<font color='blue'><b>Optional values:</b></font><br>[cloud_efficiency: <font color='green'>Efficient Cloud Disk</font>]<br>[cloud_ssd: <font color='green'>SSD Cloud Disk</font>]<br>[cloud_essd: <font color='green'>ESSD Cloud Disk</font>]<br>[cloud: <font color='green'>Cloud Disk</font>]<br>[ephemeral_ssd: <font color='green'>Local SSD Cloud Disk</font>]",
             
          },
          "AssociationProperty": "ALIYUN::ECS::Disk::SystemDiskCategory",
          "AssociationPropertyMetadata": {
            "LocaleKey": "DiskCategory",
            "InstanceType": "${ECSInstanceType}"
          }
        },
        "ECSSysDiskSize": {
          "Type": "Number",
          "Label": {
            "en": "System Disk Space",
             
          },
          "Description": {
            "en": "System disk size, range of values: 40-500, units: GB.",
             
          },
          "Default": 40,
          "MinValue": 40,
          "MaxValue": 500
        },
        "ECSPassword": {
          "Type": "String",
          "Label": {
            "en": "Instance Password",
             
          },
          "Description": {
            "en": "Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).",
             
          },
          "ConstraintDescription": {
            "en": "Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).",
             
          },
          "Default": null,
          "AllowedPattern": "[0-9A-Za-z\\_\\-\\&:;'<>,=%`~!@#\\(\\)\\$\\^\\*\\+\\|\\{\\}\\[\\]\\.\\?\\/]+$",
          "MinLength": 8,
          "MaxLength": 30,
          "NoEcho": true
        },
        "KeyPairName": {
          "Type": "String",
          "Label": {
            "en": "Key Pair Name",
             
          },
          "Description": {
            "en": "If it is a Windows ECS instance, ignore this parameter. The default is blank.<br>If you have filled in <font color='green'>key pair name</font>, <font color='green'>instance password< The content of /font> will still be set in the instance, but the password login method in the Linux system will be forbidden.<br><font color='red'>Please enter the name of the existing key pair. If you use the instance password Login, the key pair name does not need to be filled in</font>",
                 
          },
          "AssociationProperty": "ALIYUN::ECS::KeyPair::KeyPairName",
          "Default": null
        },
        "PayType": {
          "Type": "String",
          "Label": {
            "en": "ECS Instance Charge Type",
             
          },
          "AssociationProperty": "ChargeType",
          "AssociationPropertyMetadata": {
            "LocaleKey": "InstanceChargeType"
          },
          "Default": "PostPaid",
          "AllowedValues": [
            "PostPaid",
            "PrePaid"
          ]
        },
        "PayPeriodUnit": {
          "Type": "String",
          "Label": {
            "en": "Pay Period Unit",
             
          },
          "AssociationProperty": "PayPeriodUnit",
          "AssociationPropertyMetadata": {
            "Visible": {
              "Condition": {
                "Fn::Not": {
                  "Fn::Equals": [
                    "${PayType}",
                    "PostPaid"
                  ]
                }
              }
            }
          },
          "Default": "Month",
          "AllowedValues": [
            "Month",
            "Year"
          ]
        },
        "PayPeriod": {
          "Type": "Number",
          "Label": {
            "en": "Period",
             
          },
          "AssociationProperty": "PayPeriod",
          "AssociationPropertyMetadata": {
            "Visible": {
              "Condition": {
                "Fn::Not": {
                  "Fn::Equals": [
                    "${PayType}",
                    "PostPaid"
                  ]
                }
              }
            }
          },
          "Default": 1,
          "AllowedValues": [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9
          ]
        }
      },
      "Resources": {
        "ECSInstanceGroup": {
          "Type": "ALIYUN::ECS::InstanceGroup",
          "Properties": {
            "ZoneId": {
              "Ref": "ECSZoneId"
            },
            "VpcId": {
              "Ref": "VPC"
            },
            "VSwitchId": {
              "Ref": "VSwitch"
            },
            "SecurityGroupId": {
              "Ref": "SecurityGroup"
            },
            "ImageId": {
              "Ref": "ECSImageId"
            },
            "AllocatePublicIP": "false",
            "InstanceChargeType": {
              "Ref": "PayType"
            },
            "Period": {
              "Ref": "PayPeriod"
            },
            "PeriodUnit": {
              "Ref": "PayPeriodUnit"
            },
            "InstanceType": {
              "Ref": "ECSInstanceType"
            },
            "IoOptimized": "optimized",
            "KeyPairName": {
              "Ref": "KeyPairName"
            },
            "MaxAmount": {
              "Ref": "Count"
            },
            "Password": {
              "Ref": "ECSPassword"
            },
            "SystemDiskCategory": {
              "Ref": "ECSDiskCategory"
            },
            "SystemDiskSize": {
              "Ref": "ECSSysDiskSize"
            }
          }
        },
        "ElasticIp": {
          "Type": "ALIYUN::VPC::EIP",
          "Properties": {
            "Bandwidth": {
              "Ref": "EIPBandwidth"
            },
            "InternetChargeType": {
              "Ref": "EIPInternetChargeType"
            }
          },
          "Count": {
            "Ref": "Count"
          }
        },
        "ElasticIpAssociation": {
          "Type": "ALIYUN::VPC::EIPAssociation",
          "Properties": {
            "InstanceId": {
              "Fn::Select": [
                {
                  "Ref": "ALIYUN::Index"
                },
                {
                  "Fn::GetAtt": [
                    "ECSInstanceGroup",
                    "InstanceIds"
                  ]
                }
              ]
            },
            "AllocationId": {
              "Fn::Select": [
                {
                  "Ref": "ALIYUN::Index"
                },
                {
                  "Ref": "ElasticIp"
                }
              ]
            }
          },
          "Count": {
            "Ref": "Count"
          }
        }
      },
      "Outputs": {
        "EipAddress": {
          "Description": "IP address of created EIP.",
          "Value": {
            "Fn::GetAtt": [
              "ElasticIp",
              "EipAddress"
            ]
          }
        },
        "SecurityGroupId": {
          "Description": "generated security group id for security group.",
          "Value": {
            "Ref": "SecurityGroup"
          }
        },
        "VSwitchId": {
          "Description": "generated security vswitch id for VPC.",
          "Value": {
            "Ref": "VSwitch"
          }
        },
        "VpcId": {
          "Description": "generated security vpc id for VPC.",
          "Value": {
            "Ref": "VPC"
          }
        }
      },
      "Metadata": {
        "ALIYUN::ROS::Interface": {
          "ParameterGroups": [
            {
              "Parameters": [
                "VPC",
                "ECSZoneId",
                "VSwitch",
                "SecurityGroup"
              ],
              "Label": {
                "default": "VPC "
              }
            },
            {
              "Parameters": [
                "EIPBandwidth",
                "EIPInternetChargeType"
              ],
              "Label": {
                "default": "EIP"
              }
            },
            {
              "Parameters": [
                "PayType",
                "PayPeriodUnit",
                "PayPeriod"
              ],
              "Label": {
                "default": {
                  "en": "ECS PayType Configuration",
                   
                }
              }
            },
            {
              "Parameters": [
                "ECSInstanceType",
                "ECSImageId",
                "ECSDiskCategory",
                "ECSSysDiskSize",
                "Count",
                "ECSPassword",
                "KeyPairName"
              ],
              "Label": {
                "default": "ECS"
              }
            }
          ],
          "TemplateTags": [
            "acs:example:Elastic Computing:Specify the Count parameter to create ECS instances in an existing VPC and associate EIPs with the instances"
          ]
        }
      }
    }
  4. Follow the on-screen instructions to configure the parameters, such as VPC ID, VSwitch Availability Zone, VSwitch ID, and Business Security Group ID, based on your business requirements. Then, click Create to create a stack.

  5. View the result.

    image

  6. When the stack is created, ECS instances are created based on the template specified in the stack and enter the Running state. You can view the instances in the ECS console, by calling an API operation, or by using an SDK.image

References

ROS allows you to deploy resources with a few clicks in various scenarios, such as environment building, website building, application building, and Artificial Intelligence Generated Content (AIGC) practices. For information about more use cases for ROS, see the following topics: