-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
41 lines (37 loc) · 1.36 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
36
37
38
39
40
41
module "cce_label" {
source = "git::https://github.com/cloudposse/terraform-terraform-label.git?ref=master"
attributes = var.attributes
delimiter = var.delimiter
enabled = var.enabled
name = "cce"
namespace = var.namespace
stage = var.stage
tags = var.tags
}
resource "opentelekomcloud_cce_cluster_v3" "this" {
count = var.enabled ? 1 : 0
name = "${module.cce_label.id}"
cluster_type = var.cluster_type
cluster_version = "v1.11.3-r1"
flavor_id = var.master_flavor_id
vpc_id = var.vpc_id
subnet_id = var.subnet_id
container_network_type = var.container_network_type
#multi_az = true
}
resource "opentelekomcloud_cce_node_v3" "this" {
count = var.enabled ? var.nodes_count : 0
name = join(var.delimiter, [module.cce_label.id, format("%02s", count.index + 1)])
cluster_id = opentelekomcloud_cce_cluster_v3.this[0].id
flavor_id = var.nodes_flavor_id
availability_zone = element(concat(var.availability_zones, [""]), count.index)
key_pair = var.key_pair
root_volume {
size = var.nodes_root_volume_size
volumetype = var.nodes_root_volume_type
}
data_volumes {
size = var.nodes_data_volume_size
volumetype = var.nodes_data_volume_type
}
}