{"id":18915911,"url":"https://github.com/christosgalano/terraform-testing-example","last_synced_at":"2025-08-01T20:35:26.197Z","repository":{"id":240628065,"uuid":"803150885","full_name":"christosgalano/terraform-testing-example","owner":"christosgalano","description":"An opinionated example of how to test Terraform configurations.","archived":false,"fork":false,"pushed_at":"2024-09-22T21:02:59.000Z","size":250,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-31T15:12:53.270Z","etag":null,"topics":["ci-cd","cloud","devops","iac","terraform","testing"],"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/christosgalano.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-20T07:01:41.000Z","updated_at":"2024-09-17T15:20:13.000Z","dependencies_parsed_at":"2024-05-20T08:25:22.131Z","dependency_job_id":"ec73d91d-f2ae-4146-88ea-85ab7c82ae37","html_url":"https://github.com/christosgalano/terraform-testing-example","commit_stats":null,"previous_names":["christosgalano/terraform-testing-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christosgalano%2Fterraform-testing-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christosgalano%2Fterraform-testing-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christosgalano%2Fterraform-testing-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christosgalano%2Fterraform-testing-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christosgalano","download_url":"https://codeload.github.com/christosgalano/terraform-testing-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239908275,"owners_count":19716763,"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":["ci-cd","cloud","devops","iac","terraform","testing"],"created_at":"2024-11-08T10:17:36.721Z","updated_at":"2025-02-20T20:23:38.057Z","avatar_url":"https://github.com/christosgalano.png","language":"HCL","readme":"# terraform-testing-example\n\nAn opinionated example of how to test Terraform configurations. It includes:\n\n- **Terraform Configurations:** A simple architecture that creates an Azure Web App, Key Vault, and associated resources. This demonstrates how to structure and organize Terraform code.\n- **Tests:** Contract and integration tests that ensure the Terraform code behaves as expected. These tests are located in the tests directory and provide examples of how to write and structure tests for Terraform code.\n- **GitHub Workflows:** Automated workflows for continuous integration and deployment. These workflows, located in the .github/workflows directory, automate the process of scanning the code for issues, running the tests, and deploying the infrastructure.\n- **Configuration Files:** These files configure various tools used in the repository, such as tflint, trivy, checkov, and terraform-docs. They demonstrate how to set up and configure these tools for use with Terraform.\n\nThis repository follows best practices for Terraform development and uses GitHub workflows for automation. It serves as a practical example of how to test and deploy Terraform code.\n\n![ci](./assets/images/ci.png)\n\n![deploy](./assets/images/deploy.png)\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.8 |\n| \u003ca name=\"requirement_azurerm\"\u003e\u003c/a\u003e [azurerm](#requirement\\_azurerm) | ~\u003e 3.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_azurerm\"\u003e\u003c/a\u003e [azurerm](#provider\\_azurerm) | ~\u003e 3.0 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [azurerm_key_vault.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault) | resource |\n| [azurerm_linux_web_app.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_web_app) | resource |\n| [azurerm_private_dns_zone.vault](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_zone) | resource |\n| [azurerm_private_dns_zone_virtual_network_link.vault](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_dns_zone_virtual_network_link) | resource |\n| [azurerm_private_endpoint.vault](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource |\n| [azurerm_resource_group.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/resource_group) | resource |\n| [azurerm_service_plan.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/service_plan) | resource |\n| [azurerm_subnet.app_service](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet) | resource |\n| [azurerm_subnet.private_endpoint](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet) | resource |\n| [azurerm_virtual_network.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network) | resource |\n| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_app_service_delegated_subnet\"\u003e\u003c/a\u003e [app\\_service\\_delegated\\_subnet](#input\\_app\\_service\\_delegated\\_subnet) | Configuration for the App Service delegated subnet. | \u003cpre\u003eobject({\u003cbr\u003e    name           = string\u003cbr\u003e    address_prefix = string\u003cbr\u003e  })\u003c/pre\u003e | n/a | yes |\n| \u003ca name=\"input_app_service_plan\"\u003e\u003c/a\u003e [app\\_service\\_plan](#input\\_app\\_service\\_plan) | Configuration for the app service plan. | \u003cpre\u003eobject({\u003cbr\u003e    name = string\u003cbr\u003e    sku  = string\u003cbr\u003e  })\u003c/pre\u003e | n/a | yes |\n| \u003ca name=\"input_key_vault\"\u003e\u003c/a\u003e [key\\_vault](#input\\_key\\_vault) | Configuration for the key vault. | \u003cpre\u003eobject({\u003cbr\u003e    name                  = string\u003cbr\u003e    sku                   = string\u003cbr\u003e    private_endpoint_name = string\u003cbr\u003e    dns_zone_name         = optional(string, \"privatelink.vaultcore.azure.net\")\u003cbr\u003e  })\u003c/pre\u003e | n/a | yes |\n| \u003ca name=\"input_location\"\u003e\u003c/a\u003e [location](#input\\_location) | Location of the resources. | `string` | n/a | yes |\n| \u003ca name=\"input_private_endpoint_subnet\"\u003e\u003c/a\u003e [private\\_endpoint\\_subnet](#input\\_private\\_endpoint\\_subnet) | Configuration for the private endpoint subnet. | \u003cpre\u003eobject({\u003cbr\u003e    name           = string\u003cbr\u003e    address_prefix = string\u003cbr\u003e  })\u003c/pre\u003e | n/a | yes |\n| \u003ca name=\"input_resource_group_name\"\u003e\u003c/a\u003e [resource\\_group\\_name](#input\\_resource\\_group\\_name) | Name of the resource group. | `string` | n/a | yes |\n| \u003ca name=\"input_virtual_network\"\u003e\u003c/a\u003e [virtual\\_network](#input\\_virtual\\_network) | Configuration for the virtual network. | \u003cpre\u003eobject({\u003cbr\u003e    name          = string\u003cbr\u003e    address_space = list(string)\u003cbr\u003e  })\u003c/pre\u003e | n/a | yes |\n| \u003ca name=\"input_web_app\"\u003e\u003c/a\u003e [web\\_app](#input\\_web\\_app) | Configuration for the web app. | \u003cpre\u003eobject({\u003cbr\u003e    name                = string\u003cbr\u003e    docker_image_name   = string\u003cbr\u003e    docker_registry_url = string\u003cbr\u003e  })\u003c/pre\u003e | n/a | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_app_service_plan_id\"\u003e\u003c/a\u003e [app\\_service\\_plan\\_id](#output\\_app\\_service\\_plan\\_id) | The ID of the app service plan. |\n| \u003ca name=\"output_app_service_subnet_id\"\u003e\u003c/a\u003e [app\\_service\\_subnet\\_id](#output\\_app\\_service\\_subnet\\_id) | The ID of the app service subnet. |\n| \u003ca name=\"output_key_vault_id\"\u003e\u003c/a\u003e [key\\_vault\\_id](#output\\_key\\_vault\\_id) | The ID of the key vault. |\n| \u003ca name=\"output_key_vault_uri\"\u003e\u003c/a\u003e [key\\_vault\\_uri](#output\\_key\\_vault\\_uri) | The URI of the key vault. |\n| \u003ca name=\"output_private_dns_zone_vault_id\"\u003e\u003c/a\u003e [private\\_dns\\_zone\\_vault\\_id](#output\\_private\\_dns\\_zone\\_vault\\_id) | The ID of the private DNS zone for the vault. |\n| \u003ca name=\"output_private_endpoint_subnet_id\"\u003e\u003c/a\u003e [private\\_endpoint\\_subnet\\_id](#output\\_private\\_endpoint\\_subnet\\_id) | The ID of the private endpoint subnet. |\n| \u003ca name=\"output_private_endpoint_vault_id\"\u003e\u003c/a\u003e [private\\_endpoint\\_vault\\_id](#output\\_private\\_endpoint\\_vault\\_id) | The ID of the private endpoint for the vault. |\n| \u003ca name=\"output_resource_group_id\"\u003e\u003c/a\u003e [resource\\_group\\_id](#output\\_resource\\_group\\_id) | The ID of the resource group. |\n| \u003ca name=\"output_virtual_network_id\"\u003e\u003c/a\u003e [virtual\\_network\\_id](#output\\_virtual\\_network\\_id) | The ID of the virtual network. |\n| \u003ca name=\"output_web_app_hostname\"\u003e\u003c/a\u003e [web\\_app\\_hostname](#output\\_web\\_app\\_hostname) | The hostname of the web app. |\n| \u003ca name=\"output_web_app_id\"\u003e\u003c/a\u003e [web\\_app\\_id](#output\\_web\\_app\\_id) | The ID of the web app. |","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristosgalano%2Fterraform-testing-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristosgalano%2Fterraform-testing-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristosgalano%2Fterraform-testing-example/lists"}