-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
52 lines (43 loc) · 1.07 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
provider "aws" {
region = "us-east-1"
}
module "vpc" {
source = "./vpc"
cidr_block = "10.0.0.0/16"
}
module "internet_gateway" {
source = "./internet_gateway"
vpc_id = module.vpc.vpc_id
}
module "subnet" {
source = "./subnet"
vpc_id = module.vpc.vpc_id
cidr_block = "10.0.0.0/24"
}
module "route_table" {
source = "./route_table"
vpc_id = module.vpc.vpc_id
igw_id = module.internet_gateway.igw_id
}
module "route_table_association" {
source = "./route_table_association"
subnet_id = module.subnet.subnet_id
route_table_id = module.route_table.route_table_id
}
module "security_group" {
source = "./security_group"
vpc_id = module.vpc.vpc_id
}
module "private_key" {
source = "./private_key"
}
module "instance" {
source = "./instance"
subnet_id = module.subnet.subnet_id
vpc_security_group_ids = [module.security_group.sg_id]
key_name = module.private_key.key_name
key_path = module.private_key.key_path
}
output "public_ip" {
value = module.instance.public_ip
}