-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
49 lines (42 loc) · 1.2 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
# Terraform Main File
terraform {
cloud {
organization = "geekat7"
workspaces {
name = "InfraProject"
}
}
}
variable "region_main" {
default = "us-east-1"
}
provider "aws" {
profile = "default"
region = var.region_main
}
module "Networking" {
source = "./module/Networking"
region = var.region_main
}
module "Database" {
source = "./module/Database"
region = var.region_main
vpc_id_main = module.Networking.main_vpc_id
ec2sg = module.Networking.internal_sg_id
privatesub1 = module.Networking.private_subnet_1
privatesub2 = module.Networking.private_subnet_2
}
module "Compute" {
source = "./module/Compute"
region = var.region_main
vpc_id_main = module.Networking.main_vpc_id
publicsub1 = module.Networking.public_subnet_1
publicsub2 = module.Networking.public_subnet_2
albsg = module.Networking.external_sg_id
ec2sg = module.Networking.internal_sg_id
DB_USER = module.Database.Username
DB_PASSWORD_PARAM = module.Database.Password
DB_HOST = module.Database.Host
DB_NAME = module.Database.dbname
DB_PORT = module.Database.Port
}