-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.tf
66 lines (55 loc) · 1.34 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*resource "ibm_container_cluster" "cluster" {
name = "${var.cluster_name}${random_id.name.hex}"
datacenter = "${var.datacenter}"
no_subnet = true
default_pool_size = 2
machine_type = "${var.machine_type}"
hardware = "shared"
public_vlan_id = "${var.public_vlan_id}"
private_vlan_id = "${var.private_vlan_id}"
}*/
/*data "ibm_container_cluster_config" "cluster_config" {
cluster_name_id = "bs79g2k20piq1r143ps0"
}
resource "random_id" "name" {
byte_length = 4
}*/
data "ibm_container_cluster_config" "testacc_ds_cluster" {
cluster_name_id = var.cluster_id
resource_group_id = var.resource_group_id
}
variable "cluster_id" {
default = "ci4qhqbf0oglvsnk7qa0"
}
variable "resource_group_id" {
default = "ae605e4e90494f52bdfdcbb5de8af338"
}
variable "api_key" {
type = string
}
provider "ibm" {
ibmcloud_api_key = var.api_key
}
/*variable "kube_config_path" {
default = "/tmp"
}
resource null_resource calico {
provisioner local-exec {
environment = {
KUBECONFIG = data.ibm_container_cluster_config.testacc_ds_cluster.config_file_path
}
command = <<BASH
export KUBECONFIG=$KUBECONFIG
echo "Run Kubectl commands"
kubectl get pods
BASH
}
}*/
terraform {
required_providers {
ibm = {
version = "1.54.0"
source = "IBM-Cloud/ibm"
}
}
}