全部产品
Search
文档中心

Resource Orchestration Service:ALIYUN::DATAHUB::Topic

更新时间:Jun 26, 2025

ALIYUN::DATAHUB::Topic digunakan untuk membuat topik.

Anda dapat membuat topik di wilayah berikut pada Alibaba Cloud:

  • Cina (Hangzhou)

  • Cina (Shanghai)

  • Cina (Beijing)

  • Cina (Zhangjiakou)

  • Cina (Shenzhen)

  • Singapura (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

Properti

Tipe

Diperlukan

Dapat Diedit

Deskripsi

Kendala

Komentar

String

Ya

Tidak

Deskripsi dari topik.

Deskripsi harus memiliki panjang antara 3 hingga 1.024 karakter.

RecordType

String

Ya

Tidak

Tipe dari topik.

Nilai yang valid:

  • TUPLE: data terstruktur

  • BLOB: data tidak terstruktur

NamaProyek

String

Ya

Tidak

Nama dari proyek.

Tidak ada.

SkemaRekaman

String

Tidak

Tidak

Detail skema dari topik.

Properti ini harus ditentukan saat Anda membuat topik tipe TUPLE. Properti ini tidak dapat ditentukan saat Anda membuat topik tipe BLOB.

NamaTopik

String

Ya

Tidak

Nama dari topik.

Nama harus memiliki panjang antara 3 hingga 64 karakter dan dapat berisi angka, huruf, serta garis bawah (_). Nama bersifat peka huruf besar/kecil dan harus dimulai dengan huruf.

JumlahShard

Integer

Tidak

Tidak

Jumlah awal shard dalam topik.

Tidak ada.

DaurHidup

Integer

Tidak

Tidak

Periode waktu hidup (TTL) data.

Tidak ada.

Nilai Pengembalian

Fn::GetAtt

  • NamaProyek: Nama proyek.

  • NamaTopik: 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"
        ]
      }
    }
  }
}