forked from hobby-kube/provisioning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
108 lines (89 loc) · 2.91 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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 "provider" {
source = "./provider/digitalocean"
token = "${var.digitalocean_token}"
ssh_keys = "${var.digitalocean_ssh_keys}"
hosts = "${var.hosts}"
hostname_format = "${var.hostname_format}"
region = "${var.digitalocean_region}"
}*/
/*
module "dns" {
source = "./dns/aws"
count = "${var.hosts}"
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "${var.aws_region}"
domain = "${var.domain}"
public_ips = "${module.provider.public_ips}"
hostnames = "${module.provider.hostnames}"
}
*/
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 "dns" {
source = "./dns/google"
count = "${var.hosts}"
project = "${var.google_project}"
region = "${var.google_region}"
creds_file = "${var.google_credentials_file}"
managed_zone = "${var.google_managed_zone}"
domain = "${var.domain}"
public_ips = "${module.provider.public_ips}"
hostnames = "${module.provider.hostnames}"
}
*/
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}"
overlay_cidr = "${module.kubernetes.overlay_cidr}"
}
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}"
}
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_interface = "${module.wireguard.vpn_interface}"
vpn_ips = "${module.wireguard.vpn_ips}"
etcd_endpoints = "${module.etcd.endpoints}"
}