ALIYUN::ESA::Page

ALIYUN::ESA::Page类型用于创建自定义响应页面。

语法

{
  "Type": "ALIYUN::ESA::Page",
  "Properties": {
    "ContentType": String,
    "PageName": String,
    "Content": String,
    "Description": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

ContentType

String

指定 HTTP Header 中的 Content-Type 字段。

取值:

  • text/html

  • application/json

PageName

String

自定义页面的名称。

Content

String

BASE64 编码后的页面内容。 

示例值: "PGh0bWw+aGVsbG8gcGFnZTwvaHRtbD4=" (表示 "hello page")

Description

String

页面的描述信息。

返回值

Fn::GetAtt

  • PageId:自定义响应页面的 ID

  • Description:页面的描述信息。

  • ContentType:HTTP Header 中的 Content-Type 字段。

  • Content:BASE64 编码后的页面内容。 

  • Kind:自定义响应页面类型。

  • UpdateTime:自定义响应页面的最后修改时间。

  • PageName:自定义页面的名称。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ContentType:
    Type: String
    Description:
      en: |-
        The Content-Type field in the HTTP header. Valid values:
        text/html
        application/json
    AllowedValues:
      - text/html
      - application/json
    Required: true
  Content:
    Type: String
    Description:
      en: 'The Base64-encoded page content. Example: "PGh0bWw+aGVsbG8gcGFnZTwvaHRtbD4=", which indicates "hello page".'
    Required: false
  PageName:
    Type: String
    Description:
      en: The name of the custom response page.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::ESA::Page
    Properties:
      ContentType:
        Ref: ContentType
      Content:
        Ref: Content
      PageName:
        Ref: PageName
Outputs:
  PageId:
    Description: The ID of the custom error page.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - PageId
  Description:
    Description: The description of the custom error page.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Description
  ContentType:
    Description: The Content-Type field in the HTTP header.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ContentType
  Content:
    Description: The Base64-encoded content of the error page. The content type is specified by the Content-Type field.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Content
  Kind:
    Description: The type of the custom response page.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Kind
  UpdateTime:
    Description: The time when the custom error page was last modified.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - UpdateTime
  PageName:
    Description: The name of the custom response page.
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - PageName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ContentType": {
      "Type": "String",
      "Description": {
        "en": "The Content-Type field in the HTTP header. Valid values:\ntext/html\napplication/json"
      },
      "AllowedValues": [
        "text/html",
        "application/json"
      ],
      "Required": true
    },
    "Content": {
      "Type": "String",
      "Description": {
        "en": "The Base64-encoded page content. Example: \"PGh0bWw+aGVsbG8gcGFnZTwvaHRtbD4=\", which indicates \"hello page\"."
      },
      "Required": false
    },
    "PageName": {
      "Type": "String",
      "Description": {
        "en": "The name of the custom response page."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ESA::Page",
      "Properties": {
        "ContentType": {
          "Ref": "ContentType"
        },
        "Content": {
          "Ref": "Content"
        },
        "PageName": {
          "Ref": "PageName"
        }
      }
    }
  },
  "Outputs": {
    "PageId": {
      "Description": "The ID of the custom error page.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PageId"
        ]
      }
    },
    "Description": {
      "Description": "The description of the custom error page.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Description"
        ]
      }
    },
    "ContentType": {
      "Description": "The Content-Type field in the HTTP header.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ContentType"
        ]
      }
    },
    "Content": {
      "Description": "The Base64-encoded content of the error page. The content type is specified by the Content-Type field.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Content"
        ]
      }
    },
    "Kind": {
      "Description": "The type of the custom response page.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Kind"
        ]
      }
    },
    "UpdateTime": {
      "Description": "The time when the custom error page was last modified.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "UpdateTime"
        ]
      }
    },
    "PageName": {
      "Description": "The name of the custom response page.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "PageName"
        ]
      }
    }
  }
}