tencentcloud_redis_instance

最近更新时间:2025-09-04 14:56:13

我的收藏

描述

腾讯云 Redis 数据库,产品介绍
支持的购买方式:
后付费
预付费(用户余额支付)

示例

resource "tencentcloud_redis_instance" "redis" {
vpc_id = var.app_target.vpc.id
subnet_id = var.app_target.subnet.id
availability_zone = var.app_target.availability_zone
type_id = 6
password = random_password.redis.result
mem_size = 2048
redis_replicas_num = 1
name = "cloudapp-redis"
port = 6379
}

参数说明

类型
名称
数据类型
说明
必填
region
string
地域,如:ap-guangzhou,默认使用 provider 中定义的 region 也可以在 resource 中指定地域,覆盖默认设置
availability_zone
string
可用区
type_id
int
详见 文档
mem_size
int
内存容量,单位:MB
vpc_id
string
VPC ID
subnet_id
string
子网 ID
可选
count
int
资源数量,默认为 1 如果为 0 则不创建资源
activity_id
int
计费活动 ID,保留字段
charge_type
enum
实例计费类型。默认按量付费
枚举值:
PREPAID:包年包月
POSTPAID:按量付费
prepaid_period
int
预付费时长,单位为月,取值范围:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 24, 36。
auto_renew_flag
0 | 1 | 2
自动续费标识
0 默认状态(手动续费);
1 自动续费;
2 明确不自动续费。
password
string
实例密码,详见 参数定义
no_auth
boolean
是否支持免密
true:免密实例
false:非免密实例
默认为非免密实例,仅 VPC 网络的实例支持免密码访问。
port
int
用户自定义的端口 不填则默认为6379,范围[1024,65535]。
security_groups
string[]
安全组 ID 列表
redis_shard_num
int
实例分片数量,购买标准版实例不需要填写,集群版分片数量范围[3,5,8,12,16,24,32,64,96,128]。
redis_replicas_num
int
实例副本数量,Redis 2.8标准版、CKV 标准版只支持1副本,4.0、5.0标准版和集群版支持1-5个副本。
force_delete
boolean
预付费资源是否直接删除,即从回收站清除 按量资源付费则直接删除
生成
id
string
资源实例 ID
create_time
string
资源创建时间
ip
string
实例 vip
instance_name
string
实例名