-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
51 lines (43 loc) · 947 Bytes
/
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
terraform {
required_providers {
linode = {
source = "linode/linode"
version = "2.8.0"
}
}
}
//Use the Linode Provider
provider "linode" {
token = var.token
}
//Use the linode_lke_cluster resource to create a Kubernetes cluster
resource "linode_lke_cluster" "foobar" {
k8s_version = var.k8s_version
label = var.label
region = var.region
tags = var.tags
dynamic "pool" {
for_each = var.pools
content {
type = pool.value["type"]
count = pool.value["count"]
}
}
}
//Export this cluster's attributes
output "kubeconfig" {
value = linode_lke_cluster.foobar.kubeconfig
sensitive = true
}
output "api_endpoints" {
value = linode_lke_cluster.foobar.api_endpoints
}
output "status" {
value = linode_lke_cluster.foobar.status
}
output "id" {
value = linode_lke_cluster.foobar.id
}
output "pool" {
value = linode_lke_cluster.foobar.pool
}