Skip to content

Commit 9942c07

Browse files
ChenHanZhangxiaozhu36
authored andcommitted
kvstore_instance supports the 'security_group_id' attribute.
1 parent 5301971 commit 9942c07

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

examples/complete/main.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ module "vpc" {
3333
availability_zones = [data.alicloud_zones.default.zones.0.id]
3434
}
3535

36+
resource "alicloud_security_group" "default" {
37+
inner_access_policy = "Accept"
38+
name = "tf-example"
39+
vpc_id = module.vpc.this_vpc_id
40+
}
41+
3642
module "redis_example" {
3743
source = "../.."
3844

@@ -47,6 +53,7 @@ module "redis_example" {
4753
ssl_enable = "Enable"
4854
vswitch_id = module.vpc.this_vswitch_ids[0]
4955
security_ips = var.security_ips
56+
security_group_id = alicloud_security_group.default.id
5057
instance_charge_type = var.instance_charge_type
5158
period = var.period
5259
auto_renew = var.auto_renew

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ resource "alicloud_kvstore_instance" "this" {
1414
instance_class = var.instance_class
1515
zone_id = var.availability_zone
1616
secondary_zone_id = var.secondary_zone_id
17+
security_group_id = var.security_group_id
1718
vswitch_id = var.vswitch_id
1819
security_ips = var.security_ips
1920
payment_type = var.instance_charge_type

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ variable "ssl_enable" {
7070
default = ""
7171
}
7272

73+
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."
75+
type = string
76+
default = ""
77+
}
78+
7379
variable "vswitch_id" {
7480
description = "The vswitch id used to launch one or more instances."
7581
type = string

0 commit comments

Comments
 (0)