{"id":24630668,"url":"https://github.com/excoriate/terragrunt-ref-arch-v3","last_synced_at":"2025-08-23T16:08:48.679Z","repository":{"id":273836486,"uuid":"920619447","full_name":"Excoriate/terragrunt-ref-arch-v3","owner":"Excoriate","description":"Modular Infrastructure as Code Reference Architecture with Terragrunt and Terraform","archived":false,"fork":false,"pushed_at":"2025-05-24T10:41:28.000Z","size":473,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-26T10:59:01.949Z","etag":null,"topics":["cloud","devops","iac","infrastructure-as-code","terraform","terragrunt"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Excoriate.png","metadata":{"files":{"readme":".gitlab/README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-22T13:32:02.000Z","updated_at":"2025-05-26T06:35:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a10499d-287b-4291-9883-a7210b05e3aa","html_url":"https://github.com/Excoriate/terragrunt-ref-arch-v3","commit_stats":null,"previous_names":["excoriate/terragrunt-ref-arch-v3"],"tags_count":3,"template":true,"template_full_name":null,"purl":"pkg:github/Excoriate/terragrunt-ref-arch-v3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excoriate%2Fterragrunt-ref-arch-v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excoriate%2Fterragrunt-ref-arch-v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excoriate%2Fterragrunt-ref-arch-v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excoriate%2Fterragrunt-ref-arch-v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Excoriate","download_url":"https://codeload.github.com/Excoriate/terragrunt-ref-arch-v3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Excoriate%2Fterragrunt-ref-arch-v3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271755437,"owners_count":24815407,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","devops","iac","infrastructure-as-code","terraform","terragrunt"],"created_at":"2025-01-25T07:12:35.903Z","updated_at":"2025-08-23T16:08:48.661Z","avatar_url":"https://github.com/Excoriate.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitLab CI/CD Configuration for Terragrunt Reference Architecture\n\nThis directory contains the GitLab CI/CD pipeline configuration for the Terragrunt Reference Architecture project. It defines various workflows, jobs, and utility configurations to automate testing, building, and deployment processes.\n\n## Directory Structure\n\n```\n.gitlab/\n├── .gitlab-ci.yml                # Main GitLab CI/CD pipeline configuration\n├── issue_templates/              # Templates for GitLab issues (currently empty)\n├── merge_request_templates/      # Templates for GitLab merge requests (currently empty)\n├── scripts/                      # Utility scripts for CI jobs\n│   └── setup_ssh_agent.sh        # Script to set up SSH agent\n├── utils/                        # Reusable CI job configurations and utilities\n│   ├── pipeline_auth.yml         # Authentication related CI components\n│   ├── pipeline_infra.yml        # Infrastructure related CI components\n│   └── pipeline_tooling.yml      # Tooling and setup related CI components\n└── workflows/                    # Individual workflow definition files\n    ├── workflow_infra_stack_mr_nondist.yml\n    ├── workflow_infra_stack_onmaster_nondist.yml\n    ├── workflow_infra_stacks_ci.yml\n    ├── workflow_infra_terraform_ci.yml\n    ├── workflow_pipeline_build.yml\n    ├── workflow_setup_aws.yml\n    └── workflow_static_analysis.yml\n```\n\n## Main Configuration: `.gitlab-ci.yml`\n\nThe [`.gitlab-ci.yml`](../.gitlab-ci.yml) file is the entry point for all CI/CD pipelines.\n\n### Key Components:\n\n*   **Variables**: Defines global and job-specific variables used throughout the pipelines. Notable variables include:\n    *   `ENVIRONMENT`: Target environment (e.g., `dev`, `prod`).\n    *   `DEPLOYMENT_REGION`: AWS region for deployment.\n    *   `GIT_REFERENCE`: Branch/tag for the Dagger module.\n    *   `ADDITIONAL_ENV_VARS`: For injecting custom environment variables.\n    *   `NOCACHE`: To bypass Dagger cache.\n    *   `DAGGER_VERSION`: Specifies the Dagger version.\n    *   `TRIGGER_WORKFLOW_*`: A set of boolean flags to manually trigger specific workflows.\n*   **Includes**: The main configuration file uses `include:local` to incorporate various workflow files from the [`.gitlab/workflows/`](./workflows) directory. This modular approach keeps the main file clean and organizes workflows logically.\n*   **Stages**: Defines the execution order of jobs within the pipeline. Common stages include `setup`, `dagger-ci`, `infra-ci-terraform`, `infra-ci-stacks-plan`, `stack-nondist-plan`, `stack-nondist-apply`, and `pipeline-infra`.\n*   **Default Job**: A placeholder `default_job` is included to ensure pipeline validity even if no other jobs are triggered.\n\n### Included Workflows:\n\nThe [`.gitlab-ci.yml`](../.gitlab-ci.yml) file conditionally includes the following workflows based on changes in specific paths or manual trigger variables:\n\n1.  **Pipeline Build Workflow** ([`workflows/workflow_pipeline_build.yml`](./workflows/workflow_pipeline_build.yml))\n    *   **Triggered by**: Changes in `pipeline/infra/**/*` or if `TRIGGER_WORKFLOW_PIPELINE_BUILD` is `true`.\n    *   **Purpose**: Handles CI for the Dagger pipeline code itself.\n\n2.  **Infrastructure Terraform CI Workflow** ([`workflows/workflow_infra_terraform_ci.yml`](./workflows/workflow_infra_terraform_ci.yml))\n    *   **Triggered by**: Changes in `infra/terraform/**/*` or if `TRIGGER_WORKFLOW_INFRA_CI_TERRAFORM` is `true`.\n    *   **Purpose**: Runs CI jobs specifically for Terraform module changes.\n\n3.  **Infrastructure Stacks CI Workflow** ([`workflows/workflow_infra_stacks_ci.yml`](./workflows/workflow_infra_stacks_ci.yml))\n    *   **Triggered by**: If `TRIGGER_WORKFLOW_INFRA_CI_STACKS` is `true`.\n    *   **Purpose**: Runs CI jobs for Terragrunt stack changes (likely a broader trigger).\n\n4.  **AWS Setup Workflow** ([`workflows/workflow_setup_aws.yml`](./workflows/workflow_setup_aws.yml))\n    *   **Triggered by**: Changes in `.gitlab/workflows/**/*.yml`, `.gitlab-ci.yml`, or if `TRIGGER_WORKFLOW_SETUP_AWS` is `true`.\n    *   **Purpose**: Tests AWS OIDC setup and related configurations.\n\n5.  **Infrastructure Stack Non-Distributable (Merge Request) Workflow** ([`workflows/workflow_infra_stack_mr_nondist.yml`](./workflows/workflow_infra_stack_mr_nondist.yml))\n    *   **Triggered by**: Changes in `infra/terragrunt/dev/non-distributable/**/*`, `infra/terragrunt/prod/non-distributable/**/*`, `infra/terragrunt/_shared/_units/**/*` on merge requests, or if `TRIGGER_WORKFLOW_INFRA_CI_MR_STACK_NON_DIST` is `true`.\n    *   **Purpose**: Runs CI (plan) for the \"non-distributable\" stack components when changes are proposed in a merge request.\n\n6.  **Infrastructure Stack Non-Distributable (Master/Default Branch) Workflow** ([`workflows/workflow_infra_stack_onmaster_nondist.yml`](./workflows/workflow_infra_stack_onmaster_nondist.yml))\n    *   *(Note: This workflow is present in your open tabs but its include rule in `.gitlab-ci.yml` was not explicitly provided in the initial file content. Assuming it's triggered by `TRIGGER_WORKFLOW_INFRA_ONMASTER_STACK_NONDIST` or pushes to the default branch with relevant path changes.)*\n    *   **Purpose**: Handles apply operations for the \"non-distributable\" stack components when changes are merged to the main branch.\n\n7.  **Static Analysis Workflow** ([`workflows/workflow_static_analysis.yml`](./workflows/workflow_static_analysis.yml))\n    *   *(Note: This workflow is present in your open tabs but its include rule in `.gitlab-ci.yml` was not explicitly provided in the initial file content. Assuming it's triggered by `TRIGGER_WORKFLOW_STATIC_ANALYSIS` or relevant code changes.)*\n    *   **Purpose**: Performs static analysis checks on the codebase (e.g., linting, security scans).\n\n## Workflows (`.gitlab/workflows/`)\n\nThis directory contains YAML files defining specific CI/CD workflows. Each workflow typically groups related jobs and defines its own rules for execution. The primary workflows are listed above as included by the main [`.gitlab-ci.yml`](../.gitlab-ci.yml).\n\n## Utility Scripts (`.gitlab/scripts/`)\n\nThis directory is intended for shell scripts or other utility programs used by CI jobs.\n*   [`setup_ssh_agent.sh`](./scripts/setup_ssh_agent.sh): A script likely used to initialize an SSH agent within CI jobs, which can be necessary for operations requiring SSH key authentication (e.g., cloning private Git repositories).\n\n## Reusable CI Components (`.gitlab/utils/`)\n\nThis directory contains YAML files with reusable CI job definitions or configurations that can be imported into various workflows using GitLab's `include` or `extends` keywords. This promotes DRY (Don't Repeat Yourself) principles in CI configuration.\n*   [`pipeline_auth.yml`](./utils/pipeline_auth.yml): Likely contains common job configurations for authentication, such as setting up AWS OIDC, handling secrets, or configuring access to other services.\n*   [`pipeline_infra.yml`](./utils/pipeline_infra.yml): Probably defines reusable job templates or snippets for infrastructure-related tasks, such as running `terragrunt plan` or `terragrunt apply` with consistent settings.\n*   [`pipeline_tooling.yml`](./utils/pipeline_tooling.yml): May contain job definitions for setting up necessary tools (e.g., Terraform, Terragrunt, Dagger, linters) within the CI environment.\n\n## Issue and Merge Request Templates\n\nThe directories [`.gitlab/issue_templates/`](./issue_templates) and [`.gitlab/merge_request_templates/`](./merge_request_templates) are standard GitLab locations for defining templates that pre-fill issue or merge request descriptions. While currently empty, they can be populated with Markdown files to standardize these processes.\n\n## How to Use and Extend\n\n*   **Modifying Workflows**: To change existing CI processes, edit the relevant YAML file in the [`.gitlab/workflows/`](./workflows) directory.\n*   **Adding New Workflows**: Create a new YAML file in [`.gitlab/workflows/`](./workflows) and include it in the main [`.gitlab-ci.yml`](../.gitlab-ci.yml) with appropriate `rules`.\n*   **Custom Variables**: Adjust CI behavior by modifying the default values of variables in [`.gitlab-ci.yml`](../.gitlab-ci.yml) or by setting them during manual pipeline runs or in project/group CI/CD settings.\n*   **Manual Triggers**: Use the `TRIGGER_WORKFLOW_*` variables (e.g., by running a pipeline with custom variables) to force specific workflows to run, which is useful for debugging or ad-hoc tasks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcoriate%2Fterragrunt-ref-arch-v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexcoriate%2Fterragrunt-ref-arch-v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexcoriate%2Fterragrunt-ref-arch-v3/lists"}