forked from hobby-kube/provisioning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
83 lines (66 loc) · 2.16 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
module "provider" {
source = "./provider/scaleway"
organization = "${var.scaleway_organization}"
token = "${var.scaleway_token}"
hosts = "${var.hosts}"
hostname_format = "${var.hostname_format}"
region = "${var.scaleway_region}"
}
module "dns" {
source = "./dns/cloudflare"
count = "${var.hosts}"
email = "${var.cloudflare_email}"
token = "${var.cloudflare_token}"
domain = "${var.domain}"
public_ips = "${module.provider.public_ips}"
hostnames = "${module.provider.hostnames}"
}
module "sshfpip" {
source = "./security/sshfp"
count = "${var.hosts}"
items = "${module.provider.public_ips}"
domain = "${var.domain}"
}
module "sshfprec" {
source = "./security/sshfp"
count = "${var.hosts}"
items = "${formatlist("%s.%s", module.dns.domains, var.domain)}"
domain = "${var.domain}"
}
module "swap" {
source = "./service/swap"
count = "${var.hosts}"
connections = "${module.provider.public_ips}"
}
module "wireguard" {
source = "./security/wireguard"
count = "${var.hosts}"
connections = "${module.provider.public_ips}"
private_ips = "${module.provider.private_ips}"
hostnames = "${module.provider.hostnames}"
}
module "etcd" {
source = "./service/etcd"
count = "${var.hosts}"
connections = "${module.provider.public_ips}"
hostnames = "${module.provider.hostnames}"
vpn_unit = "${module.wireguard.vpn_unit}"
vpn_ips = "${module.wireguard.vpn_ips}"
}
module "kubernetes" {
source = "./service/kubernetes"
count = "${var.hosts}"
connections = "${module.provider.public_ips}"
cluster_name = "${var.domain}"
vpn_ips = "${module.wireguard.vpn_ips}"
etcd_endpoints = "${module.etcd.endpoints}"
}
module "firewall" {
source = "./security/ufw"
count = "${var.hosts}"
connections = "${module.provider.public_ips}"
private_interface = "${module.provider.private_network_interface}"
vpn_interface = "${module.wireguard.vpn_interface}"
vpn_port = "${module.wireguard.vpn_port}"
kubernetes_interface = "${module.kubernetes.overlay_interface}"
}