-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
70 lines (54 loc) · 1.17 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
terraform {
required_version = "~> 0.10"
backend "gcs" {
bucket = "teerace-state-prod"
prefix = "terraform/state"
}
}
locals {
project = "teerace-web"
}
provider "google-beta" {
version = "~> 1.20"
project = "${local.project}"
region = "europe-west2"
zone = "europe-west2-b"
}
provider "random" {
version = "~> 2.0"
}
provider "template" {
version = "~> 1.0"
}
provider "ignition" {
version = "~> 1.0"
}
resource "random_id" "name" {
byte_length = 2
}
module "vpc" {
source = "./vpc"
region = "${var.vpc_region}"
network_name = "${var.vpc_name}"
}
module "database" {
source = "./database"
region = "${var.database_region}"
private_network = "${module.vpc.self_link}"
}
module "ignition" {
source = "./ignition"
database_url = "${module.database.url}"
}
module "vm" {
source = "./vm"
zone = "${var.vm_zone}"
ignition_config = "${module.ignition.rendered}"
network_name = "${module.vpc.name}"
subnetwork_name = "${module.vpc.subnetwork_name}"
}
module "storage" {
source = "./storage"
region = "${var.storage_region}"
vm_service_account = "${module.vm.service_account}"
}