-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
47 lines (39 loc) · 1.19 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
resource "instellar_cluster" "this" {
name = var.cluster_name
provider_name = var.provider_name
region = var.region
endpoint = "${var.cluster_address}:${var.cluster_port}"
password_token = var.password_token
insterra_component_id = var.insterra_component_id
}
resource "instellar_uplink" "this" {
channel_slug = var.uplink_channel
kit_slug = var.kit_slug
cluster_id = instellar_cluster.this.id
}
resource "instellar_node" "bootstrap" {
slug = var.bootstrap_node.slug
cluster_id = instellar_cluster.this.id
public_ip = var.bootstrap_node.public_ip
}
resource "instellar_node" "nodes" {
for_each = {
for index, node in var.nodes :
node.slug => node
}
slug = each.value.slug
cluster_id = instellar_cluster.this.id
public_ip = each.value.public_ip
}
resource "terraform_data" "balancer_dependencies" {
input = var.balancer.dependencies
}
resource "instellar_balancer" "this" {
count = var.balancer.enabled ? 1 : 0
depends_on = [
terraform_data.balancer_dependencies
]
name = var.balancer.name
address = var.balancer.address
cluster_id = instellar_cluster.this.id
}