ALIYUN::OOS::Template is used to create a template.

Syntax

{
  "Type": "ALIYUN::OOS::Template",
  "Properties": {
    "Content": String,
    "TemplateName": String,
    "Tags": Map
  }
}

Properties

Name Type Required Editable Description Validity
Content String Yes Yes The content of the template. The content must be in JSON or YAML format, and its maximum size is 64 KB.
TemplateName String Yes No The name of the template. The template name can be up to 200 characters in length and can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.
Tags Map No Yes Tags. A tag is a key-value pair. Example: {"k1":"v1","k2":"v2"}. A maximum of 20 key-value pairs are supported.

Response parameters

Fn::GetAtt

  • TemplateId: the ID of the template.
  • TemplateName: the name of the template.
  • ExecutionPolicy: the execution policy.

Examples

JSON format
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "Template": {
      "Type": "ALIYUN::OOS::Template",
      "Properties": {
        "Content": {
          "Ref": "Content"
        },
        "Tags": {
          "Ref": "Tags"
        },
        "TemplateName": {
          "Ref": "TemplateName"
        }
      }
    }
  },
  "Parameters": {
    "Content": {
      "Type": "String",
      "Description": "The content of the template. The template must be in the JSON or YAML format. Maximum size: 64 KB.",
      "MaxLength": 65536
    },
    "Tags": {
      "Type": "Json",
      "Description": "Tag value and the key mapping, the label of the key number can be up to 20.",
      "MaxLength": 20
    },
    "TemplateName": {
      "Type": "String",
      "Description": "The name of the template. The template name can be up to 200 characters in length. The name can contain letters, digits, hyphens (-), and underscores (_). It cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.",
      "MaxLength": 200
    }
  },
  "Outputs": {
    "ExecutionPolicy": {
      "Description": "Execution Policy",
      "Value": {
        "Fn::GetAtt": [
          "Template",
          "ExecutionPolicy"
        ]
      }
    },
    "TemplateName": {
      "Description": "Template Name",
      "Value": {
        "Fn::GetAtt": [
          "Template",
          "TemplateName"
        ]
      }
    },
    "TemplateId": {
      "Description": "Template ID",
      "Value": {
        "Fn::GetAtt": [
          "Template",
          "TemplateId"
        ]
      }
    }
  }
}
YAML format
ROSTemplateFormatVersion: '2015-09-01'
Resources:
  Template:
    Type: ALIYUN::OOS::Template
    Properties:
      Content:
        Ref: Content
      Tags:
        Ref: Tags
      TemplateName:
        Ref: TemplateName
Parameters:
  Content:
    Type: String
    Description: 'The content of the template. The template must be in the JSON or
      YAML format. Maximum size: 64 KB.'
    MaxLength: 65536
  Tags:
    Type: Json
    Description: Tag value and the key mapping, the label of the key number can be
      up to 20.
    MaxLength: 20
  TemplateName:
    Type: String
    Description: The name of the template. The template name can be up to 200 characters
      in length. The name can contain letters, digits, hyphens (-), and underscores
      (_). It cannot start with ALIYUN, ACS, ALIBABA, or ALICLOUD.
    MaxLength: 200
Outputs:
  ExecutionPolicy:
    Description: Execution Policy
    Value:
      Fn::GetAtt:
      - Template
      - ExecutionPolicy
  TemplateName:
    Description: Template Name
    Value:
      Fn::GetAtt:
      - Template
      - TemplateName
  TemplateId:
    Description: Template ID
    Value:
      Fn::GetAtt:
      - Template
      - TemplateId