-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
132 lines (112 loc) · 2.94 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*
* Connect to GCP
*/
provider "google" {
project = var.project
region = var.region
credentials = var.credentials
}
# module "instance_creation" {
# source = "./instance-creation"
# name = "dev-vm"
# zone = var.zone
# machine_type = var.machine_type
# image = var.image
# }
# module "instance_template_data" {
# source = "./instance-template"
# }
# # instance_groups depend on instance_template_data
# module "instance_groups" {
# source = "./instance-groups"
# instance_template = module.instance_template_data.instance_template.id
# }
# module "vpc_peering" {
# source = "./vpc-peering"
# }
# module "network_load_balancig" {
# source = "./network-load-balancing"
# }
# module "cloud_sql" {
# source = "./cloud-sql"
# }
# module "input_variables" {
# source = "./input-variables"
# name = var.name
# zone = var.zone
# machine_type = var.machine_type
# image = var.image
# network_interface = var.network_interface
# tags = var.tags
# auto_create_subnetworks = var.auto_create_subnetworks
# maximum_transmission_unit = var.maximum_transmission_unit
# auto_delete = var.auto_delete
# protocol = var.protocol
# ports = var.ports
# labels = var.labels
# metadata = var.metadata
# source_ranges = var.source_ranges
# }
# module "local_variables" {
# source = "./local-variables"
# }
/*
* TODO:
? First, you need to set the output variable in the module output-variables:
? for e.g output-variables/output.tf
?
! output "vpc" {
! value = google_compute_network.tf_vpc.id
! }
?
? Then you call the module with source = "output-variables"
?
! module "output_variables" {
! source = "./output-variables"
! }
?
? You can output it in current code with this format as shown below
?
! output "vpc" {
! value = module.output_variables.vpc
! }
?
* we can use "terraform output" command
? we can use "terraform output vpc" to get only vpc value
*/
# module "output_variables" {
# source = "./output-variables"
# }
# module "dynamic_blocks" {
# source = "./dynamic-blocks"
# }
# module "iam_roles" {
# source = "./iam-roles"
# email = var.email
# project = var.project
# }
# module "functions" {
# source = "./functions"
# }
# module "http_load_balancing" {
# source = "./http-load-balancer"
# }
# module "jenkins_server" {
# source = "./jenkins-server"
# }
# module "cloud_run" {
# source = "./cloud-run"
# project = var.project
# }
# module "local-remote-exec" {
# source = "./local-remote-exec"
# }
# module "gke-cluster" {
# source = "./gke-cluster"
# }
module "cloud-build" {
source = "./cloud-build"
}
module "firewall" {
source = "./firewall"
}