文档

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.

-> NOTE: Available since v1.212.0.

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:

  • auto_renew - (Optional) Whether to enable auto-renewal. This parameter is only applicable when the payment type for the instance is Subscription (prepaid).
    • true: Enable auto-renewal
    • false: Disable auto-renewal.
  • auto_renew_period - (Optional) Auto-renewal period. This parameter is only valid when auto-renewal is enabled. The values can be as follows: 1, 2, 3, 6, 12.
  • auto_renew_period_unit - (Optional, Computed) The minimum periodic unit for the duration of auto-renewal. This parameter is only valid when auto-renewal is enabled. Valid values: Month, Year.
  • instance_name - (Optional) The name of instance.
  • network_info - (Required) Instance network configuration information. See network_info below.
  • payment_type - (Required, ForceNew) The payment type for the instance. Alibaba Cloud Message Queue RocketMQ version supports two types of payment. The parameter values are as follows:
    • PayAsYouGo: Pay-as-you-go, a post-payment model where you pay after usage.
    • Subscription: Subscription-based, a pre-payment model where you pay before usage. For more information, please refer to Billing Methods.
  • period - (Optional) Duration of purchase. This parameter is only valid when the payment type for the instance is Subscription (prepaid). The values can be as follows:
    • Monthly purchase: 1, 2, 3, 4, 5, 6
    • Annual purchase: 1, 2, 3.
  • period_unit - (Optional) The minimum periodic unit for the duration of purchase. The parameter values are as follows:
    • Month: Purchase on a monthly basis
    • Year: Purchase on an annual basis.
  • product_info - (Optional, ForceNew) product info. See product_info below.
  • remark - (Optional) Custom description.
  • resource_group_id - (Optional, Computed) The ID of the resource group.
  • series_code - (Required, ForceNew) The primary series encoding for the instance. For specific differences between the primary series, please refer to Product Selection. The parameter values are as follows:
    • standard: Standard Edition
    • ultimate: Platinum Edition
    • professional: Professional Edition.
  • service_code - (Required, ForceNew) The code of the service code instance. The code of the RocketMQ is rmq.
  • software - (Optional) Instance software information. See software below.
  • sub_series_code - (Required, ForceNew) The sub-series encoding for the instance. For specific differences between the sub-series, please refer to Product Selection. The parameter values are as follows:
    • cluster_ha: Cluster High Availability Edition
    • single_node: Single Node Testing Edition When selecting the primary series as ultimate (Platinum Edition), the sub-series can only be chosen as cluster_ha (Cluster High Availability Edition).
  • tags - (Optional, Map) The resource label.

network_info

The network_info supports the following:

  • internet_info - (Required, ForceNew) instance internet info. See internet_info below.
  • vpc_info - (Required, ForceNew) Proprietary network information. See vpc_info below.

network_info-internet_info

The internet_info supports the following:

  • flow_out_bandwidth - (Optional, ForceNew) Public network bandwidth specification. Unit: Mb/s.This field should only be filled when the public network billing type is set to payByBandwidth.The value range is [1 - 1000].
  • flow_out_type - (Required, ForceNew) Public network billing type. The parameter values are as follows:
    • payByBandwidth: Fixed bandwidth billing. Set this value when enabling public network access.
    • uninvolved: Not involved. Set this value when disabling public network access.
  • internet_spec - (Required, ForceNew) Whether to enable public network access. Instances by default support VPC access. If public network access is enabled, Alibaba Cloud Message Queue RocketMQ version will incur charges for public network outbound bandwidth. For specific billing information, please refer to Public Network Access Fees. The parameter values are as follows:
    • enable: Enable public network access
    • disable: Disable public network access
  • ip_whitelist - (Optional) internet ip whitelist.

network_info-vpc_info

The vpc_info supports the following:

  • vswitch_id - (Required, ForceNew) VPC network switch.
  • vpc_id - (Required, ForceNew) Proprietary Network.

product_info

The product_info supports the following:

  • auto_scaling - (Optional) is open auto scaling.
  • message_retention_time - (Optional) Duration of message retention. Unit: hours.For the range of values, please refer to Usage Limits>Resource Quotas>Limitations on Message Retention.The message storage in AlibabaCloud RocketMQ is fully implemented in a serverless and elastic manner, with charges based on the actual storage space. You can control the storage capacity of messages by adjusting the duration of message retention. For more information, please see Storage Fees.
  • msg_process_spec - (Required, ForceNew) Message sending and receiving calculation specifications. For details about the upper limit for sending and receiving messages, see Instance Specifications.
  • send_receive_ratio - (Optional) message send receive ratio.Value range: [0.2, 0.5].

software

The software supports the following:

  • maintain_time - (Optional, Computed) Upgrade time period.

Attributes Reference

The following attributes are exported:

  • id - The ID of the resource supplied above.
  • create_time - The creation time of the resource.
  • network_info - Instance network configuration information.
    • endpoints - Access point list.
      • endpoint_type - Access point type.
      • endpoint_url - Access point address.
      • ip_white_list - White list of access addresses.
  • product_info - product info.
    • support_auto_scaling - is support auto scaling.
  • software - Instance software information.
    • software_version - Software version.
    • upgrade_method - Upgrade method.
  • status - The status of the instance.

Timeouts

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

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

Import

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

$ terraform import alicloud_rocketmq_instance.example <id>