alicloud_adb_resource_group
更新时间:
Provides a AnalyticDB for MySQL (ADB) Resource Group resource.
For information about AnalyticDB for MySQL (ADB) Resource Group and how to use it, see What is Resource Group.
-> NOTE: Available since v1.195.0.
Example Usage
Basic Usage
variable "name" {
default = "terraform-example"
}
data "alicloud_adb_zones" "default" {
}
data "alicloud_resource_manager_resource_groups" "default" {
status = "OK"
}
resource "alicloud_vpc" "default" {
vpc_name = var.name
cidr_block = "10.4.0.0/16"
}
resource "alicloud_vswitch" "default" {
vpc_id = alicloud_vpc.default.id
cidr_block = "10.4.0.0/24"
zone_id = data.alicloud_adb_zones.default.zones[0].id
vswitch_name = var.name
}
resource "alicloud_adb_db_cluster" "default" {
compute_resource = "48Core192GB"
db_cluster_category = "MixedStorage"
db_cluster_version = "3.0"
db_node_class = "E32"
db_node_storage = 100
description = var.name
elastic_io_resource = 1
maintain_time = "04:00Z-05:00Z"
mode = "flexible"
payment_type = "PayAsYouGo"
resource_group_id = data.alicloud_resource_manager_resource_groups.default.ids.0
security_ips = ["10.168.1.12", "10.168.1.11"]
vpc_id = alicloud_vpc.default.id
vswitch_id = alicloud_vswitch.default.id
zone_id = data.alicloud_adb_zones.default.zones[0].id
tags = {
Created = "TF",
For = "example",
}
}
resource "alicloud_adb_resource_group" "default" {
group_name = "TF_EXAMPLE"
group_type = "batch"
node_num = 0
db_cluster_id = alicloud_adb_db_cluster.default.id
}
Argument Reference
The following arguments are supported:
cluster_mode- (Optional, Available since v1.261.0) The working mode of the resource group. Default value:Disable. Valid values:Disable,AutoScale.cluster_size_resource- (Optional, Available since v1.261.0) The resource specifications of a single compute cluster. Unit: ACU.db_cluster_id- (Required, ForceNew) The ID of the DBCluster.engine- (Optional, ForceNew, Available since v1.261.0) The engine of the resource group. Default value:AnalyticDB. Valid values:AnalyticDB,SparkWarehouse.engine_params- (Optional, Map, Available since v1.261.0) The Spark application configuration parameters that can be applied to all Spark jobs executed in the resource group.group_name- (Required, ForceNew) The name of the resource group. Thegroup_namecan be up to 255 characters in length and can contain digits, uppercase letters, hyphens (-), and underscores (_). It must start with a digit or uppercase letter.group_type- (Optional) The query execution mode. Default value:interactive. Valid values:interactive,batch.max_cluster_count- (Optional, Int, Available since v1.261.0) The maximum number of compute clusters that are allowed in the resource group.max_compute_resource- (Optional, Available since v1.261.0) The maximum amount of reserved computing resources, which refers to the amount of resources that are not allocated in the cluster.min_cluster_count- (Optional, Int, Available since v1.261.0) The minimum number of compute clusters that are required in the resource group.min_compute_resource- (Optional, Available since v1.261.0) The minimum amount of reserved computing resources. Unit: AnalyticDB compute unit (ACU).node_num- (Optional, Int) The number of nodes.users- (Optional, List, Available since v1.227.0) The database accounts with which to associate the resource group.
Attributes Reference
The following attributes are exported:
id- The resource ID in terraform of Resource Group. It formats as<db_cluster_id>:<group_name>.user- The database accounts that are associated with the resource group.port- (Available since v1.261.0) The port number of the resource group.connection_string- (Available since v1.261.0) The endpoint of the resource group.create_time- The time when the resource group was created.update_time- The time when the resource group was updated.status- (Available since v1.261.0) The status of the resource group.
Timeouts
The timeouts block allows you to specify timeouts for certain actions:
create- (Defaults to 31 mins) Used when create the Resource Group.delete- (Defaults to 31 mins) Used when delete the Resource Group.update- (Defaults to 31 mins) Used when update the Resource Group.
Import
Adb Resource Group can be imported using the id, e.g.
$ terraform import alicloud_adb_resource_group.example <db_cluster_id>:<group_name>
该文章对您有帮助吗?