{"id":22904407,"url":"https://github.com/gruberdev/tf-static","last_synced_at":"2025-04-01T08:26:59.684Z","repository":{"id":40428256,"uuid":"347241959","full_name":"gruberdev/tf-static","owner":"gruberdev","description":"A multi-pipeline IaC project implementing best practices deploying a static-content website in a low-cost VPS","archived":false,"fork":false,"pushed_at":"2023-12-15T20:28:07.000Z","size":1276,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T05:13:59.674Z","etag":null,"topics":["hugo","hugo-site","proof-of-concept","static","static-site","static-website","terraform"],"latest_commit_sha":null,"homepage":"https://グルーバー.com","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/gruberdev.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}},"created_at":"2021-03-13T01:22:05.000Z","updated_at":"2023-01-02T07:38:20.000Z","dependencies_parsed_at":"2022-08-18T07:55:15.251Z","dependency_job_id":null,"html_url":"https://github.com/gruberdev/tf-static","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruberdev%2Ftf-static","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruberdev%2Ftf-static/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruberdev%2Ftf-static/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruberdev%2Ftf-static/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gruberdev","download_url":"https://codeload.github.com/gruberdev/tf-static/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246605800,"owners_count":20804288,"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":["hugo","hugo-site","proof-of-concept","static","static-site","static-website","terraform"],"created_at":"2024-12-14T02:46:09.424Z","updated_at":"2025-04-01T08:26:59.661Z","avatar_url":"https://github.com/gruberdev.png","language":"HCL","readme":"# tf-static\n\nA multi-pipeline IaC project implementing best practices deploying a static-content website in a low-cost VPS company. Although Vultr's provider is the unique VPS provider supported for now, the idea is to expand to other clouds as PoC's.\n\n## Why?\n\nA lot of projects using Terraform ware designed and built using applications of a such a desproportional size, most developers will never get in touch with such a scale.\n\nThis project aims to provide the same standard of practices commonly adopted by these bigger projetcts but instead of focusing on learning alone, we aim to provide a practical perspective on the processes that pipelines and tools have to perform each day.\n\n\u003e **It's important to note a project this small wouldn't these tools to work, nor we defend the adoption of these practices in every project without prior analysis regardless of the project's design or size.**\n\n## Usage\n\n```sh\ncurl -s https://グルーバー.com/terraform.sh | bash\n```\n\n### Running tests\n\n- Tests are available in `test` directory\n\n- In the test directory, run the below command\n\n```sh\ngo test\n```\n\n\n----\n\n\u003cbr\u003e\n\n\u003cdetails\u003e\n\n  \u003csummary\u003e\n   Stages \u0026 Tools\n  \u003c/summary\u003e\n\n## Providers\n\n- [terraform-provider-cloudflare](https://github.com/cloudflare/terraform-provider-cloudflare)\n- [terraform-provider-vultr](https://github.com/vultr/terraform-provider-vultr)\n- [vaulted provider](https://github.com/sumup-oss/vaulted)\n- [docker provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs)\n\n## Pipelines\n\n### After_each\n\n- [tf-notify](https://github.com/mercari/tfnotify)\n\n### Init tage\n\n- terraform init\n- [terraform fmt](https://github.com/antonbabenko/pre-commit-terraform)\n\n### Linter stage\n\n- [terraform-validate](https://github.com/antonbabenko/pre-commit-terraform)\n- [terraform-tflint](https://github.com/terraform-linters/tflint)\n- [gitlab-ci-local](https://github.com/firecow/gitlab-ci-local)\n\n### Testing stage\n\n- [terratest](https://github.com/gruntwork-io/terratest)\n- [checkov](https://github.com/bridgecrewio/checkov)\n- terraform plan\n\n### Deploy stage\n\n- terraform apply\n  - Create a VPS machine to serve as runner using Vultr's provider\n  - Register Gitlab-runner using Docker provider and remote-exec\n  - Create another VPS machine to serve as host to the final deploy using Vultr's runner\n  - Build and deploy your website through terraform using gitlab's self-managed runner\n  - After the deployment ends, unregister the self-running machine on Gitlab\n\n### Post-deploy stage\n\n- [terraform-docs](https://github.com/terraform-docs/terraform-docs) @ github actions\n- upload [terraform-docs](https://github.com/terraform-docs/terraform-docs) to github repository\n- [gitlab-pipeline-deleter](https://github.com/screendriver/gitlab-pipeline-deleter)\n- [terraform-visual](https://github.com/hieven/terraform-visual) to get a static website\n- upload infra chart to github pages\n\n### Other tools\n\n- [tfmask](https://github.com/cloudposse/tfmask) to remove output with sensitive variables\n- [terraform-provider-vault](https://github.com/hashicorp/terraform-provider-vault) for credentials management\n- [tfupdate](https://github.com/minamijoyo/tfupdate) to keep it up to date in a cron runtime\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n  Thanks and acknowledgements\n  \u003c/summary\u003e\n\n\u003cbr\u003e\n\nLearning resources I've used:\n\n- [Using Pipelines to Manage Environments with Infrastructure as Code](https://medium.com/@kief/https-medium-com-kief-using-pipelines-to-manage-environments-with-infrastructure-as-code-b37285a1cbf5)\n- [PaloAltoNetworks/terraform-best-practices](https://github.com/PaloAltoNetworks/terraform-best-practices)\n\n- [antonbabenko/terraform-best-practices](https://github.com/antonbabenko/terraform-best-practices) \u0026 [Terraform Best Practices website](https://www.terraform-best-practices.com/)\n- original templated generated by [generator-tf-module](https://github.com/sudokar/generator-tf-module)\n- [awesome-terraform](https://github.com/shuaibiyy/awesome-terraform)\n\nUseful projects to learn and practice using Terraform:\n\n- [Condor, a Vultr's open-source project to automate deploying Kubernetes on their cloud](https://github.com/vultr/terraform-vultr-condor)\n- [tf_best_practices_sample_module](https://github.com/last9bot/tf_best_practices_sample_module)\n\n\u003c/details\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruberdev%2Ftf-static","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgruberdev%2Ftf-static","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruberdev%2Ftf-static/lists"}