{"id":20348526,"url":"https://github.com/onebeyond/org-infra-template","last_synced_at":"2026-03-07T12:03:29.496Z","repository":{"id":216687850,"uuid":"742007986","full_name":"onebeyond/org-infra-template","owner":"onebeyond","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-11T17:09:42.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-08T18:49:58.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onebeyond.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}},"created_at":"2024-01-11T15:14:26.000Z","updated_at":"2024-01-11T16:56:11.000Z","dependencies_parsed_at":"2024-01-12T02:09:00.142Z","dependency_job_id":"44b2a7f6-814f-490b-a41e-8662b659c0ff","html_url":"https://github.com/onebeyond/org-infra-template","commit_stats":null,"previous_names":["onebeyond/org-infra-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/onebeyond/org-infra-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onebeyond%2Forg-infra-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onebeyond%2Forg-infra-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onebeyond%2Forg-infra-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onebeyond%2Forg-infra-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onebeyond","download_url":"https://codeload.github.com/onebeyond/org-infra-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onebeyond%2Forg-infra-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30212491,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T09:02:10.694Z","status":"ssl_error","status_checked_at":"2026-03-07T09:02:08.429Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-14T22:21:03.130Z","updated_at":"2026-03-07T12:03:24.485Z","avatar_url":"https://github.com/onebeyond.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# org-infra\n\n:warning: Important notice! :warning:\nMake sure to contribute this docs before doing it on your repo based on these.\nThat's something you should keep in mind in case you want to still receive updates from this template on your project.\n\nSame for new variables or resources added by you lately. For example, if you are missing a resource that this template does not currently provide, let's say `repositories/templates/github_dependabot_secret.tf` don't add that to your project directly. Make sure to follow the \u003ca href=\"https://github.com/onebeyond/org-infra-template?tab=coc-ov-file\"\u003eHow to Contribute guide\u003c/a\u003e for creating a **Pull Request** including your changes for being reflected on this template before.\n\nIn that way, you are always gonna be able to benefit from the updates of this template.\n\n## Terraform state\n\nTerraform states are stored in a backend remotely in an AWS S3 bucket. This bucket must be a non-public one, encrypted and have versioning enabled to prevent data loss.\n\nFeel free to edit the file located at `backend.tf`. That one contains the configuration where you would be able to configure where you desire to store the remote state. Hopefully, a \u003ca href=\"https://developer.hashicorp.com/terraform/language/settings/backends/local\"\u003epublic list of official backends\u003c/a\u003e has been published for choosing the one that fits better our needs.\n\n## Configuration\n\nIn case our organization does not fit the configuration we should update that value in the section: `main.tf \u003e provider \u003e github \u003e owner`\n\n**Managing teams** it's an easy task. The file is located at `teams/main.tf` and is the one that would contain a module per each team that has been added. The provided example `team-admins`.\n\nThe other file you would need to modify for sure is `repositories/main.tf`. That contains a module for each repository managed by our Github provider. The full list of parameters to be configured for each repository can be found at `repositories/templates/variables.tf`. Reviewing this file is crucial after \u003ca href=\"https://github.com/onebeyond/org-infra?tab=readme-ov-file#importing-a-repository\"\u003eimporting an already existing repository\u003c/a\u003e since the parameters would need to be adjusted to avoid any different configuration if that's not our intention.\n\n## Requirements\n\nYou need to have Terraform \u003e= 1.6 installed on your machine. You can download it from [here](https://www.terraform.io/downloads.html).\n\nIt's strongly recommended to use \u003ca href=\"https://github.com/tfutils/tfenv\"\u003etfenv\u003c/a\u003e for running the required **Terraform** version. By having created the file `.terraform-version` this tool would set up the required runtime version immediately.\n\n## Testing locally\n\nYou can test the Terraform code locally by running the following commands (you need a valid GitHub token):\n\n```bash\nterraform init\nterraform plan\n```\n\nSince running a plan over all the project resource types may be something slow is strongly recommended to run a plan for your specific desired module.\nFor running a plan over `module.repositories` a command is available:\n```bash\nmake plan-module-repositories\n```\n\n## Importing a repository\n\nFor importing an already existent repository we would need to define a module for it first. That one must be created at `repositories/main.tf` with the desired name.\n\nIn our case, we are trying to import a repository named `org-infra`, so the first step is to create the module for importing the existing resources onto the new state module.\n\n```tcl\nmodule \"org-infra\" {\n  source = \"./templates\"\n\n  github_repository = {\n    name       = \"org-infra\"\n    visibility = \"public\"\n  }\n\n  github_teams_repository = [{\n    team_id    = var.teams-name.team-admins\n    permission = \"admin\"\n  }]\n\n  github_repository_topics = [\"github\"]\n}\n```\n\n```bash\nterraform import module.repositories.module.org-infra.github_repository.repo org-infra\nterraform import module.repositories.module.org-infra.github_branch_protection.main org-infra:master\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonebeyond%2Forg-infra-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonebeyond%2Forg-infra-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonebeyond%2Forg-infra-template/lists"}