{"id":26575887,"url":"https://github.com/tomarv2/terraform-google-cloud-build","last_synced_at":"2025-08-25T06:35:55.150Z","repository":{"id":42659074,"uuid":"350924563","full_name":"tomarv2/terraform-google-cloud-build","owner":"tomarv2","description":"Terraform module for Google Cloud Build","archived":false,"fork":false,"pushed_at":"2022-03-29T15:11:41.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T15:49:52.551Z","etag":null,"topics":["google-cloud-build","google-cloud-platform","terraform","terraform-module"],"latest_commit_sha":null,"homepage":"","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/tomarv2.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-24T02:42:22.000Z","updated_at":"2022-03-07T18:34:28.000Z","dependencies_parsed_at":"2022-09-23T19:51:27.389Z","dependency_job_id":null,"html_url":"https://github.com/tomarv2/terraform-google-cloud-build","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tomarv2/terraform-google-cloud-build","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-cloud-build","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-cloud-build/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-cloud-build/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-cloud-build/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomarv2","download_url":"https://codeload.github.com/tomarv2/terraform-google-cloud-build/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomarv2%2Fterraform-google-cloud-build/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266732799,"owners_count":23976104,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["google-cloud-build","google-cloud-platform","terraform","terraform-module"],"created_at":"2025-03-23T02:35:40.306Z","updated_at":"2025-07-23T18:35:01.594Z","avatar_url":"https://github.com/tomarv2.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/tomarv2/terraform-google-cloud-build/actions/workflows/pre-commit.yml\" alt=\"Pre Commit\"\u003e\n        \u003cimg src=\"https://github.com/tomarv2/terraform-google-cloud-build/actions/workflows/pre-commit.yml/badge.svg?branch=main\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.apache.org/licenses/LICENSE-2.0\" alt=\"license\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/tomarv2/terraform-google-cloud-build\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/tomarv2/terraform-google-cloud-build/tags\" alt=\"GitHub tag\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/tag/tomarv2/terraform-google-cloud-build\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/tomarv2/terraform-google-cloud-build/pulse\" alt=\"Activity\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/commit-activity/m/tomarv2/terraform-google-cloud-build\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://stackoverflow.com/users/6679867/tomarv2\" alt=\"Stack Exchange reputation\"\u003e\n        \u003cimg src=\"https://img.shields.io/stackexchange/stackoverflow/r/6679867\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://twitter.com/intent/follow?screen_name=varuntomar2019\" alt=\"follow on Twitter\"\u003e\n        \u003cimg src=\"https://img.shields.io/twitter/follow/varuntomar2019?style=social\u0026logo=twitter\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Terraform module for Google Cloud Build\n\n\u003e :arrow_right:  Terraform module for [AWS CodeBuild](https://registry.terraform.io/modules/tomarv2/codebuild/aws/latest)\n\n\u003e :arrow_right:  Terraform module for [AWS CodePipeline](https://registry.terraform.io/modules/tomarv2/codepipeline/aws/latest)\n\n### Versions\n\n- Module tested for Terraform 1.0.1.\n- Google provider version [4.12.0](https://registry.terraform.io/providers/hashicorp/google/latest)\n- `main` branch: Provider versions not pinned to keep up with Terraform releases\n- `tags` releases: Tags are pinned with versions (use \u003ca href=\"https://github.com/tomarv2/terraform-google-cloud-build/tags\" alt=\"GitHub tag\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/v/tag/tomarv2/terraform-google-cloud-build\" /\u003e\u003c/a\u003e in your releases)\n\n### Usage\n\n#### Option 1:\n\n```\nterrafrom init\nterraform plan -var='teamid=tryme' -var='prjid=project1'\nterraform apply -var='teamid=tryme' -var='prjid=project1'\nterraform destroy -var='teamid=tryme' -var='prjid=project1'\n```\n**Note:** With this option please take care of remote state storage\n\n#### Option 2:\n\n##### Recommended method (stores remote state in remote backend(S3,  Azure storage, or Google bucket) using `prjid` and `teamid` to create directory structure):\n\n- Create python 3.8+ virtual environment\n```\npython3 -m venv \u003cvenv name\u003e\n```\n\n- Install package:\n```\npip install tfremote --upgrade\n```\n\n- Set below environment variables:\n```\nexport TF_GCLOUD_BUCKET=\u003cremote state bucket name\u003e\nexport TF_GCLOUD_PREFIX=\u003cremote state bucket prefix\u003e\nexport TF_GCLOUD_CREDENTIALS=\u003cgcp credentials.json\u003e\n```\n\n- Updated `examples` directory with required values.\n\n- Run and verify the output before deploying:\n```\ntf -c=gcloud plan -var='teamid=foo' -var='prjid=bar'\n```\n\n- Run below to deploy:\n```\ntf -c=gcloud apply -var='teamid=foo' -var='prjid=bar'\n```\n\n- Run below to destroy:\n```\ntf -c=gcloud destroy -var='teamid=foo' -var='prjid=bar'\n```\n\n**Note:** Read more on [tfremote](https://github.com/tomarv2/tfremote)\n\nPlease refer to examples directory [link](examples) for references.\n\n## Permissions required to get Cloud Build list\n\n```\ncloudbuild.builds.get\ncloudbuild.builds.list\n```\n\nDepending on your requirement set the permissions.\n\n:point_right: Get `Service account` used by Cloud Build:\n\n```\nCLOUDBUILD_SA=\"$(gcloud projects describe $PROJECT_ID --format 'value(projectNumber)')@cloudbuild.gserviceaccount.com\"\n```\n\n:point_right: Assign `editor` permission to the project:\n\n```\ngcloud projects add-iam-policy-binding $PROJECT_ID --member serviceAccount:$CLOUDBUILD_SA --role roles/editor\n```\n\n## Enable below apis for Cloud Build\n\nFollowing APIs must be enabled on the project:\n- `compute.googleapis.com`\n- `cloudbuild.googleapis.com`\n\n## Troubleshooting\n\n:point_right: Cloud Build uses a special service account: [PROJECT_NUMBER]@cloudbuild.gserviceaccount.com.\n\n:point_right: [Cloud Build service account](https://cloud.google.com/build/docs/cloud-build-service-account)\n\n:point_right: [Configuring access for Cloud Build Service Account](https://cloud.google.com/build/docs/securing-builds/configure-access-for-cloud-build-service-account)\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_terraform\"\u003e\u003c/a\u003e [terraform](#requirement\\_terraform) | \u003e= 1.0.1 |\n| \u003ca name=\"requirement_google\"\u003e\u003c/a\u003e [google](#requirement\\_google) | ~\u003e 4.12.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_google\"\u003e\u003c/a\u003e [google](#provider\\_google) | ~\u003e 4.12.0 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [google_cloudbuild_trigger.default](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudbuild_trigger) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_branch_name\"\u003e\u003c/a\u003e [branch\\_name](#input\\_branch\\_name) | Branch name | `string` | `\"main\"` | no |\n| \u003ca name=\"input_cloud_build_file\"\u003e\u003c/a\u003e [cloud\\_build\\_file](#input\\_cloud\\_build\\_file) | Cloudbuild file path relative to root of the repository | `string` | `\"cloudbuild-sample.yml\"` | no |\n| \u003ca name=\"input_deploy_cloud_build\"\u003e\u003c/a\u003e [deploy\\_cloud\\_build](#input\\_deploy\\_cloud\\_build) | Feature flag | `bool` | `true` | no |\n| \u003ca name=\"input_description\"\u003e\u003c/a\u003e [description](#input\\_description) | Describe the codebuild | `string` | `null` | no |\n| \u003ca name=\"input_name\"\u003e\u003c/a\u003e [name](#input\\_name) | Name of the codebuild | `string` | `null` | no |\n| \u003ca name=\"input_owner_name\"\u003e\u003c/a\u003e [owner\\_name](#input\\_owner\\_name) | Branch name | `string` | n/a | yes |\n| \u003ca name=\"input_prjid\"\u003e\u003c/a\u003e [prjid](#input\\_prjid) | Name of the project/stack e.g: mystack, nifieks, demoaci. Should not be changed after running 'tf apply' | `string` | n/a | yes |\n| \u003ca name=\"input_repo_name\"\u003e\u003c/a\u003e [repo\\_name](#input\\_repo\\_name) | Branch name | `string` | n/a | yes |\n| \u003ca name=\"input_substitutions\"\u003e\u003c/a\u003e [substitutions](#input\\_substitutions) | Substitutions | `map(any)` | `{}` | no |\n| \u003ca name=\"input_teamid\"\u003e\u003c/a\u003e [teamid](#input\\_teamid) | Name of the team/group e.g. devops, dataengineering. Should not be changed after running 'tf apply' | `string` | n/a | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_codebuild_project\"\u003e\u003c/a\u003e [codebuild\\_project](#output\\_codebuild\\_project) | Google codebuild project |\n| \u003ca name=\"output_codebuild_trigger_id\"\u003e\u003c/a\u003e [codebuild\\_trigger\\_id](#output\\_codebuild\\_trigger\\_id) | Google codebuild trigger id |\n\u003c!-- END_TF_DOCS --\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomarv2%2Fterraform-google-cloud-build","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomarv2%2Fterraform-google-cloud-build","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomarv2%2Fterraform-google-cloud-build/lists"}