alicloud_ons_topic

Provides an ONS topic resource.

For more information about how to use it, see RocketMQ Topic Management API.

Example Usage

Basic Usage

variable "name" {
  default = "onsInstanceName"
}

variable "topic" {
  default = "onsTopicName"
}

resource "random_integer" "default" {
  min = 10000
  max = 99999
}


resource "alicloud_ons_instance" "default" {
  name   = "${var.name}-${random_integer.default.result}"
  remark = "default_ons_instance_remark"
}

resource "alicloud_ons_topic" "default" {
  topic_name   = var.topic
  instance_id  = alicloud_ons_instance.default.id
  message_type = 0
  remark       = "dafault_ons_topic_remark"
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Import

ONS TOPIC can be imported using the id, e.g.

$ terraform import alicloud_ons_topic.topic MQ_INST_1234567890_Baso1234567:onsTopicDemo