• Resource Template Service

  1. Help Center
  2. Resource Template Service
  3. User Guide
  4. Getting Started with Console
  5. Creating Resources from a Template

Creating Resources from a Template

The RTS service deploys a set of resources through a template layout (this set of resources is defined as a stack) and maintains this set of resources through the Stack Management in the console. The real value of the Resource Template Service is to compose complex applications. Here, an example of creating an ECS is provided here for the convenience of users. After the tutorial is completed, you can see a created ECS in the Cloud Server Console.

In this Getting Started, you will complete the following steps:

  1. Creating a Key Pair: Create a new key pair and use it to authenticate the SSH login ECS. If you already have a key pair, skip this step and do not need to create it multiple times.
  2. Creating an ECS Stack: Create an ECS by writing a template.

Creating a Key Pair

Before using the RTS service to create an ECS, you need to create a new key pair for authentication when logging in to the SSH node.


If you already have a key pair, skip this step and you do not need to create it multiple times.

  1. Log in to the management console.
  2. Click in the upper left corner and select a region and project.
  3. Under Computing, click Elastic Cloud Server.
  4. In the navigation tree, choose Key Pair. On the right side of the page, click Create Key Pair.
  5. Enter the key name and click OK
  6. In the displayed dialog box, click OK.

    You can view and save the private key according to the prompts. To ensure ECS security, you are limited to downloading the private key only once.

Creating an ECS Stack

  1. Log in to the RTS console.
  2. Click in the upper left corner and select a region and project.
  3. Click Create Stack.

    The Create Stack page is displayed.

    Figure 1 Creating a stack
  4. Confirm Current Region and Project.

    If the region is incorrect, click in the upper left corner of the page for correction.

  5. Choose Manually specify and enter the template content.

    The details of the ECS template are as follows:

    heat_template_version: 2014-10-16
    description: Create a simple ECS instance.
        type: string
        label: ECS Name
        description: Specifies the ECS name.
        type: string
        label: Image Name or ID
        description: Specifies the image used for creating ECS. The value can be the name or ID of the image.
          - custom_constraint: glance.image
        type: string
        label: Key Pair
        description: Specifies the key pair used for creating ECS. The value can be the name of the key pair.
          - custom_constraint: nova.keypair
        type: string
        label: Flavor Name
        description: Specifies the flavor used for creating ECS.
          - custom_constraint: nova.flavor
        type: string
        label: Network Name or ID
        description: Specifies the network used for creating ECS. The value can be the name or ID of the network.
          - custom_constraint: neutron.network
        type: string
        label: AZ Name
        description: Specifies the name of the AZ to which the ECS belong.
      - label: ECS
          - name
          - image
          - key_name
          - flavor
          - networks
          - availability_zone
        type: OS::Nova::Server
          name: { get_param: name } 
          image: { get_param: image }
          flavor: { get_param: flavor }
          key_name: { get_param: key_name }
            - network: { get_param: networks }
          availability_zone: { get_param: availability_zone }

    This YAML text contains five top-level fields:

    • heat_template_version: Define the template version.
    • description: Define the explanation of the template.
    • parameters: Define some parameters of the template. In this example, the ECS name, image name or ID, key pair, flavor, VPC network, and AZ are defined. These parameters can be referenced by the get_param internal function in resources.
    • parameter_groups: Group parameters and provide parameter order.
    • resources: Define the resources created by this template. In this example, you will create an ECS instance. The type field defines the resource type, and functions in properties can refer to the parameters defined in parameters.

    If you want to know more about template introduction, please see Template Structure.

    After the template content is entered and verified correctly, click Next.

  6. Specify stack details. Enter stack name, ECS name, image, key pair, flavor, network, and AZ. Click Next.
    Figure 2 Specifying stack details
  7. Confirm specifications, and submit stack creation.

    It takes a certain amount of time to create the resource. Please wait patiently to create it. After the creation is successful, you can click Stack Management in the left navigation to view the stack status. You can also access the Cloud Server Console to view the successfully created ECS instance.

This tutorial uses ECS resources as an example to guide you through the quick start of the resource template service. If you want to learn more about stack management and template examples, please see section Managing Stacks and Example Templates.