Skip to content

Commit 47c9dc0

Browse files
MrWolongxiaozhu36
authored andcommitted
kvstore_instance supports the config attribute
1 parent 7122285 commit 47c9dc0

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

examples/complete/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module "vpc" {
3535

3636
resource "alicloud_security_group" "default" {
3737
inner_access_policy = "Accept"
38-
name = "tf-example"
38+
name = var.instance_name
3939
vpc_id = module.vpc.this_vpc_id
4040
}
4141

@@ -66,6 +66,7 @@ module "redis_example" {
6666
kms_encryption_context = alicloud_kms_ciphertext.kms.encryption_context
6767
maintain_start_time = var.maintain_start_time
6868
maintain_end_time = var.maintain_end_time
69+
config = var.config
6970
tags = var.tags
7071

7172
#alicloud_kvstore_backup_policy
@@ -95,5 +96,4 @@ module "redis_example" {
9596
alarm_rule_contact_groups = data.alicloud_cms_alarm_contact_groups.default.names
9697
alarm_rule_silence_time = var.alarm_rule_silence_time
9798
alarm_rule_effective_interval = var.alarm_rule_effective_interval
98-
9999
}

examples/complete/tfvars/01-update.tfvars

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ password = "YourPassword123!update"
1313
kms_encrypted_password = "YourPassword123!update"
1414
maintain_start_time = "01:00Z"
1515
maintain_end_time = "02:00Z"
16+
config = {
17+
appendonly = "no"
18+
lazyfree-lazy-eviction = "no"
19+
maxmemory-policy = "volatile-lru"
20+
}
1621
tags = {
1722
Name = "updateREDIS"
1823
}
@@ -33,4 +38,4 @@ alarm_rule_threshold = "35"
3338
alarm_rule_triggered_count = 5
3439
alarm_rule_period = 900
3540
alarm_rule_silence_time = 10000
36-
alarm_rule_effective_interval = "1:00-3:00"
41+
alarm_rule_effective_interval = "1:00-3:00"

examples/complete/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ variable "maintain_end_time" {
8080
default = "03:00Z"
8181
}
8282

83+
variable "config" {
84+
description = "The configuration of the KVStore DBInstance."
85+
type = map(string)
86+
default = {
87+
appendonly = "yes"
88+
lazyfree-lazy-eviction = "yes"
89+
maxmemory-policy = "volatile-lru"
90+
}
91+
}
92+
8393
variable "tags" {
8494
description = "A mapping of tags to assign to the redis instance resource."
8595
type = map(string)

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ resource "alicloud_kvstore_instance" "this" {
3030
kms_encryption_context = var.kms_encryption_context
3131
maintain_start_time = var.maintain_start_time
3232
maintain_end_time = var.maintain_end_time
33+
config = var.config
3334
tags = var.tags
3435
}
3536

variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ variable "ssl_enable" {
7171
}
7272

7373
variable "security_group_id" {
74-
description = "The ID of security groups. Note: you can set only one security group. When this field is changed, the old security group will be replaced."
74+
description = "The ID of security groups. You can specify up to 10 security_group_id. Separate multiple security group IDs with commas (,), such as sg-***,sg-***,sg-***."
7575
type = string
7676
default = ""
7777
}
@@ -166,6 +166,12 @@ variable "maintain_end_time" {
166166
default = "03:00Z"
167167
}
168168

169+
variable "config" {
170+
description = "The configuration of the KVStore DBInstance."
171+
type = map(string)
172+
default = {}
173+
}
174+
169175
variable "tags" {
170176
description = "A mapping of tags to assign to the redis instance resource."
171177
type = map(string)

0 commit comments

Comments
 (0)