Provides a RocketMQ Instance resource. RocketMQ instance resources.
For information about RocketMQ Instance and how to use it, see What is Instance.
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"
]
}
}
}
alicloud_rocketmq_instance
or removing it from your configurationThe 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.
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).
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:
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:
period_unit
- (Optional) The minimum periodic unit for the duration of purchase. The parameter values are as follows:
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:
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:
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:
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:
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.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.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.RocketMQ Instance can be imported using the id, e.g.
$ terraform import alicloud_rocketmq_instance.example <id>