-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
77 lines (61 loc) · 1.43 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
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.27"
}
}
required_version = ">= 0.14.9"
backend "s3" {
bucket = "terraform-20220210205113858700000002"
key = "16da99fe-aca0-4a54-8194-4057de64b8ff"
region = "eu-central-1"
}
}
provider "aws" {
region = "eu-central-1"
}
#Creating the VPC
module "vpc" {
source = "./modules/vpc"
}
#Adding a single subnet to the VPC
module "subnets" {
depends_on = [module.vpc]
source = "./modules/subnets"
#Vars
vpcId = module.vpc.vpcId
}
#Creating the gateways
module "gateways" {
depends_on = [module.subnets, module.subnets]
source = "./modules/gateways"
#Vars
publicSubnetId = module.subnets.publicSubnetId
vpcId = module.vpc.vpcId
}
module "routingTables" {
depends_on = [module.vpc, module.subnets, module.gateways]
source = "./modules/route-tables"
#Vars
vpcId = module.vpc.vpcId
inetGwId = module.gateways.inetGatewayId
natId = module.gateways.natGatewayId
publicSubnet = module.subnets.publicSubnetId
privateSubnet = module.subnets.privateSubnetId
}
#Creating the security group for the IPFS ports
module "securityGroups" {
depends_on = [module.subnets]
#Vars
vpcId = module.vpc.vpcId
source = "./modules/security-groups"
}
module "kms" {
source = "./modules/kms"
}
module "ecr" {
depends_on = [module.kms]
source = "./modules/ecr"
ecr_kms_key = module.kms.kms_key_id
}