From 163b8146a76e5e339d99e3f08295384fe4fa3f28 Mon Sep 17 00:00:00 2001 From: Mostafa Kamal Date: Mon, 1 Jul 2024 13:37:59 +0600 Subject: [PATCH] project dir --- README.md | 2 +- environment/stage/terragrunt.hcl | 2 +- {terraform => projects}/common/.gitkeep | 0 {terraform => projects}/common/common-resources.tf | 0 {terraform => projects}/prod/main.tf | 0 {terraform => projects}/prod/variables.tf | 0 {terraform => projects}/stage/main.tf | 0 {terraform => projects}/stage/variables.tf | 0 symlink-modules.sh | 6 +++--- 9 files changed, 5 insertions(+), 5 deletions(-) rename {terraform => projects}/common/.gitkeep (100%) rename {terraform => projects}/common/common-resources.tf (100%) rename {terraform => projects}/prod/main.tf (100%) rename {terraform => projects}/prod/variables.tf (100%) rename {terraform => projects}/stage/main.tf (100%) rename {terraform => projects}/stage/variables.tf (100%) diff --git a/README.md b/README.md index c6cd643..3f80759 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ terrafrom-terragrunt-aws-project │ ├── main.tf │ ├── output.tf │ └── variables.tf -├── terraform +├── projects │ ├── common │ │ └── common-resources.tf │ ├── stage diff --git a/environment/stage/terragrunt.hcl b/environment/stage/terragrunt.hcl index 8de8584..b6c5a5b 100644 --- a/environment/stage/terragrunt.hcl +++ b/environment/stage/terragrunt.hcl @@ -1,5 +1,5 @@ terraform { - source = "../../terraform//stage" + source = "../../projects//stage" } include { diff --git a/terraform/common/.gitkeep b/projects/common/.gitkeep similarity index 100% rename from terraform/common/.gitkeep rename to projects/common/.gitkeep diff --git a/terraform/common/common-resources.tf b/projects/common/common-resources.tf similarity index 100% rename from terraform/common/common-resources.tf rename to projects/common/common-resources.tf diff --git a/terraform/prod/main.tf b/projects/prod/main.tf similarity index 100% rename from terraform/prod/main.tf rename to projects/prod/main.tf diff --git a/terraform/prod/variables.tf b/projects/prod/variables.tf similarity index 100% rename from terraform/prod/variables.tf rename to projects/prod/variables.tf diff --git a/terraform/stage/main.tf b/projects/stage/main.tf similarity index 100% rename from terraform/stage/main.tf rename to projects/stage/main.tf diff --git a/terraform/stage/variables.tf b/projects/stage/variables.tf similarity index 100% rename from terraform/stage/variables.tf rename to projects/stage/variables.tf diff --git a/symlink-modules.sh b/symlink-modules.sh index 7ab54c9..2704061 100755 --- a/symlink-modules.sh +++ b/symlink-modules.sh @@ -4,12 +4,12 @@ SOURCE_DIR="modules" # Get the list of environments by reading the directory names inside the terraform folder -COMPONENT_DIR="terraform" -ENVIRONMENTS=($(ls -d $COMPONENT_DIR/*/ | xargs -n 1 basename | grep -v '^common$')) +PROJECT_DIR="project" +ENVIRONMENTS=($(ls -d $PROJECT_DIR/*/ | xargs -n 1 basename | grep -v '^common$')) # Loop through each environment and create symlinks for modules for ENV in "${ENVIRONMENTS[@]}"; do - TARGET_DIR="$COMPONENT_DIR/$ENV/modules" + TARGET_DIR="$PROJECT_DIR/$ENV/modules" # Ensure the target directory exists mkdir -p "$TARGET_DIR"