-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
35 lines (30 loc) · 1.04 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
data "huaweicloud_availability_zones" "zones" {
region = var.region
}
locals {
availability_zone = length(var.availability_zones) == 0 ? join(",", slice(data.huaweicloud_availability_zones.zones.names, 0, var.az_number)) : join(",", var.availability_zones)
redis_instance_name = var.name_postfix == null ? format("%s-redis", var.name) : format("%s-redis-%s", var.name, var.name_postfix)
}
resource "huaweicloud_gaussdb_redis_instance" "main" {
name = local.redis_instance_name
region = var.region
availability_zone = local.availability_zone
flavor = var.flavor
node_num = var.node_num
volume_size = var.volume_size
password = var.password
vpc_id = var.vpc_id
subnet_id = var.subnet_id
security_group_id = var.secgroup_id
datastore {
engine = var.datastore.engine
storage_engine = var.datastore.storage_engine
version = var.datastore.version
}
lifecycle {
ignore_changes = [
password
]
}
tags = var.tags
}