-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
46 lines (38 loc) · 855 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
35
36
37
38
39
40
41
42
43
# Download AWS provider from hashicorp
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
# Configure the AWS Provider
provider "aws" {
region = "us-east-2"
profile = "default"
}
# Use the VPC module
module "vpc" {
source = "./vpc"
aws_internet_gateway = module.gateway.aws_internet_gateway
}
# Use the Getaway module
module "gateway" {
source = "./gateway"
vpc_id = module.vpc.vpc_id
aws_public = module.vpc.aws_public.id
aws_subnet = module.vpc.aws_subnet.id
}
# Use the Security module
module "security" {
source = "./security"
vpc_id = module.vpc.vpc_id
}
# Use the ec2 Instance module
module "ec2" {
source = "./ec2"
aws_public = module.vpc.aws_public.id
aws_subnet = module.vpc.aws_subnet.id
security_group_id = module.security.security_group_id
}