-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
34 lines (30 loc) · 948 Bytes
/
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
module "networking" {
source = "./modules/networking"
repo-name = var.repo-name
ec2_node_cidr = module.ec2_bastion.ec2_node_cidr
}
module "ec2" {
source = "./modules/ec2"
vpc = module.networking.vpc.vpc_id
key_name = module.key_gen.key_name
subnet_id = module.networking.vpc.public_subnets[0]
security_group = [module.networking.webserver-sg.id]
repo-name = var.repo-name
}
module "key_gen" {
source = "./modules/aws_keys"
repo-name = var.repo-name
}
module "s3-bucket" {
source = "terraform-aws-modules/s3-bucket/aws"
version = "3.3.0"
}
module "ec2_bastion" {
source = "./modules/node_ec2"
vpc = module.networking.vpc.vpc_id
#create seperate key for bastion host
key_name = module.key_gen.key_name
subnet_id = module.networking.vpc.public_subnets[0]
security_group = [module.networking.bastion-host-sg.id]
repo-name = var.repo-name
}