-
Notifications
You must be signed in to change notification settings - Fork 212
/
production.tf
58 lines (53 loc) · 1.93 KB
/
production.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
/*====
Variables used across all modules
======*/
locals {
production_availability_zones = ["us-east-1a", "us-east-1b"]
}
provider "aws" {
region = "${var.region}"
#profile = "duduribeiro"
}
resource "aws_key_pair" "key" {
key_name = "production_key"
public_key = "${file("production_key.pub")}"
}
module "networking" {
source = "./modules/networking"
environment = "production"
vpc_cidr = "10.0.0.0/16"
public_subnets_cidr = ["10.0.1.0/24", "10.0.2.0/24"]
private_subnets_cidr = ["10.0.10.0/24", "10.0.20.0/24"]
region = "${var.region}"
availability_zones = "${local.production_availability_zones}"
key_name = "production_key"
}
module "rds" {
source = "./modules/rds"
environment = "production"
allocated_storage = "20"
database_name = "${var.production_database_name}"
database_username = "${var.production_database_username}"
database_password = "${var.production_database_password}"
subnet_ids = ["${module.networking.private_subnets_id}"]
vpc_id = "${module.networking.vpc_id}"
instance_class = "db.t2.micro"
}
module "ecs" {
source = "./modules/ecs"
environment = "production"
vpc_id = "${module.networking.vpc_id}"
availability_zones = "${local.production_availability_zones}"
repository_name = "openjobs/production"
subnets_ids = ["${module.networking.private_subnets_id}"]
public_subnet_ids = ["${module.networking.public_subnets_id}"]
security_groups_ids = [
"${module.networking.security_groups_ids}",
"${module.rds.db_access_sg_id}"
]
database_endpoint = "${module.rds.rds_address}"
database_name = "${var.production_database_name}"
database_username = "${var.production_database_username}"
database_password = "${var.production_database_password}"
secret_key_base = "${var.production_secret_key_base}"
}