{"id":13575451,"url":"https://github.com/pagopa/terraform-infrastructure-template","last_synced_at":"2025-06-18T13:38:57.000Z","repository":{"id":43011760,"uuid":"368129605","full_name":"pagopa/terraform-infrastructure-template","owner":"pagopa","description":"Terraform template repository for infrastructures projects","archived":false,"fork":false,"pushed_at":"2023-02-07T11:55:01.000Z","size":85,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-30T00:26:07.870Z","etag":null,"topics":["infrastructure","template"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pagopa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-17T09:31:03.000Z","updated_at":"2025-03-22T20:29:21.000Z","dependencies_parsed_at":"2024-11-05T11:38:50.454Z","dependency_job_id":null,"html_url":"https://github.com/pagopa/terraform-infrastructure-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pagopa%2Fterraform-infrastructure-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pagopa%2Fterraform-infrastructure-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pagopa%2Fterraform-infrastructure-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pagopa%2Fterraform-infrastructure-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pagopa","download_url":"https://codeload.github.com/pagopa/terraform-infrastructure-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250447982,"owners_count":21432166,"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":["infrastructure","template"],"created_at":"2024-08-01T15:01:01.193Z","updated_at":"2025-04-23T14:20:57.740Z","avatar_url":"https://github.com/pagopa.png","language":"HCL","funding_links":[],"categories":["HCL"],"sub_categories":[],"readme":"# terraform-infrastructure-template\n\nTerraform template repository for infrastructures projects\n\n## How to use this template\n\n### Change the template name\n\nIn this template we use `devopslab` or `dvopla` to define ours project, but you need to change all the information, to be complaint with your project\n\nInside:\n\n* src\\\n  * .env\\\n    * terraform.tfvars\n\nChange this informations\n\n```ts\n# general\nenv_short      = \"d\"\nenv            = \"dev\"\nprefix         = \"dvopla\"\nlocation       = \"northeurope\"\nlocation_short = \"neu\"\n\ntags = {\n  CreatedBy   = \"Terraform\"\n  Environment = \"DEV\"\n  Owner       = \"DevOps\"\n  Source      = \"https://github.com/pagopa/devopslab-infra\"\n  CostCenter  = \"TS310 - PAGAMENTI \u0026 SERVIZI\"\n}\n```\n\nAnd change all the occurency of `devopslab` of his prefix with yours prefix.\n\nIn the folders core, pillar and k8s\n\nChange the occurrence `devopslab` with the name of your project or the name that is better for you.\n\n### Terraform folders name convention\n\nInside the folder src we have this folders, that contains the terraform files. Here you can find the meaning of the folders\n\n* pillar: contains all the basic infrastructure that must be created before to support other layers, and cannot be destroyed every time.\n  * for example we can find the dns, vnet or monitoring\n* core: here you can find all the business infrastructure objects, use data to load the objects created in pillar.\n* k8s: here you can find the setup of your cluster k8s/aks\n  * for example ingress, secrets, rbac or service accounts\n\n## Requirements\n\n### 1. terraform\n\nIn order to manage the suitable version of terraform it is strongly recommended to install the following tool:\n\n* [tfenv](https://github.com/tfutils/tfenv): **Terraform** version manager inspired by rbenv.\n\nOnce these tools have been installed, install the terraform version shown in:\n\n* .terraform-version\n\nAfter installation install terraform:\n\n```sh\ntfenv install\n```\n\n## Terraform modules\n\nAs PagoPA we build our standard Terraform modules, check available modules:\n\n* [PagoPA Terraform modules](https://github.com/search?q=topic%3Aterraform-modules+org%3Apagopa\u0026type=repositories)\n\n## Apply changes\n\nTo apply changes follow the standard terraform lifecycle once the code in this repository has been changed:\n\n```sh\nterraform.sh init [dev|uat|prod]\n\nterraform.sh plan [dev|uat|prod]\n\nterraform.sh apply [dev|uat|prod]\n```\n\n## Terraform lock.hcl\n\nWe have both developers who work with your Terraform configuration on their Linux, macOS or Windows workstations and automated systems that apply the configuration while running on Linux.\n\u003chttps://www.terraform.io/docs/cli/commands/providers/lock.html#specifying-target-platforms\u003e\n\nSo we need to specify this in terraform lock providers:\n\n```sh\nterraform init\n\nrm .terraform.lock.hcl\n\nterraform providers lock \\\n  -platform=windows_amd64 \\\n  -platform=darwin_amd64 \\\n  -platform=darwin_arm64 \\\n  -platform=linux_amd64\n```\n\n## Precommit checks\n\nCheck your code before commit.\n\n\u003chttps://github.com/antonbabenko/pre-commit-terraform#how-to-install\u003e\n\n```sh\npre-commit run -a\n```\n\nInstall the pre-commit hook globally\n\n```sh\nDIR=~/.git-template\ngit config --global init.templateDir ${DIR}\npre-commit init-templatedir -t pre-commit ${DIR}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpagopa%2Fterraform-infrastructure-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpagopa%2Fterraform-infrastructure-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpagopa%2Fterraform-infrastructure-template/lists"}