Skip to content

Commit e48d907

Browse files
zql-tqyxiaozhu36
authored andcommitted
kvstore_instance supports the 'password' attribute.
1 parent 936ee7a commit e48d907

File tree

32 files changed

+341
-19
lines changed

32 files changed

+341
-19
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## 1.2.0 (Unreleased)
1+
## 1.3.0 (Unreleased)
2+
## 1.2.0 (Jun 18, 2020)
3+
4+
IMPROVEMENTS:
5+
6+
- Supports the 'password' attribute. [GH-12](https://github.com/terraform-alicloud-modules/terraform-alicloud-redis/pull/12)
7+
28
## 1.1.0 (February 12, 2020)
39

410
IMPROVEMENTS:

examples/complete/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ module "redis_example" {
4141
engine_version = local.engine_version
4242
instance_name = "myInstance"
4343
instance_class = "redis.logic.sharding.2g.8db.0rodb.8proxy.default"
44+
password = "Yourpwd123456"
4445
period = 1
4546
availability_zone = data.alicloud_zones.default.zones.0.multi_zone_ids.0
4647
vswitch_id = alicloud_vswitch.this.id

main.tf

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,27 @@ locals {
1414
}
1515

1616
resource "alicloud_kvstore_instance" "this" {
17-
count = var.existing_instance_id != "" ? 0 : var.create_instance ? 1 : 0
18-
instance_type = "Redis"
19-
instance_class = var.instance_class
20-
instance_name = var.instance_name
21-
engine_version = var.engine_version
22-
vswitch_id = var.vswitch_id
23-
security_ips = var.security_ips
24-
instance_charge_type = var.instance_charge_type
25-
availability_zone = var.availability_zone
26-
period = var.period
27-
auto_renew = var.auto_renew
28-
auto_renew_period = var.auto_renew_period
29-
private_ip = var.private_ip
30-
backup_id = var.instance_backup_id
31-
tags = var.tags
32-
vpc_auth_mode = var.vpc_auth_mode
33-
maintain_start_time = var.maintain_start_time
34-
maintain_end_time = var.maintain_end_time
17+
count = var.existing_instance_id != "" ? 0 : var.create_instance ? 1 : 0
18+
instance_type = "Redis"
19+
instance_class = var.instance_class
20+
instance_name = var.instance_name
21+
password = var.password
22+
kms_encrypted_password = var.kms_encrypted_password
23+
kms_encryption_context = var.kms_encryption_context
24+
engine_version = var.engine_version
25+
vswitch_id = var.vswitch_id
26+
security_ips = var.security_ips
27+
instance_charge_type = var.instance_charge_type
28+
availability_zone = var.availability_zone
29+
period = var.period
30+
auto_renew = var.auto_renew
31+
auto_renew_period = var.auto_renew_period
32+
private_ip = var.private_ip
33+
backup_id = var.instance_backup_id
34+
tags = var.tags
35+
vpc_auth_mode = var.vpc_auth_mode
36+
maintain_start_time = var.maintain_start_time
37+
maintain_end_time = var.maintain_end_time
3538
}
3639

3740
resource "alicloud_kvstore_backup_policy" "this" {

modules/redis-2.8-communtity-cluster/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module "redis" {
3131

3232
instance_name = var.instance_name
3333
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
34+
password = var.password
35+
kms_encrypted_password = var.kms_encrypted_password
36+
kms_encryption_context = var.kms_encryption_context
3437
security_ips = var.security_ips
3538
availability_zone = var.availability_zone
3639
instance_charge_type = var.instance_charge_type

modules/redis-2.8-communtity-cluster/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ variable "alarm_rule_effective_interval" {
8888
#################
8989
# Redis instance
9090
#################
91+
variable "password" {
92+
description = "The password of the redis instance."
93+
type = string
94+
default = ""
95+
}
96+
97+
variable "kms_encrypted_password" {
98+
description = "An KMS encrypts password used to an instance. It is conflicted with 'password'."
99+
type = string
100+
default = ""
101+
}
102+
103+
variable "kms_encryption_context" {
104+
description = "An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance with 'kms_encrypted_password'."
105+
type = map(string)
106+
default = {}
107+
}
108+
91109
variable "engine_version" {
92110
description = "Redis version. Value options can refer to the latest docs [CreateInstance](https://help.aliyun.com/document_detail/60862.html?spm=a2c4g.11186623.6.770.e0c735c10lvrqR) "
93111
default = ""

modules/redis-2.8-communtity-rwsplit/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module "redis" {
3131

3232
instance_name = var.instance_name
3333
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
34+
password = var.password
35+
kms_encrypted_password = var.kms_encrypted_password
36+
kms_encryption_context = var.kms_encryption_context
3437
security_ips = var.security_ips
3538
availability_zone = var.availability_zone
3639
instance_charge_type = var.instance_charge_type

modules/redis-2.8-communtity-rwsplit/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ variable "alarm_rule_effective_interval" {
8888
#################
8989
# Redis instance
9090
#################
91+
variable "password" {
92+
description = "The password of the redis instance."
93+
type = string
94+
default = ""
95+
}
96+
97+
variable "kms_encrypted_password" {
98+
description = "An KMS encrypts password used to an instance. It is conflicted with 'password'."
99+
type = string
100+
default = ""
101+
}
102+
103+
variable "kms_encryption_context" {
104+
description = "An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance with 'kms_encrypted_password'."
105+
type = map(string)
106+
default = {}
107+
}
108+
91109
variable "engine_version" {
92110
description = "Redis version. Value options can refer to the latest docs [CreateInstance](https://help.aliyun.com/document_detail/60862.html?spm=a2c4g.11186623.6.770.e0c735c10lvrqR) "
93111
default = ""

modules/redis-2.8-communtity-standard/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module "redis" {
3131

3232
instance_name = var.instance_name
3333
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
34+
password = var.password
35+
kms_encrypted_password = var.kms_encrypted_password
36+
kms_encryption_context = var.kms_encryption_context
3437
security_ips = var.security_ips
3538
availability_zone = var.availability_zone
3639
instance_charge_type = var.instance_charge_type

modules/redis-2.8-communtity-standard/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ variable "alarm_rule_effective_interval" {
8888
#################
8989
# Redis instance
9090
#################
91+
variable "password" {
92+
description = "The password of the redis instance."
93+
type = string
94+
default = ""
95+
}
96+
97+
variable "kms_encrypted_password" {
98+
description = "An KMS encrypts password used to an instance. It is conflicted with 'password'."
99+
type = string
100+
default = ""
101+
}
102+
103+
variable "kms_encryption_context" {
104+
description = "An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance with 'kms_encrypted_password'."
105+
type = map(string)
106+
default = {}
107+
}
108+
91109
variable "engine_version" {
92110
description = "Redis version. Value options can refer to the latest docs [CreateInstance](https://help.aliyun.com/document_detail/60862.html?spm=a2c4g.11186623.6.770.e0c735c10lvrqR) "
93111
default = ""

modules/redis-4.0-communtity-cluster/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module "redis" {
3131

3232
instance_name = var.instance_name
3333
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
34+
password = var.password
35+
kms_encrypted_password = var.kms_encrypted_password
36+
kms_encryption_context = var.kms_encryption_context
3437
security_ips = var.security_ips
3538
availability_zone = var.availability_zone
3639
instance_charge_type = var.instance_charge_type

modules/redis-4.0-communtity-cluster/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ variable "alarm_rule_effective_interval" {
8888
#################
8989
# Redis instance
9090
#################
91+
variable "password" {
92+
description = "The password of the redis instance."
93+
type = string
94+
default = ""
95+
}
96+
97+
variable "kms_encrypted_password" {
98+
description = "An KMS encrypts password used to an instance. It is conflicted with 'password'."
99+
type = string
100+
default = ""
101+
}
102+
103+
variable "kms_encryption_context" {
104+
description = "An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance with 'kms_encrypted_password'."
105+
type = map(string)
106+
default = {}
107+
}
108+
91109
variable "engine_version" {
92110
description = "Redis version. Value options can refer to the latest docs [CreateInstance](https://help.aliyun.com/document_detail/60862.html?spm=a2c4g.11186623.6.770.e0c735c10lvrqR) "
93111
default = ""

modules/redis-4.0-communtity-rwsplit/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module "redis" {
3131

3232
instance_name = var.instance_name
3333
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
34+
password = var.password
35+
kms_encrypted_password = var.kms_encrypted_password
36+
kms_encryption_context = var.kms_encryption_context
3437
security_ips = var.security_ips
3538
availability_zone = var.availability_zone
3639
instance_charge_type = var.instance_charge_type

modules/redis-4.0-communtity-rwsplit/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ variable "alarm_rule_effective_interval" {
8888
#################
8989
# Redis instance
9090
#################
91+
variable "password" {
92+
description = "The password of the redis instance."
93+
type = string
94+
default = ""
95+
}
96+
97+
variable "kms_encrypted_password" {
98+
description = "An KMS encrypts password used to an instance. It is conflicted with 'password'."
99+
type = string
100+
default = ""
101+
}
102+
103+
variable "kms_encryption_context" {
104+
description = "An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance with 'kms_encrypted_password'."
105+
type = map(string)
106+
default = {}
107+
}
108+
91109
variable "engine_version" {
92110
description = "Redis version. Value options can refer to the latest docs [CreateInstance](https://help.aliyun.com/document_detail/60862.html?spm=a2c4g.11186623.6.770.e0c735c10lvrqR) "
93111
default = ""

modules/redis-4.0-communtity-standard/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module "redis" {
3131

3232
instance_name = var.instance_name
3333
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
34+
password = var.password
35+
kms_encrypted_password = var.kms_encrypted_password
36+
kms_encryption_context = var.kms_encryption_context
3437
security_ips = var.security_ips
3538
availability_zone = var.availability_zone
3639
instance_charge_type = var.instance_charge_type

modules/redis-4.0-communtity-standard/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ variable "alarm_rule_effective_interval" {
8888
#################
8989
# Redis instance
9090
#################
91+
variable "password" {
92+
description = "The password of the redis instance."
93+
type = string
94+
default = ""
95+
}
96+
97+
variable "kms_encrypted_password" {
98+
description = "An KMS encrypts password used to an instance. It is conflicted with 'password'."
99+
type = string
100+
default = ""
101+
}
102+
103+
variable "kms_encryption_context" {
104+
description = "An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance with 'kms_encrypted_password'."
105+
type = map(string)
106+
default = {}
107+
}
108+
91109
variable "engine_version" {
92110
description = "Redis version. Value options can refer to the latest docs [CreateInstance](https://help.aliyun.com/document_detail/60862.html?spm=a2c4g.11186623.6.770.e0c735c10lvrqR) "
93111
default = ""

modules/redis-4.0-enterprise-cluster-hybrid-storage/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module "redis" {
3131

3232
instance_name = var.instance_name
3333
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
34+
password = var.password
35+
kms_encrypted_password = var.kms_encrypted_password
36+
kms_encryption_context = var.kms_encryption_context
3437
security_ips = var.security_ips
3538
availability_zone = var.availability_zone
3639
instance_charge_type = var.instance_charge_type

modules/redis-4.0-enterprise-cluster-hybrid-storage/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ variable "alarm_rule_effective_interval" {
8888
#################
8989
# Redis instance
9090
#################
91+
variable "password" {
92+
description = "The password of the redis instance."
93+
type = string
94+
default = ""
95+
}
96+
97+
variable "kms_encrypted_password" {
98+
description = "An KMS encrypts password used to an instance. It is conflicted with 'password'."
99+
type = string
100+
default = ""
101+
}
102+
103+
variable "kms_encryption_context" {
104+
description = "An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance with 'kms_encrypted_password'."
105+
type = map(string)
106+
default = {}
107+
}
108+
91109
variable "engine_version" {
92110
description = "Redis version. Value options can refer to the latest docs [CreateInstance](https://help.aliyun.com/document_detail/60862.html?spm=a2c4g.11186623.6.770.e0c735c10lvrqR) "
93111
default = ""

modules/redis-4.0-enterprise-standard-hybrid-storage/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module "redis" {
3131

3232
instance_name = var.instance_name
3333
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
34+
password = var.password
35+
kms_encrypted_password = var.kms_encrypted_password
36+
kms_encryption_context = var.kms_encryption_context
3437
security_ips = var.security_ips
3538
availability_zone = var.availability_zone
3639
instance_charge_type = var.instance_charge_type

modules/redis-4.0-enterprise-standard-hybrid-storage/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ variable "alarm_rule_effective_interval" {
8888
#################
8989
# Redis instance
9090
#################
91+
variable "password" {
92+
description = "The password of the redis instance."
93+
type = string
94+
default = ""
95+
}
96+
97+
variable "kms_encrypted_password" {
98+
description = "An KMS encrypts password used to an instance. It is conflicted with 'password'."
99+
type = string
100+
default = ""
101+
}
102+
103+
variable "kms_encryption_context" {
104+
description = "An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance with 'kms_encrypted_password'."
105+
type = map(string)
106+
default = {}
107+
}
108+
91109
variable "engine_version" {
92110
description = "Redis version. Value options can refer to the latest docs [CreateInstance](https://help.aliyun.com/document_detail/60862.html?spm=a2c4g.11186623.6.770.e0c735c10lvrqR) "
93111
default = ""

modules/redis-5.0-communtity-cluster/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ module "redis" {
2929

3030
instance_name = var.instance_name
3131
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
32+
password = var.password
33+
kms_encrypted_password = var.kms_encrypted_password
34+
kms_encryption_context = var.kms_encryption_context
3235
security_ips = var.security_ips
3336
availability_zone = var.availability_zone
3437
instance_charge_type = var.instance_charge_type

modules/redis-5.0-communtity-cluster/variables.tf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ variable "alarm_rule_effective_interval" {
8888
#################
8989
# Redis instance
9090
#################
91+
variable "password" {
92+
description = "The password of the redis instance."
93+
type = string
94+
default = ""
95+
}
96+
97+
variable "kms_encrypted_password" {
98+
description = "An KMS encrypts password used to an instance. It is conflicted with 'password'."
99+
type = string
100+
default = ""
101+
}
102+
103+
variable "kms_encryption_context" {
104+
description = "An KMS encryption context used to decrypt `kms_encrypted_password` before creating or updating an instance with 'kms_encrypted_password'."
105+
type = map(string)
106+
default = {}
107+
}
108+
91109
variable "engine_version" {
92110
description = "Redis version. Value options can refer to the latest docs [CreateInstance](https://help.aliyun.com/document_detail/60862.html?spm=a2c4g.11186623.6.770.e0c735c10lvrqR) "
93111
default = ""

modules/redis-5.0-communtity-rwsplit/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ module "redis" {
3131

3232
instance_name = var.instance_name
3333
instance_class = var.instance_class != "" ? var.instance_class : data.alicloud_kvstore_instance_classes.default.instance_classes.0
34+
password = var.password
35+
kms_encrypted_password = var.kms_encrypted_password
36+
kms_encryption_context = var.kms_encryption_context
3437
security_ips = var.security_ips
3538
availability_zone = var.availability_zone
3639
instance_charge_type = var.instance_charge_type

0 commit comments

Comments
 (0)