• Resource Template Service

rts
  1. Help Center
  2. Resource Template Service
  3. User Guide
  4. Managing Stacks
  5. Preparing a Template Package
  6. Template Package Structure

Template Package Structure

You can prepare your compressed template package in .zip format. The following figure shows an example template package structure. The description of each file is as follows.

Figure 1 Template package structure
  1. Resources directory

    This directory is used to store the relevant files referenced by the template file in the root directory. You can put files such as template files, configuration files and script files used by template in the directory. A nested directory can also be stored in this directory. Do not change the name and structure of this directory.

    Figure 2 Resources directory structure
  2. logo.png

    You are advised to use the default logo file and there are no any special limitations regarding an image filename. Though, if it differs from the default logo.png, specify it in the application manifest file.

    NOTE:

    Logo is not supported in the current version but will be supported in the later versions.

  3. manifest.yaml

    manifest.yaml is a description file which describes the basic information of the package. You are advised to use the default file format. The following is an example file for your reference:

    Format: Heat.HOT/1.0
    Type: Application
    FullName: Reserved
    Name: Auto Scaling Group
    Description: "Heat template to deploy a stack."
    Author: RTS
    Tags:
      - hot-based
    Logo: logo.png
    NOTE:

    The filename is fixed, do not use any custom names.

  4. random.yaml and template.yaml

    random.yaml and template.yaml are two example templates. You can define your own templates based on these examples. random.yaml is used to create random string resources. The template file here contains two random string resources. template.yaml is a nested template file which contains sub-templates (random1.yaml). The sub-templates contained are stored in the Resources/HotFiles directory.

    random.yaml:

    heat_template_version: 2014-10-16
    description: Create a serious of random string
    
    parameters:
      length:
        type: number
        default: 4
    
    resources:
      random1:
        type: OS::Heat::RandomString
        properties:
          length: {get_param: length}
      random2:
        type: OS::Heat::RandomString
        properties:
          length: {get_param: length}
    

    template.yaml:

    heat_template_version: 2014-10-16
    description: Create a serious of random string
    
    parameters:
      length:
        type: number
        default: 4
    
    resources:
      random1:
        type: OS::Heat::RandomString
        properties:
          length: {get_param: length}
      random2:
        type: OS::Heat::RandomString
        properties:
          length: {get_param: length}
      random3:
        type: random1.yaml
    NOTE:
    1. A valid package name consists of a maximum of 32 characters, and contain only letters, digits, hyphens (-), and underscores (_), and must start with a letter and end with .zip.
    2. The structure of Resources/HotFiles is fixed and cannot be changed.
    3. All template files in the root directory will be displayed on the console page when you use a zip package. You can select any of the templates to create a stack.
    4. If necessary, you can add a file with the name environment.yaml in the root directory for environment configuration.
    5. The logo file and manifest.yaml file are required and should be stored in the root directory.
    6. When a template is using a referenced file in the Resources/HotFiles directory, such as defining a nested template or using get_file function, you must use the relative path based on Resources/HotFiles.
    7. Other limitations:
      • The maximum size of a single file is 100 KB.
      • The maximum size of a zip package is 80 KB.
      • A maximum of seven levels of directories can be nested.
      • The maximum number of files is 50.