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

Syntax

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

Properties

PropertyTypeRequiredEditableDescriptionConstraint
ContentStringYesYesThe content of the template. The content must be in the JSON or YAML format, and its maximum size is 64 KB.
TemplateNameStringYesNoThe name of the template. The 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.
TagsMapNoYesThe tags. A tag is a key-value pair. Example: {"k1":"v1","k2":"v2"}. You can specify a maximum of 20 key-value pairs.
ResourceGroupIdStringNoYesThe ID of the resource group. None

Response parameters

Fn::GetAtt

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

Examples

  • YAMLformat

    ROSTemplateFormatVersion: '2015-09-01'
    Resources:
      Template:
        Type: ALIYUN::OOS::Template
        Properties:
          Content:
            Fn::Join:
              - '"'
              - - '{"FormatVersion":"OOS-2019-06-01","Description":"automaticly delete black hole.","Parameters":{"OOSAssumeRole":{"Description":"The RAM role to be assumed by OOS.","Type":"String","Default":'
                - Ref: RoleName
                - '}},"RamRole":"{{OOSAssumeRole}}","Tasks":[{"Name":"ddosbgp_event_blackhole","Action":"ACS::EventTrigger","Properties":{"Product":"ddosbgp","Name":["ddosbgp_event_blackhole"],"Level":["CRITICAL"],"Content":{"action":["add"]}},"Outputs":{"InstanceId":{"ValueSelector":".content.instanceId","Type":"String"},"Ip":{"ValueSelector":".content.ip","Type":"String"}}},{"Name":"DeleteBlackhole","Action":"ACS::ExecuteAPI","Properties":{"Service":"ddosbgp","API":"DeleteBlackhole","Parameters":{"InstanceId":"{{ ddosbgp_event_blackhole.InstanceId }}","Ip":"{{ddosbgp_event_blackhole.Ip}}"}},"Description":"DeleteBlackhole."}],"Outputs":{"InstanceId":{"Value":"{{ ddosbgp_event_blackhole.InstanceId }}","Type":"String"},"Ip":{"Value":"{{ ddosbgp_event_blackhole.Ip }}","Type":"String"}}}'
          TemplateName: TestTemplate
    Parameters: {}
    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
  • JSONformat

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Resources": {
        "Template": {
          "Type": "ALIYUN::OOS::Template",
          "Properties": {
            "Content": {
              "Fn::Join": [
                "\"",
                [
                  "{\"FormatVersion\":\"OOS-2019-06-01\",\"Description\":\"automaticly delete black hole.\",\"Parameters\":{\"OOSAssumeRole\":{\"Description\":\"The RAM role to be assumed by OOS.\",\"Type\":\"String\",\"Default\":",
                  {
                    "Ref": "RoleName"
                  },
                  "}},\"RamRole\":\"{{OOSAssumeRole}}\",\"Tasks\":[{\"Name\":\"ddosbgp_event_blackhole\",\"Action\":\"ACS::EventTrigger\",\"Properties\":{\"Product\":\"ddosbgp\",\"Name\":[\"ddosbgp_event_blackhole\"],\"Level\":[\"CRITICAL\"],\"Content\":{\"action\":[\"add\"]}},\"Outputs\":{\"InstanceId\":{\"ValueSelector\":\".content.instanceId\",\"Type\":\"String\"},\"Ip\":{\"ValueSelector\":\".content.ip\",\"Type\":\"String\"}}},{\"Name\":\"DeleteBlackhole\",\"Action\":\"ACS::ExecuteAPI\",\"Properties\":{\"Service\":\"ddosbgp\",\"API\":\"DeleteBlackhole\",\"Parameters\":{\"InstanceId\":\"{{ ddosbgp_event_blackhole.InstanceId }}\",\"Ip\":\"{{ddosbgp_event_blackhole.Ip}}\"}},\"Description\":\"DeleteBlackhole.\"}],\"Outputs\":{\"InstanceId\":{\"Value\":\"{{ ddosbgp_event_blackhole.InstanceId }}\",\"Type\":\"String\"},\"Ip\":{\"Value\":\"{{ ddosbgp_event_blackhole.Ip }}\",\"Type\":\"String\"}}}"
                ]
              ]
            },
            "TemplateName": "TestTemplate"
          }
        }
      },
      "Parameters": {
      },
      "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"
            ]
          }
        }
      }
    }