-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
68 lines (53 loc) · 1.44 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
terraform {
backend "s3" {
bucket = "khu-market-tf-0813"
key = "kyunghee-market/backend"
region = "us-east-1"
}
}
locals {
env_name = "kyunghee-market"
aws_region = "us-east-1"
}
module "vpc" {
source = "./module-network"
aws_region = local.aws_region
env_name = local.env_name
vpc_name = "khu-vpc"
public_subnet_a_cidr = "10.0.0.0/18"
public_subnet_b_cidr = "10.0.64.0/18"
private_subnet_a_cidr = "10.0.128.0/19"
private_subnet_b_cidr = "10.0.160.0/19"
private_subnet_c_cidr = "10.0.192.0/19"
private_subnet_d_cidr = "10.0.224.0/19"
}
module "ec2" {
source = "./module-ec2"
aws_region = local.aws_region
env_name = local.env_name
vpc_id = module.vpc.vpc_id
bastion_subnet_id = module.vpc.public_subnet_ids[0]
private_subnet_ids = module.vpc.asg_private_subnet_ids
}
module "s3" {
source = "./module-s3"
aws_region = local.aws_region
bucket_name = "khu-market-202312"
block_public_acls = false
block_public_policy = false
ignore_public_acls = false
restrict_public_buckets = false
}
module "dynamodb" {
source = "./module-dynamodb"
aws_region = local.aws_region
dynamodb_table_name = "khu-market-ddb"
}
module "rds" {
source = "./module-rds"
aws_region = local.aws_region
db_name = "kyunghee-market-db"
db_subnet_ids = module.vpc.db_private_subnet_ids
db_username = "admin"
db_password = "kyunghee1234!"
}