描述
示例
variable "vpc_id" {default = "vpc-nnk6bcjt"}variable "subnet_id" {default = "subnet-ha2x63qo"}variable "sg_id" {default = "sg-1d007a95"}resource "tencentcloud_cynosdb_proxy" "proxy" {cluster_id = tencentcloud_cynosdb_cluster.example.idcpu = 2mem = 4000unique_vpc_id = var.vpc_idunique_subnet_id = var.subnet_idconnection_pool_type = "SessionConnectionPool"open_connection_pool = "yes"connection_pool_time_out = 30security_group_ids = [var.sg_id]description = "desc sample"proxy_zones {proxy_node_zone = "ap-guangzhou-7"proxy_node_count = 2}}
参数说明
类型 | 名称 | 数据类型 | 说明 |
必填 | region | string | 地域,如:ap-guangzhou,默认使用 provider 中定义的 region
也可以在 resource 中指定地域,覆盖默认设置 |
必填 | cluster_id | string | 集群 ID |
必填 | cpu | int | CPU 核数 |
必填 | mem | int | 内存 |
可选 | availability_zone | string | 可用区 |
可选 | count | int | 资源数量,默认为 1
如果为 0 则不创建资源 |
可选 | activity_id | int | 计费活动 ID,保留字段 |
可选 | connection_pool_time_out | int | 连接池阈值:单位(秒) |
可选 | connection_pool_type | string | 连接池类型:SessionConnectionPool(会话级别连接池) |
可选 | description | string | 描述说明 |
可选 | open_connection_pool | string | 是否开启连接池 yes:开启 no:不开启 |
可选 | proxy_count | int | 数据库代理组节点个数(该参数不再建议使用,建议使用 proxy_zones) |
可选 | proxy_zones | Schema[] | 数据库节点信息(该参数与 ProxyCount 需要任选一个输入) Schema 类型详见:ProxyZoneSchema |
可选 | security_group_ids | string[] | 安全组 ID 数组 |
可选 | unique_subnet_id | string | 私有网络子网 ID,默认与集群子网 ID 保持一致 |
可选 | unique_vpc_id | string | 私有网络 ID,默认与集群私有网络 ID 保持一致 |
生成 | id | string | 资源实例 ID |
生成 | create_time | string | 资源创建时间 |
数据结构
ProxyZoneSchema
参数说明
类型 | 名称 | 数据类型 | 说明 |
必填 | proxy_node_count | int | proxy 节点可用区 |
必填 | proxy_node_zone | string | proxy 节点数量 |