-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tf
42 lines (36 loc) · 1.09 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
42
data "ibm_resource_group" "rhpds" {
name = var.resource_group
}
data "ibm_is_vpc" "rhpds" {
name = var.vpc_name
}
data "ibm_is_subnet" "rhpds" {
name = var.subnet_name
}
locals {
ZONE = "${var.ibmcloud_region}-${var.ibmcloud_zone}"
}
resource "ibm_resource_instance" "cos_instance" {
name = var.cos_name
service = "cloud-object-storage"
plan = "standard"
location = "global"
resource_group_id = data.ibm_resource_group.rhpds.id
}
resource "ibm_container_vpc_cluster" "rhpds" {
name = var.cluster_name
vpc_id = data.ibm_is_vpc.rhpds.id
kube_version = var.cluster_version
flavor = var.cluster_flavor
worker_count = var.cluster_worker_count
resource_group_id = data.ibm_resource_group.rhpds.id
cos_instance_crn = ibm_resource_instance.cos_instance.id
wait_till = "OneWorkerNodeReady"
zones {
subnet_id = data.ibm_is_subnet.rhpds.id
name = local.ZONE
}
}
data "ibm_container_cluster_config" "cluster_config" {
cluster_name_id = ibm_container_vpc_cluster.rhpds.id
}