{"id":24044970,"url":"https://github.com/oun/terramate-example","last_synced_at":"2026-03-02T08:03:02.851Z","repository":{"id":208155981,"uuid":"720925882","full_name":"oun/terramate-example","owner":"oun","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-20T03:23:27.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T09:19:01.772Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oun.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}},"created_at":"2023-11-20T01:32:54.000Z","updated_at":"2023-11-20T01:51:26.000Z","dependencies_parsed_at":"2023-11-20T03:45:05.252Z","dependency_job_id":null,"html_url":"https://github.com/oun/terramate-example","commit_stats":null,"previous_names":["oun/terramate-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oun/terramate-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oun%2Fterramate-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oun%2Fterramate-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oun%2Fterramate-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oun%2Fterramate-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oun","download_url":"https://codeload.github.com/oun/terramate-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oun%2Fterramate-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29995910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-01-08T23:51:41.019Z","updated_at":"2026-03-02T08:03:02.830Z","avatar_url":"https://github.com/oun.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terramate Example\n\nThis repository contains example code that you can use with Terramate to keep Terraform code DRY.\n\n## Getting Started\n\n### Prerequisites\n\n- [Terramate](https://terramate.io/docs/cli/)\n- [tfenv](https://github.com/tfutils/tfenv)\n- [Terraform](https://www.terraform.io/)\n- [pre-commit](https://pre-commit.com/)\n- [tflint](https://github.com/terraform-linters/tflint)\n\n### Install\n\n```\nbrew install terramate tfenv pre-commit tflint\n```\n\nInstall Terraform\n```\ntfenv install\n```\n\nInstall git hook scripts\n```\npre-commit install\n```\n\n### Setup Github Actions Workflows\n\nTo authenticate and authorize Github Actions Workflows to Google Cloud,\nyou need to setup and configure Workload Identity Federation by creating Workload Identity Pool\nand Workload Identity Provider.\n\n```\nPROJECT_ID=\u003cyour-project-id\u003e\ngcloud iam workload-identity-pools create \"github-pool\" \\\n  --project=\"${PROJECT_ID}\" \\\n  --location=\"global\" \\\n  --display-name=\"Github pool\"\n```\n\n```\ngcloud iam workload-identity-pools providers create-oidc \"github-oidc\" \\\n  --project=\"${PROJECT_ID}\" \\\n  --location=\"global\" \\\n  --workload-identity-pool=\"github-pool\" \\\n  --display-name=\"Github provider\" \\\n  --attribute-mapping=\"google.subject=assertion.sub,attribute.repository=assertion.repository\" \\\n  --issuer-uri=\"https://token.actions.githubusercontent.com\"\n```\n\n```\nSA_NAME=github-actions\ngcloud iam service-accounts create ${SA_NAME} \\\n  --project=\"${PROJECT_ID}\" \\\n  --display-name=\"Github Actions\"\n```\n\n```\nPROJECT_NUMBER=$(gcloud projects describe ${PROJECT_ID} --format=\"value(projectNumber)\")\nREPO_OWNER=\u003cyour-github-repo-owner\u003e\nREPO_NAME=\u003cyour-github-repo-name\u003e\ngcloud iam service-accounts add-iam-policy-binding \"${SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com\" \\\n  --project=\"${PROJECT_ID}\" \\\n  --role=\"roles/iam.workloadIdentityUser\" \\\n  --member=\"principalSet://iam.googleapis.com/projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/github-pool/attribute.repository/${REPO_OWNER}/${REPO_NAME}\"\n```\n\n```\ngcloud services enable iamcredentials.googleapis.com \\\n  --project=\"${PROJECT_ID}\"\n```\n\nAdd the following Github Actions secrets in your repository settings.\n\n```\nPROVIDER_NAME: projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/github-pool/providers/github-oidc\nSA_EMAIL: ${SA_NAME}@${PROJECT_ID}.iam.gserviceaccount.com\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foun%2Fterramate-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foun%2Fterramate-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foun%2Fterramate-example/lists"}