alicloud_rocketmq_consumer_group

更新时间:

Provides a RocketMQ Consumer Group resource.

For information about RocketMQ Consumer Group and how to use it, see What is Consumer Group.

-> NOTE: Available since v1.212.0.

Example Usage

Basic Usage


variable "name" {
  default = "terraform-example"
}

provider "alicloud" {
  region = "cn-hangzhou"
}

data "alicloud_zones" "default" {
  available_resource_creation = "VSwitch"
}

resource "alicloud_vpc" "createVpc" {
  description = "example"
  cidr_block  = "172.16.0.0/12"
  vpc_name    = var.name
}

resource "alicloud_vswitch" "createVswitch" {
  description  = "example"
  vpc_id       = alicloud_vpc.createVpc.id
  zone_id      = data.alicloud_zones.default.zones.0.id
  cidr_block   = "172.16.0.0/24"
  vswitch_name = var.name
}

resource "alicloud_rocketmq_instance" "createInstance" {
  product_info {
    msg_process_spec       = "rmq.u2.10xlarge"
    send_receive_ratio     = "0.3"
    message_retention_time = "70"
  }
  service_code    = "rmq"
  payment_type    = "PayAsYouGo"
  instance_name   = var.name
  sub_series_code = "cluster_ha"
  remark          = "example"
  ip_whitelists   = ["192.168.0.0/16", "10.10.0.0/16", "172.168.0.0/16"]
  software {
    maintain_time = "02:00-06:00"
  }
  tags = {
    Created = "TF"
    For     = "example"
  }
  series_code = "ultimate"
  network_info {
    vpc_info {
      vpc_id = alicloud_vpc.createVpc.id
      vswitches {
        vswitch_id = alicloud_vswitch.createVswitch.id
      }
    }
    internet_info {
      internet_spec      = "enable"
      flow_out_type      = "payByBandwidth"
      flow_out_bandwidth = "30"
    }
  }
}

resource "alicloud_rocketmq_consumer_group" "default" {
  consumer_group_id = var.name
  instance_id       = alicloud_rocketmq_instance.createInstance.id
  consume_retry_policy {
    retry_policy    = "DefaultRetryPolicy"
    max_retry_times = "10"
  }

  delivery_order_type = "Concurrently"
  remark              = "example"
}

Argument Reference

The following arguments are supported:

  • consume_retry_policy - (Required, Set) Consumption retry strategy. See consume_retry_policy below.
  • consumer_group_id - (Required, ForceNew) The first ID of the resource.
  • delivery_order_type - (Optional) Delivery order.
  • instance_id - (Required, ForceNew) Instance ID.
  • max_receive_tps - (Optional, Int, Available since v1.247.0) Maximum received message tps.
  • remark - (Optional) Custom remarks.

consume_retry_policy

The consume_retry_policy supports the following:

  • dead_letter_target_topic - (Optional, Available since v1.247.0) The dead-letter topic. If the consumer fails to consume a message in an abnormal situation and the message is still unsuccessful after retrying, the message will be delivered to the dead letter Topic for subsequent business recovery or backtracking.
  • max_retry_times - (Optional) Maximum number of retries.
  • retry_policy - (Optional) Consume retry policy.

Attributes Reference

The following attributes are exported:

  • id - The ID of the resource supplied above.The value is formulated as <instance_id>:<consumer_group_id>.
  • create_time - The creation time of the resource.
  • region_id - (Available since v1.247.0) The ID of the region in which the instance resides.
  • status - The status of the resource.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 5 mins) Used when create the Consumer Group.
  • delete - (Defaults to 5 mins) Used when delete the Consumer Group.
  • update - (Defaults to 5 mins) Used when update the Consumer Group.

Import

RocketMQ Consumer Group can be imported using the id, e.g.

$ terraform import alicloud_rocketmq_consumer_group.example <instance_id>:<consumer_group_id>