{"id":19129462,"url":"https://github.com/launchbynttdata/tg-azurerm-shared-virtual_network","last_synced_at":"2026-06-17T18:02:20.122Z","repository":{"id":239656976,"uuid":"797462463","full_name":"launchbynttdata/tg-azurerm-shared-virtual_network","owner":"launchbynttdata","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-13T20:59:20.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-03T10:46:08.136Z","etag":null,"topics":["azure"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/launchbynttdata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-07T22:09:40.000Z","updated_at":"2024-10-04T01:28:36.000Z","dependencies_parsed_at":"2024-05-13T22:06:25.602Z","dependency_job_id":null,"html_url":"https://github.com/launchbynttdata/tg-azurerm-shared-virtual_network","commit_stats":null,"previous_names":["launchbynttdata/tg-azurerm-shared-virtual_network"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftg-azurerm-shared-virtual_network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftg-azurerm-shared-virtual_network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftg-azurerm-shared-virtual_network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchbynttdata%2Ftg-azurerm-shared-virtual_network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/launchbynttdata","download_url":"https://codeload.github.com/launchbynttdata/tg-azurerm-shared-virtual_network/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240199258,"owners_count":19763827,"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","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":["azure"],"created_at":"2024-11-09T06:07:34.484Z","updated_at":"2025-11-12T18:01:54.803Z","avatar_url":"https://github.com/launchbynttdata.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tg-azurerm-shared-virtual_network\n\nThis repository contains the terragrunt configuration files to provision Virtual Networks in Azure. This terragrunt repository is built around the terraform repository [TF Virtual Network](https://github.com/launchbynttdata/tf-azurerm-module_reference-virtual_network.git)\n\nTerragrunt currently doesn't support automatic creation of the storage account and container for storing the terraform state. The user has to manually create the storage account and container and update the `backend.yaml` file in each environment directory.\n\n## Directory structure\n\n- [accounts.yaml](accounts.yaml) - Contains the list of accounts and their subscription ids currently. Later we may use the Service Connection instead of Subscription IDs as the later can be set in the pipeline using environment variables. But for organizations having multiple subscriptions for different environment, it's useful to have service connection names stored in this file. The pipeline can then read the file to use the respective service connection.\n\n- [service.hcl](service.hcl) - Contains the details of the terraform module that this terragrunt repository is wrapping around. This file is used to pass the module details to the terragrunt configuration files.\n\n- [terragrunt.hcl](terragrunt.hcl) at the root level - Contains the terragrunt configuration for the root module. This file is used to pass the backend configuration to the terragrunt configuration files.\n\n```shell\n.\n├── env\n│   ├── prod\n│   │   ├── eastus\n│   │   │   ├── 000\n│   │   │   │   ├── backend.yaml\n│   │   │   │   ├── git_tag.yaml\n│   │   │   │   ├── terraform.tfvars\n│   │   │   │   └── terragrunt.hcl\n│   │   │   └── region.hcl\n│   │   └── account.hcl\n│   ├── qa\n│   │   ├── eastus\n│   │   │   ├── 000\n│   │   │   │   ├── backend.yaml\n│   │   │   │   ├── git_tag.yaml\n│   │   │   │   ├── terraform.tfvars\n│   │   │   │   └── terragrunt.hcl\n│   │   │   └── region.hcl\n│   │   └── account.hcl\n│   ├── sandbox\n│   │   ├── eastus\n│   │   │   ├── 000\n│   │   │   │   ├── backend.yaml\n│   │   │   │   ├── git_tag.yaml\n│   │   │   │   ├── terraform.tfvars\n│   │   │   │   └── terragrunt.hcl\n│   │   │   ├── 001\n│   │   │   │   ├── backend.yaml\n│   │   │   │   ├── git_tag.yaml\n│   │   │   │   ├── terraform.tfvars\n│   │   │   │   └── terragrunt.hcl\n│   │   │   └── region.hcl\n│   │   └── account.hcl\n│   └── uat\n│       ├── eastus\n│       │   ├── 000\n│       │   │   ├── backend.yaml\n│       │   │   ├── git_tag.yaml\n│       │   │   ├── terraform.tfvars\n│       │   │   └── terragrunt.hcl\n│       │   └── region.hcl\n│       └── account.hcl\n├── pipelines\n│   ├── templates\n│   │   ├── jobs\n│   │   ├── stages\n│   │   │   └── terragrunt.yaml\n│   │   └── steps\n│   └── azure-pipelines.yaml\n├── README.md\n├── accounts.yaml\n├── service.hcl\n└── terragrunt.hcl\n\n```\n\n# Pre-requisites\n\n- Ensure that the storage account and container for storing the terraform state already exists. The information is added  to `backend.yaml` file in each environment directory. For example `env/dev/eastus/000/backend.yaml`\n- Ensure the correct terraform module tag is updated in `git_tag.yaml`\n- Ensure the `terraform.tfvars` file is updated with the correct values that the wrapped terraform module expects.\n- When deploying from local laptop, ensure you are logged in to azure cli using `az login` command\n- Ensure terraform and terragrunt binaries are already installed on your local. See [.tool-versions](.tool-versions) for the list of dependencies in case you are using `asdf` to manage dependencies\n\n# Deploy Infrastructure\n\nOnce the pre-requisites are satisfied, user needs to navigate to the desired directory which they want to provision (directory that contains `terragrunt.hcl`). For example `env/dev/eastus/000`\n\nRun the below commands\n\n```bash\n# Export the environment specific env vars\n# (optional) only required if deploying in US Gov cloud\nexport ARM_ENVIRONMENT=usgovernment\n\nexport ARM_SUBSCRIPTION_ID=\u003csubscription_id\u003e\n# Navigate to the directory you want to provision infrastructure for.\ncd env/dev/eastus/000\n# This will download all the dependent modules and initialize the backend\nterragrunt init\n# This will output a plan of what infrastructures are going to be provisioned\nterragrunt plan\n# This will deploy the infrastructure as were shown in the plan above. The `-auto-approve` flag doesn't require an user approval to proceed\nterragrunt apply -auto-approve\n\n```\n\n\n# ADO pipeline\n\nThe ADO pipeline is located at `pipelines/azure-pipelines.yaml`. Currently the trigger is disabled, so the user has to manually run the pipeline after every PR is merged to `main`. When the trigger is enabled, the pipeline will run automatically after every PR is merged to `main`. \n\nTrigger can be enabled by adding the below line\n\n```\ntrigger: main\n```\n\nEvery time a new environent is added say `001` to `eastus` region, or an env to a new region say `eastus2/000`, it's the responsibility of the  user to update the pipeline to reflect the new env. The pipeline itself is completely templated, meaning the user just has to pass in the new env details as inputs to a template and has to place it at the correct\nlocation.\n\n## ADO pipeline screenshot\n\n![ADO pipeline](images/ado-pipeline.png)\n\n# References\n\n1. [ASDF](https://asdf-vm.com/guide/getting-started.html)\n2. [Terragrunt](https://terragrunt.gruntwork.io/docs/)\n3. [Terraform Azure provider](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs)\n4. [Terraform Resource Group Module](https://github.com/launchbynttdata/tf-azurerm-module_primitive-resource_group.git)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchbynttdata%2Ftg-azurerm-shared-virtual_network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaunchbynttdata%2Ftg-azurerm-shared-virtual_network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchbynttdata%2Ftg-azurerm-shared-virtual_network/lists"}