一、描述
TDSQL-C MySQL 数据库代理连接点,产品介绍。
二、示例
variable "vpc_id" { default = "vpc-nnk6bcjt"}variable "subnet_id" { default = "subnet-ha2x63qo"}variable "sg_id" { default = "sg-1d007a95"}resource "tencentcloud_cynosdb_proxy_end_point" "proxy_end_point" { cluster_id = tencentcloud_cynosdb_proxy.proxy.cluster_id unique_vpc_id = var.vpc_id unique_subnet_id = var.subnet_id connection_pool_type = "SessionConnectionPool" open_connection_pool = "yes" connection_pool_time_out = 30 security_group_ids = [var.sg_id] description = "desc value" weight_mode = "system" auto_add_ro = "yes" fail_over = "yes" consistency_type = "global" rw_type = "READWRITE" consistency_time_out = 30 trans_split = true access_mode = "nearby" instance_weights { instance_id = tencentcloud_cynosdb_cluster.example.instance_id weight = 1 }}
三、参数说明
| 类型 | 名称 | 数据类型 | 说明 |
| 必填 | region | string | 地域,如:ap-guangzhou,默认使用 provider 中定义的 region 也可以在 resource 中指定地域,覆盖默认设置 |
| 必填 | cluster_id | string | 集群 ID |
| 必填 | unique_subnet_id | string | 私有网络子网 ID,默认与集群子网 ID 保持一致 |
| 必填 | unique_vpc_id | string | 私有网络 ID,默认与集群私有网络 ID 保持一致 |
| 可选 | availability_zone | string | 可用区 |
| 可选 | count | int | 资源数量,默认为 1 如果为 0 则不创建资源 |
| 可选 | activity_id | int | 计费活动 ID,保留字段 |
| 可选 | access_mode | string | 连接模式nearbybalance |
| 可选 | auto_add_ro | string | 是否自动添加只读实例yes:是no:不自动添加 |
| 可选 | connection_pool_time_out | int | 连接池阈值:单位(秒) |
| 可选 | connection_pool_type | string | 连接池类型:SessionConnectionPool(会话级别连接池) |
| 可选 | consistency_time_out | int | 一致性超时时间。取值范围:0~1000000(微秒),设置0则表示若只读实例出现延迟,导致一致性策略不满足,请求将一直等待 |
| 可选 | consistency_type | string | 一致性类型eventualglobalsession |
| 可选 | description | string | 描述说明 |
| 可选 | fail_over | string | 是否开启故障转移。数据库代理出现故障时,链接地址将会路由到主实例yes:开启no:不开启 |
| 可选 | instance_weights | Schema[] | 实例权重Schema 类型详见:InstanceWeightsSchema |
| 可选 | open_connection_pool | string | 是否开启连接池yes:开启no:不开启 |
| 可选 | rw_type | enum | 读写属性枚举值:READWRITE:读写实例READONLY:只读实例 |
| 可选 | security_group_ids | string[] | 绑定的安全组 ID 数组 |
| 可选 | trans_split | boolean | 是否开启事务拆分。在一个事务中拆分读和写到不同的实例上去执行 |
| 可选 | vip | string | 想要绑定的 vip 信息,需与 UniqueVpcId 对应。 |
| 可选 | vport | int | 端口 |
| 可选 | weight_mode | string | 权重模式system:系统分配custom:自定义 |
| 生成 | id | string | 资源实例 ID |
| 生成 | create_time | string | 资源创建时间 |
四、参数说明
| 类型 | 名称 | 数据类型 | 说明 |
| 必填 | instance_id | string | 实例 ID |
| 必填 | weight | int | 权重 |