ALIYUN::DATAHUB::Topic is used to create a Topic.

Alibaba Cloud supports creating topics in the following regions:
  • China (Hangzhou)
  • China (Shanghai)
  • China (Beijing)
  • China (Zhangjiakou)
  • China (Shenzhen)
  • Singapore (Singapore)
  • Malaysia (Kuala Lumpur)
  • Germany (Frankfurt)
  • India (Mumbai)

Syntax

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

Properties

Parameter Type Required Editable Description Constraint
Comment String Yes Not supported Description The description must be 3 to 1024 characters in length.
record type String Yes Not supported Type Valid values:
  • TUPLE: TUPLE data
  • BLOB: unstructured data
ProjectName String Yes Not supported Project Name None
RecordSchema String No Released Schema details Specify this parameter when you create a Topic of the TUPLE type. Do not specify this parameter when you create a BLOB Topic.
TopicName String Yes Not supported The name of the topic. The name must be 3 to 64 characters in length and can contain letters, digits, and underscores (_). It must start with a letter.
ShardCount Integer Erased Released The initial number of shards. None
Lifecycle Integer Erased Released Data storage lifecycle None

Return value

Fn::GetAtt

  • ProjectName: The name of the project.
  • TopicName: The name of the Topic.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "Topic": {
      "Type": "ALIYUN::DATAHUB::Topic",
      "Properties": {
        "Comment": {
          "Ref": "Comment"
        },
        "RecordType": {
          "Ref": "RecordType"
        },
        "ProjectName": {
          "Ref": "ProjectName"
        },
        "RecordSchema": {
          "Ref": "RecordSchema"
        },
        "Lifecycle": {
          "Ref": "Lifecycle"
        },
        "ShardCount": {
          "Ref": "ShardCount"
        },
        "TopicName": {
          "Ref": "TopicName"
        }
      }
    }
  },
  "Parameters": {
    "Comment": {
      "Type": "String",
      "Description": "The comment of topic."
    },
    "RecordType": {
      "Type": "String",
      "Description": "Record type. TUPLE: structured data, BLOB: unstructured data.",
      "AllowedValues": [
        "TUPLE",
        "BLOB"
      ]
    },
    "ProjectName": {
      "MinLength": 3,
      "Type": "String",
      "Description": "The name of the project. Length [3, 32]. Beginning with characters, only characters, numbers and _ are allowed.",
      "MaxLength": 32
    },
    "RecordSchema": {
      "Type": "String",
      "Description": "When creating a TUPLE type topic, you need to specify the schema, but the BLOB type does not pass this parameter."
    },
    "Lifecycle": {
      "Default": 3,
      "Type": "Number",
      "Description": "Data storage life cycle.",
      "MinValue": 1
    },
    "ShardCount": {
      "Default": 1,
      "Type": "Number",
      "Description": "Initial shard number.",
      "MinValue": 1
    },
    "TopicName": {
      "MinLength": 3,
      "Type": "String",
      "Description": "The name of the topic. Length [3, 64]. Beginning with characters, only characters, numbers and _ are allowed.",
      "MaxLength": 64
    }
  },
  "Outputs": {
    "ProjectName": {
      "Description": "Project name",
      "Value": {
        "Fn::GetAtt": [
          "Topic",
          "ProjectName"
        ]
      }
    },
    "TopicName": {
      "Description": "Topic name",
      "Value": {
        "Fn::GetAtt": [
          "Topic",
          "TopicName"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  Topic:
    Type: 'ALIYUN::DATAHUB::Topic'
    Properties:
      Comment:
        Ref: Comment
      RecordType:
        Ref: RecordType
      ProjectName:
        Ref: ProjectName
      RecordSchema:
        Ref: RecordSchema
      Lifecycle:
        Ref: Lifecycle
      ShardCount:
        Ref: ShardCount
      TopicName:
        Ref: TopicName
Parameters:
  Comment:
    Type: String
    Description: The comment of topic.
  RecordType:
    Type: String
    Description: 'Record type. TUPLE: structured data, BLOB: unstructured data.'
    AllowedValues:
      -TUPLE
      -BLOB
  ProjectName:
    MinLength: 3
    Type: String
    Description: >-
      The name of the project. Length [3, 32]. Beginning with characters, only
      characters, numbers and _ are allowed.
    MaxLength: 32
  RecordSchema:
    Type: String
    Description: >-
      When creating a TUPLE type topic, you need to specify the schema, but the
      BLOB type does not pass this parameter.
  Lifecycle:
    Default: 3
    Type: Number
    Description: Data storage life cycle.
    MinValue: 1
  ShardCount:
    Default: 1
    Type: Number
    Description: Initial shard number.
    MinValue: 1
  TopicName:
    MinLength: 3
    Type: String
    Description: >-
      The name of the topic. Length [3, 64]. Beginning with characters, only
      characters, numbers and _ are allowed.
    MaxLength: 64
Outputs:
  ProjectName:
    Description: Project name
    Value:
      'Fn::GetAtt':
        -Topic
        -ProjectName
  TopicName:
    Description: Topic name
    Value:
      'Fn::GetAtt':
        -Topic
        -TopicName