alicloud_rocketmq_instance

Provides a RocketMQ Instance resource. RocketMQ instance resources.

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

Example Usage

Basic Usage

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

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

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
  cidr_block   = "172.16.0.0/24"
  vswitch_name = var.name

  zone_id = data.alicloud_zones.default.zones.0.id
}

data "alicloud_resource_manager_resource_groups" "default" {
  status = "OK"
}

resource "alicloud_rocketmq_instance" "default" {
  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"
  resource_group_id = data.alicloud_resource_manager_resource_groups.default.ids.0
  remark            = "example"
  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
      vswitch_id = alicloud_vswitch.createVSwitch.id
    }

    internet_info {
      internet_spec      = "enable"
      flow_out_type      = "payByBandwidth"
      flow_out_bandwidth = "30"
      ip_whitelist = [
        "192.168.0.0/16",
        "10.10.0.0/16",
        "172.168.0.0/16"
      ]
    }
  }
}

Deleting alicloud_rocketmq_instance or removing it from your configuration

The alicloud_rocketmq_instance resource allows you to manage payment_type = "PayAsYouGo" instance, but Terraform cannot destroy it. Deleting the subscription resource or removing it from your configuration will remove it from your state file and management, but will not destroy the Instance. You can resume managing the subscription instance via the AlibabaCloud Console.

Argument Reference

The following arguments are supported:

network_info

The network_info supports the following:

network_info-internet_info

The internet_info supports the following:

network_info-vpc_info

The vpc_info supports the following:

product_info

The product_info supports the following:

software

The software supports the following:

Attributes Reference

The following attributes are exported:

Timeouts

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

Import

RocketMQ Instance can be imported using the id, e.g.

$ terraform import alicloud_rocketmq_instance.example <id>