Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tencentcloud/resource_tc_redis_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ func resourceTencentCloudRedisInstance() *schema.Resource {
"replicas_read_only": {
Type: schema.TypeBool,
Optional: true,
ForceNew: true,
Default: false,
Computed: true,
Description: "Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.",
},
"mem_size": {
Expand Down Expand Up @@ -298,7 +297,10 @@ func resourceTencentCloudRedisInstanceCreate(d *schema.ResourceData, meta interf
chargeType := d.Get("charge_type").(string)
autoRenewFlag := d.Get("auto_renew_flag").(int)
chargeTypeID := REDIS_CHARGE_TYPE_ID[chargeType]
replicasReadonly := d.Get("replicas_read_only").(bool)
var replicasReadonly bool
if v, ok := d.GetOk("replicas_read_only"); ok {
replicasReadonly = v.(bool)
}
var chargePeriod uint64 = 1
if chargeType == REDIS_CHARGE_TYPE_PREPAID {
if period, ok := d.GetOk("prepaid_period"); ok {
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/redis_instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The following arguments are supported:
* `redis_replicas_num` - (Optional) The number of instance copies. This is not required for standalone and master slave versions.
* `redis_shard_num` - (Optional) The number of instance shard, default is 1. This is not required for standalone and master slave versions.
* `replica_zone_ids` - (Optional) ID of replica nodes available zone. This is not required for standalone and master slave versions.
* `replicas_read_only` - (Optional, ForceNew) Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
* `replicas_read_only` - (Optional) Whether copy read-only is supported, Redis 2.8 Standard Edition and CKV Standard Edition do not support replica read-only, turn on replica read-only, the instance will automatically read and write separate, write requests are routed to the primary node, read requests are routed to the replica node, if you need to open replica read-only, the recommended number of replicas >=2.
* `security_groups` - (Optional, ForceNew) ID of security group. If both vpc_id and subnet_id are not set, this argument should not be set either.
* `subnet_id` - (Optional, ForceNew) Specifies which subnet the instance should belong to.
* `tags` - (Optional) Instance tags.
Expand Down