alicloud_datahub_topic

The topic is the basic unit of Datahub data source and is used to define one kind of data or stream. It contains a set of subscriptions. You can manage the datahub source of an application by using topics. Refer to details.

Example Usage

Basic Usage

variable "name" {
  default = "tf_example"
}
resource "alicloud_datahub_project" "example" {
  name    = var.name
  comment = "created by terraform"
}

resource "alicloud_datahub_topic" "example_blob" {
  name         = "${var.name}_blob"
  project_name = alicloud_datahub_project.example.name
  record_type  = "BLOB"
  shard_count  = 3
  life_cycle   = 7
  comment      = "created by terraform"
}

resource "alicloud_datahub_topic" "example_tuple" {
  name         = "${var.name}_tuple"
  project_name = alicloud_datahub_project.example.name
  record_type  = "TUPLE"
  record_schema = {
    bigint_field    = "BIGINT"
    timestamp_field = "TIMESTAMP"
    string_field    = "STRING"
    double_field    = "DOUBLE"
    boolean_field   = "BOOLEAN"
  }
  shard_count = 3
  life_cycle  = 7
  comment     = "created by terraform"
}

Argument Reference

The following arguments are supported:

Notes: Currently life_cycle can not be modified and it will be supported in the next future.

Attributes Reference

The following attributes are exported:

Import

Datahub topic can be imported using the ID, e.g.

$ terraform import alicloud_datahub_topic.example tf_datahub_project:tf_datahub_topic