Skip to content

Commit

Permalink
add new attribute instance_release_protection.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenHanZhang authored and xiaozhu36 committed Nov 30, 2023
1 parent fe2ae33 commit f413f59
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 45 deletions.
43 changes: 22 additions & 21 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,28 @@ module "redis_example" {
#alicloud_kvstore_instance
create_instance = true

engine_version = var.engine_version
instance_name = var.instance_name
instance_class = data.alicloud_kvstore_instance_classes.default.instance_classes.0
availability_zone = data.alicloud_zones.default.zones.0.id
secondary_zone_id = data.alicloud_zones.default.zones.1.id
ssl_enable = "Enable"
vswitch_id = module.vpc.this_vswitch_ids[0]
security_ips = var.security_ips
security_group_id = alicloud_security_group.default.id
instance_charge_type = var.instance_charge_type
period = var.period
auto_renew = var.auto_renew
auto_renew_period = var.auto_renew_period
private_ip = "172.16.0.10"
vpc_auth_mode = var.vpc_auth_mode
password = var.password
kms_encrypted_password = var.kms_encrypted_password
kms_encryption_context = alicloud_kms_ciphertext.kms.encryption_context
maintain_start_time = var.maintain_start_time
maintain_end_time = var.maintain_end_time
tags = var.tags
engine_version = var.engine_version
instance_name = var.instance_name
instance_class = data.alicloud_kvstore_instance_classes.default.instance_classes.0
availability_zone = data.alicloud_zones.default.zones.0.id
secondary_zone_id = data.alicloud_zones.default.zones.1.id
ssl_enable = "Enable"
vswitch_id = module.vpc.this_vswitch_ids[0]
security_ips = var.security_ips
security_group_id = alicloud_security_group.default.id
instance_charge_type = var.instance_charge_type
instance_release_protection = false
period = var.period
auto_renew = var.auto_renew
auto_renew_period = var.auto_renew_period
private_ip = "172.16.0.10"
vpc_auth_mode = var.vpc_auth_mode
password = var.password
kms_encrypted_password = var.kms_encrypted_password
kms_encryption_context = alicloud_kms_ciphertext.kms.encryption_context
maintain_start_time = var.maintain_start_time
maintain_end_time = var.maintain_end_time
tags = var.tags

#alicloud_kvstore_backup_policy
backup_policy_backup_period = var.backup_policy_backup_period
Expand Down
49 changes: 25 additions & 24 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,31 @@ locals {
}

resource "alicloud_kvstore_instance" "this" {
count = var.create_instance ? 1 : 0
ssl_enable = var.ssl_enable
instance_type = "Redis"
engine_version = var.engine_version
db_instance_name = var.instance_name
instance_class = var.instance_class
zone_id = var.availability_zone
secondary_zone_id = var.secondary_zone_id
security_group_id = var.security_group_id
vswitch_id = var.vswitch_id
security_ips = var.security_ips
payment_type = var.instance_charge_type
period = var.period
auto_renew = var.auto_renew
auto_renew_period = var.auto_renew_period
private_ip = var.private_ip
backup_id = var.instance_backup_id
vpc_auth_mode = var.vpc_auth_mode
password = var.password
kms_encrypted_password = var.kms_encrypted_password
kms_encryption_context = var.kms_encryption_context
maintain_start_time = var.maintain_start_time
maintain_end_time = var.maintain_end_time
tags = var.tags
count = var.create_instance ? 1 : 0
ssl_enable = var.ssl_enable
instance_type = "Redis"
engine_version = var.engine_version
db_instance_name = var.instance_name
instance_class = var.instance_class
zone_id = var.availability_zone
secondary_zone_id = var.secondary_zone_id
security_group_id = var.security_group_id
instance_release_protection = var.instance_release_protection
vswitch_id = var.vswitch_id
security_ips = var.security_ips
payment_type = var.instance_charge_type
period = var.period
auto_renew = var.auto_renew
auto_renew_period = var.auto_renew_period
private_ip = var.private_ip
backup_id = var.instance_backup_id
vpc_auth_mode = var.vpc_auth_mode
password = var.password
kms_encrypted_password = var.kms_encrypted_password
kms_encryption_context = var.kms_encryption_context
maintain_start_time = var.maintain_start_time
maintain_end_time = var.maintain_end_time
tags = var.tags
}

resource "alicloud_kvstore_backup_policy" "this" {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ variable "security_group_id" {
default = ""
}

variable "instance_release_protection" {
description = "Whether to open the release protection."
type = bool
default = false
}

variable "vswitch_id" {
description = "The vswitch id used to launch one or more instances."
type = string
Expand Down

0 comments on commit f413f59

Please sign in to comment.