文档

ALIYUN::DATAHUB::Topic

更新时间:

ALIYUN::DATAHUB::Topic类型用于创建Topic。

阿里云支持在以下地域创建Topic:

  • 中国(杭州)

  • 中国(上海)

  • 中国(北京)

  • 中国(张家口)

  • 中国(深圳)

  • 新加坡

  • 马来西亚(吉隆坡)

  • 德国(法兰克福)

  • 印度(孟买)

语法

{
  "Type": "ALIYUN::DATAHUB::Topic",
  "Properties": {
    "Comment": String,
    "RecordType": String,
    "ProjectName": String,
    "RecordSchema": String,
    "TopicName": String,
    "ShardCount": Integer,
    "Lifecycle": Integer
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Comment

String

描述信息

长度为3~1024个字符。

RecordType

String

类型

取值:

  • TUPLE:结构化数据

  • BLOB:非结构化数据

ProjectName

String

项目名称

RecordSchema

String

Schema详情

创建TUPLE类型Topic时指定该参数,创建BLOB类型时不指定。

TopicName

String

Topic名称

长度为3~64个字符,以英文字母开头,可包含数字、英文字母(区分大小写)和下划线(_)。

ShardCount

Integer

初始Shard数目

Lifecycle

Integer

数据存储生命周期

返回值

Fn::GetAtt

  • ProjectName:项目名称。

  • TopicName:Topic名称。

示例

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Description: Test DataHub Topic
Parameters:
  RecordType:
    Type: String
    Default: BLOB
    AllowedValues:
      - TUPLE
      - BLOB
  ProjectName:
    Type: String
    Default: mytest
  TopicName:
    Type: String
    Default: mytest
Resources:
  Topic:
    Type: ALIYUN::DATAHUB::Topic
    Properties:
      Comment: Test Create Topic
      RecordType:
        Ref: RecordType
      ProjectName:
        Ref: ProjectName
      TopicName:
        Ref: TopicName
Outputs:
  ProjectName:
    Value:
      Fn::GetAtt:
        - Topic
        - ProjectName
  TopicName:
    Value:
      Fn::GetAtt:
        - Topic
        - TopicName

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": "Test DataHub Topic",
  "Parameters": {
    "RecordType": {
      "Type": "String",
      "Default": "BLOB",
      "AllowedValues": [
        "TUPLE",
        "BLOB"
      ]
    },
    "ProjectName": {
      "Type": "String",
      "Default": "mytest"
    },
    "TopicName": {
      "Type": "String",
      "Default": "mytest"
    }
  },
  "Resources": {
    "Topic": {
      "Type": "ALIYUN::DATAHUB::Topic",
      "Properties": {
        "Comment": "Test Create Topic",
        "RecordType": {
          "Ref": "RecordType"
        },
        "ProjectName": {
          "Ref": "ProjectName"
        },
        "TopicName": {
          "Ref": "TopicName"
        }
      }
    }
  },
  "Outputs": {
    "ProjectName": {
      "Value": {
        "Fn::GetAtt": [
          "Topic",
          "ProjectName"
        ]
      }
    },
    "TopicName": {
      "Value": {
        "Fn::GetAtt": [
          "Topic",
          "TopicName"
        ]
      }
    }
  }
}
  • 本页导读 (1)
文档反馈