{"id":14984565,"url":"https://github.com/rjayroach/terraplate","last_synced_at":"2025-10-07T14:42:40.626Z","repository":{"id":73365713,"uuid":"88668840","full_name":"rjayroach/terraplate","owner":"rjayroach","description":"use ansible templates to easily generate terraform modules, components and tfvars files","archived":false,"fork":false,"pushed_at":"2018-03-03T07:23:35.000Z","size":156,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T21:15:41.151Z","etag":null,"topics":["ansible-roles","terraform-modules","terragrunt"],"latest_commit_sha":null,"homepage":null,"language":null,"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/rjayroach.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-18T20:43:18.000Z","updated_at":"2024-10-25T02:22:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"d469ee9e-6039-48dc-846b-9c0ce1539714","html_url":"https://github.com/rjayroach/terraplate","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":"0.016949152542372836","last_synced_commit":"5bacabce1a6253236ddf66597e50f8cc2f72c581"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjayroach%2Fterraplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjayroach%2Fterraplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjayroach%2Fterraplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjayroach%2Fterraplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rjayroach","download_url":"https://codeload.github.com/rjayroach/terraplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248298311,"owners_count":21080320,"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":["ansible-roles","terraform-modules","terragrunt"],"created_at":"2024-09-24T14:09:16.696Z","updated_at":"2025-10-07T14:42:35.583Z","avatar_url":"https://github.com/rjayroach.png","language":null,"readme":"# Terraplate\n\nTerraplate gives you DRY [Terraform](https://terraform.io) templates and modules (!)\nand an anti bike shedding tool by providing a 'convention over configuration' approach\nto laying out multiple infrastructures over many environments.\n\nTerraplate does not actually run Terraform (or Terragrunt) to create or destroy infrastructure.\nIt's job is to generate the Terraform code that you run.\n\nTerraplate has an ansible role for each and every Terraform resource. The roles are generic and simply template\nout the relevant terraform code.\nThe real time savings comes from combining these generic roles into a collection of customized related resources\nwhich we call 'components'. There are several component, for e.g. bastion host, s3 web app, ec2 instance with elb, etc\n\nAll of these 'components' could be written in Terraform code, but then we start the copy/paste repetive code cycle.\nUsing Terraplate Components allows the Terraform code to remain DRY while making it easy to combine TF resources in\nmany disparate combinations.\n\nThe playbooks in this repository are intended to demonstrate how Terraplate and Terraplate Components work.\nAs components are usually customized per project, we maintain components in a separate repostitory\nhere: [Terraplate Components](https://github.com/rjayroach/terraplate-components).\n\nWe think this approach is useful and removes the tedious copy/paste and enabling powerful composition of resources\nquickly and easily.\n\n\n## Dependencies\n\n- [Terraform](https://terraform.io)  ;-)\n- [Terragrunt](https://github.com/gruntwork-io/terragrunt) to define variable values in tfvars files\n- [Ansible](https://www.ansible.com) to define roles and playbooks to generate your terraform code (minimum version 2.2.0)\n\n\n## Using\n\nThe Terraplate role itself does not generate any specific Terraform module or template. Your roles do that.\nThe Terraplate role provides tasks that will generate the Terraform artificats based on the values in your role.\nYour role needs to define the following:\n\n- vars/main.yml\n- files/main.tf\n- tasks/main.yml\n\nSee the [Terraplate Roles](https://github.com/rjayroach/terraplate-roles) for examples\n\nIn order to generate the Terraform code that your role defines you run an ansible playbook. Your playbook needs to:\n\n- set the fact 'package' to a value\n- include a role at the top 'terraplate/setup'\n\nAfter that setup work is done your playbook should include the roles that you have defined.\nSee the [Terraplate Playbooks](https://github.com/rjayroach/terraplate-playbooks) for examples\n\n\n## Concepts\n\n### Component\n\nThis is an envrionment agnostic definition that:\n\n- wraps the Terraform module defined by your role in a file named 'role'.tf\n- includes a remote-state.tf and a provider.tf\n- reads playbook defined variables in a hash under the nomenclature package_component_namspace_component_name\n\n### Instance\n\nThis is an environment specific definition that:\n\n- includes a tfvars file with the values to feed to the component\n- reads playbook defined variables in a hash under the nomenclature package_instance_namspace_instance_name\n\n### Variables\n\nThe naming convention for variables allows your roles to define default values for every value that is fed to your Terraform module\nbut also allows your playbooks to easily override any of those values\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjayroach%2Fterraplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frjayroach%2Fterraplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjayroach%2Fterraplate/lists"}