Add staging and prod environment root modules
This commit is contained in:
parent
f2f452f300
commit
6e6c2127b9
2 changed files with 50 additions and 0 deletions
29
terraform/envs/prod/main.tf
Normal file
29
terraform/envs/prod/main.tf
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "nexus-tfstate"
|
||||
key = "prod/terraform.tfstate"
|
||||
region = "eu-central-1"
|
||||
dynamodb_table = "nexus-tfstate-lock"
|
||||
}
|
||||
}
|
||||
|
||||
module "vpc" {
|
||||
source = "../../modules/vpc"
|
||||
environment = "prod"
|
||||
}
|
||||
|
||||
module "eks" {
|
||||
source = "../../modules/eks"
|
||||
cluster_name = "nexus-prod"
|
||||
subnet_ids = module.vpc.private_subnet_ids
|
||||
min_nodes = 3
|
||||
max_nodes = 8
|
||||
}
|
||||
|
||||
module "rds" {
|
||||
source = "../../modules/rds"
|
||||
identifier = "nexus-prod-postgres"
|
||||
db_name = "nexus"
|
||||
username = "nexus_app"
|
||||
subnet_ids = module.vpc.isolated_subnet_ids
|
||||
}
|
||||
21
terraform/envs/staging/main.tf
Normal file
21
terraform/envs/staging/main.tf
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
terraform {
|
||||
backend "s3" {
|
||||
bucket = "nexus-tfstate"
|
||||
key = "staging/terraform.tfstate"
|
||||
region = "eu-central-1"
|
||||
dynamodb_table = "nexus-tfstate-lock"
|
||||
}
|
||||
}
|
||||
|
||||
module "vpc" {
|
||||
source = "../../modules/vpc"
|
||||
environment = "staging"
|
||||
}
|
||||
|
||||
module "eks" {
|
||||
source = "../../modules/eks"
|
||||
cluster_name = "nexus-staging"
|
||||
subnet_ids = module.vpc.private_subnet_ids
|
||||
min_nodes = 2
|
||||
max_nodes = 4
|
||||
}
|
||||
Loading…
Reference in a new issue