All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::DATAHUB::Topic

Last Updated:Jun 11, 2026

Membuat topik DataHub.

Topik didukung di wilayah berikut:

  • Tiongkok (Hangzhou)

  • Tiongkok (Shanghai)

  • Tiongkok (Beijing)

  • Tiongkok (Zhangjiakou)

  • Tiongkok (Shenzhen)

  • Singapura

  • Malaysia (Kuala Lumpur)

  • Jerman (Frankfurt)

Sintaksis

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

Properti

Nama Properti

Tipe

Wajib

Pembaruan diperbolehkan

Deskripsi

Batasan

Comment

String

Ya

Tidak

Deskripsi topik.

3 hingga 1.024 karakter.

RecordType

String

Ya

Tidak

Tipe catatan.

Nilai yang valid:

  • TUPLE: data terstruktur

  • BLOB: data tidak terstruktur

ProjectName

String

Ya

Tidak

Nama Proyek.

Tidak ada

RecordSchema

String

Tidak

Tidak

Skema catatan.

Tetapkan parameter ini untuk topik TUPLE. Biarkan tidak diatur untuk topik BLOB.

TopicName

String

Ya

Tidak

Nama topik.

3 hingga 64 karakter. Harus dimulai dengan huruf. Dapat berisi huruf (case-sensitive), angka, dan garis bawah (_).

ShardCount

Integer

Tidak

Tidak

Jumlah shard awal.

Tidak ada

Lifecycle

Integer

Tidak

Tidak

Periode retensi data.

Tidak ada

Nilai kembalian

Fn::GetAtt

  • ProjectName: nama Proyek.

  • TopicName: nama topik.

Contoh

YAML format

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 format

{
  "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"
        ]
      }
    }
  }
}