diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4064183..75609f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,11 @@ jobs: - uses: actions/checkout@v4 - uses: hashicorp/setup-terraform@v3 - name: Terraform Initialize - working-directory: ChatInfra + working-directory: ChatInfra/environments/dev run: terraform init -backend=false - + - name: Terraform validate - working-directory: ChatInfra + working-directory: ChatInfra/environments/dev run: terraform validate # If terraform is valid check terraform formatting @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@v4 - uses: hashicorp/setup-terraform@v3 - name: Check formatting - working-directory: ChatInfra + working-directory: ChatInfra/environments/dev run: terraform fmt -recursive -check # If terraform format is valid check server formatting diff --git a/ChatInfra/main.tf b/ChatInfra/environments/dev/main.tf similarity index 86% rename from ChatInfra/main.tf rename to ChatInfra/environments/dev/main.tf index 97721ed..6670c28 100644 --- a/ChatInfra/main.tf +++ b/ChatInfra/environments/dev/main.tf @@ -1,16 +1,16 @@ module "vpc" { - source = "./modules/vpc" + source = "../../modules/vpc" project_name = var.project_name } module "security_groups" { - source = "./modules/security_groups" + source = "../../modules/security_groups" project_name = var.project_name vpc_id = module.vpc.vpc_id } module "alb" { - source = "./modules/alb" + source = "../../modules/alb" project_name = var.project_name vpc_id = module.vpc.vpc_id alb_sg_id = module.security_groups.alb_sg_id @@ -20,12 +20,12 @@ module "alb" { } module "dynamodb" { - source = "./modules/dynamodb" + source = "../../modules/dynamodb" project_name = var.project_name } module "rds" { - source = "./modules/rds" + source = "../../modules/rds" project_name = var.project_name db_name = var.db_name private_subnet_ids = module.vpc.private_subnets @@ -33,14 +33,14 @@ module "rds" { } module "elasticache" { - source = "./modules/elasticache" + source = "../../modules/elasticache" project_name = var.project_name private_subnet_ids = module.vpc.private_subnets elasticache_sg_id = module.security_groups.elasticache_sg_id } module "secrets" { - source = "./modules/secrets" + source = "../../modules/secrets" project_name = var.project_name db_name = var.db_name db_password = module.rds.db_password @@ -48,7 +48,7 @@ module "secrets" { } module "ecs" { - source = "./modules/ecs" + source = "../../modules/ecs" project_name = var.project_name region = var.aws_region db_secret_arn = module.secrets.db_secret_arn @@ -58,19 +58,19 @@ module "ecs" { } module "static_site" { - source = "./modules/static_site" + source = "../../modules/static_site" project_name = var.project_name alb_dns_name = module.alb.public_alb_dns_name chatserver_nlb_dns_name = module.alb.chatserver_nlb_dns_name } module "cloudtrail" { - source = "./modules/cloudtrail" + source = "../../modules/cloudtrail" project_name = var.project_name } module "ecs_services" { - source = "./modules/ecs_services" + source = "../../modules/ecs_services" project_name = var.project_name region = var.aws_region cluster_id = module.ecs.cluster_id diff --git a/ChatInfra/outputs.tf b/ChatInfra/environments/dev/outputs.tf similarity index 100% rename from ChatInfra/outputs.tf rename to ChatInfra/environments/dev/outputs.tf diff --git a/ChatInfra/providers.tf b/ChatInfra/environments/dev/providers.tf similarity index 100% rename from ChatInfra/providers.tf rename to ChatInfra/environments/dev/providers.tf diff --git a/ChatInfra/variables.tf b/ChatInfra/environments/dev/variables.tf similarity index 99% rename from ChatInfra/variables.tf rename to ChatInfra/environments/dev/variables.tf index 3b17c89..3721fad 100644 --- a/ChatInfra/variables.tf +++ b/ChatInfra/environments/dev/variables.tf @@ -11,4 +11,4 @@ variable "project_name" { variable "db_name" { type = string default = "chatsystem" -} \ No newline at end of file +}