-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.tf
46 lines (36 loc) · 934 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
44
45
provider "aws" {
region = var.region
}
module "vpc" {
source = "./modules/vpc"
}
module "subnet" {
source = "./modules/subnet"
vpc_id = module.vpc.vpc_id
region = var.region
}
module "storage" {
source = "./modules/storage"
acl = var.s3_acl
db_password = "supersecret"
db_username = "snyk"
environment = var.env
vpc_id = module.vpc.vpc_id
private_subnet = [module.subnet.subnet_id_main, module.subnet.subnet_id_secondary]
}
module "iam" {
source = "./modules/iam"
environment = var.env
}
module "instance" {
source = "terraform-aws-modules/ec2-instance/aws"
ami = var.ami
instance_type = "t2.micro"
name = "terraform-example-server"
vpc_security_group_ids = [module.vpc.vpc_sg_id]
subnet_id = module.subnet.subnet_id_main
tags = {
Terraform = "true"
Environment = var.env
}
}