{"id":22317419,"url":"https://github.com/mosowaz/Azure_CI_CD_Pipeline_for_Terraform_code","last_synced_at":"2025-07-29T12:30:58.451Z","repository":{"id":265230502,"uuid":"895507859","full_name":"mosowaz/Azure_CI_CD_Pipeline_for_Terraform_code","owner":"mosowaz","description":"Using Azure ci cd Pipeline for Terraform code to create or destroy resources in Azure Portal","archived":false,"fork":false,"pushed_at":"2025-03-24T16:06:18.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T15:21:17.012Z","etag":null,"topics":["azure-devops","terraform-azure-pipeline"],"latest_commit_sha":null,"homepage":"","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/mosowaz.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-11-28T10:40:53.000Z","updated_at":"2025-03-24T15:09:20.000Z","dependencies_parsed_at":"2025-03-24T16:23:55.490Z","dependency_job_id":"f4dba8c6-f4c1-4996-8583-e1a572f123a4","html_url":"https://github.com/mosowaz/Azure_CI_CD_Pipeline_for_Terraform_code","commit_stats":null,"previous_names":["mosowaz/azure_ci_cd_pipeline_for_terraform_with_spn","mosowaz/azure_ci_cd_pipeline_for_terraform_code"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mosowaz/Azure_CI_CD_Pipeline_for_Terraform_code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosowaz%2FAzure_CI_CD_Pipeline_for_Terraform_code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosowaz%2FAzure_CI_CD_Pipeline_for_Terraform_code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosowaz%2FAzure_CI_CD_Pipeline_for_Terraform_code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosowaz%2FAzure_CI_CD_Pipeline_for_Terraform_code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mosowaz","download_url":"https://codeload.github.com/mosowaz/Azure_CI_CD_Pipeline_for_Terraform_code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosowaz%2FAzure_CI_CD_Pipeline_for_Terraform_code/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267686337,"owners_count":24127715,"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-07-29T02:00:12.549Z","response_time":2574,"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":["azure-devops","terraform-azure-pipeline"],"created_at":"2024-12-03T23:09:41.120Z","updated_at":"2025-07-29T12:30:58.439Z","avatar_url":"https://github.com/mosowaz.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://dev.azure.com/MosesOwaseye/hub%20and%20spokes%20vnet%20peering/_apis/build/status%2Fhub%20and%20spokes%20vnet%20peering?branchName=main)](https://dev.azure.com/MosesOwaseye/hub%20and%20spokes%20vnet%20peering/_build/latest?definitionId=10\u0026branchName=main)\n\n# Azure_CI_CD_Pipeline_for_Terraform_with_SPN\nUsing Azure ci cd Pipeline for Terraform code to create, modify or destroy resources in Azure Portal\n\n### Connect Hub and Spoke virtual networks with virtual network peering using Terraform code\n\n![diagram to lab2](https://learn.microsoft.com/en-us/azure/virtual-network/media/tutorial-connect-virtual-networks-portal/resources-diagram.png#lightbox)\n## Order of code\n./network/main.tf --\u003e ./compute/main.tf --\u003e ./rt_table-nsg/main.tf\n\n## Description\n\n### Note\nThe providers version are pinned to a specific version.\\\nterraform version = 1.9.5\\\nazurerm version = 4.0.1 \n\n### ./network\n1. Create 2 Spoke virtual networks and 1 Hub vnet\n  \n2. Peer Hub virtual network with both Spoke virtual networks\n   - azurerm_virtual_network_peering.peering1-2 (hub vnet to spoke1 vnet) \n   - azurerm_virtual_network_peering.peering2-1 (spoke1 vnet to hub vnet)\n   - azurerm_virtual_network_peering.peering1-3 (hub vnet to spoke2 vnet) \n   - azurerm_virtual_network_peering.peering3-1 (spoke2 vnet to hub vnet)\n\n3. Create subnets in each virtual network - (vnet1-subnet, vnet2-subnet, and vnet3-subnet) \n \n### ./compute\n1. Create data source block to reference network resources (in data.tf)\n\n2. Deploy a virtual machine (VM) into each virtual network (hub-vm, spoke1-vm, and spoke2-vm)\n   - Create public ip for \"hub-vm\" (which is a Virtual Appliance)\n   - Configure the \"hub-vm\" to allow ip forwarding in the user_data section\n   - Introduce Provisioner \"local-exec\" to save the public IP address on local machine as a text file  \n\n### ./rt_table-nsg\n1. Create network security group, security rules, and rule associtaion\n   - \"inbound-public\" to allow local machine to connect to public ip of hub and spoke VMs\n   - \"outbound-private\" to allow access from other subnets within Azure\n\n  \n2. Create route tables and associations\n   - route table \"spoke1-2\", next hop is NVA, and destination is \"vnet3-subnet\".\\\n     Then, associate the table with \"vnet2-subnet\"\n   - route table spoke2-1\", next hop is NVA, and destination is \"vnet2-subnet\".\\\n     Then, associate the table with \"vnet3-subnet\" \n\n3. Test route between both spokes VM\n   - ssh into NVA (hub-vm), and reboot it for IP forwarding configuration to take effect\n   - Connect to each Spoke VM, ping and tracepath command to each other to confirm next hop.\n   - Next hop should show \"hub-vm\"\n\n## Test result showing tracepath and next hop between each Spoke VMs \n![spoke1-to-spoke2_route](https://github.com/user-attachments/assets/7e955037-079e-4e46-a533-e7db5db4861d)      \n![spoke2-to-spoke1_route](https://github.com/user-attachments/assets/647ee7a8-e422-4ef4-a7fd-43583223bce5)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosowaz%2FAzure_CI_CD_Pipeline_for_Terraform_code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmosowaz%2FAzure_CI_CD_Pipeline_for_Terraform_code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosowaz%2FAzure_CI_CD_Pipeline_for_Terraform_code/lists"}