forked from juice-shop/juice-shop
-
Notifications
You must be signed in to change notification settings - Fork 340
/
main.tf
74 lines (58 loc) · 1.52 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
69
70
71
72
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.20.0"
}
random = {
source = "hashicorp/random"
version = "3.1.0"
}
local = {
source = "hashicorp/local"
version = "2.1.0"
}
null = {
source = "hashicorp/null"
version = "3.1.0"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = ">= 2.0.1"
}
}
required_version = ">= 0.14"
}
provider "aws" {
region = var.region
skip_credentials_validation = true
skip_requesting_account_id = true
skip_metadata_api_check = true
access_key = var.access_key
secret_key = var.secret_key
}
provider "kubernetes" {
host = module.includes.cluster_host
token = module.includes.cluster_token
cluster_ca_certificate = module.includes.cluster_cert
}
module "includes" {
source = "./terraform/modules/includes"
sg_wg_one_id = module.sg.workgroup_one_id
sg_wg_two_id = module.sg.workgroup_two_id
}
module "sg" {
source = "./terraform/modules/security-groups"
vpc_id = module.includes.vpc_id
}
module "subnets" {
source = "./terraform/modules/subnets"
region = var.region
vpc_id = module.includes.vpc_id
}
module "storage" {
source = "./terraform/modules/storage"
cluster_name = module.includes.cluster_name
rds_sg_id = module.sg.rds_sg_id
private_subnet = [module.subnets.subnet_id_main, module.subnets.subnet_id_secondary]
}