{"id":19685422,"url":"https://github.com/kislerdm/terraform-google-child-project","last_synced_at":"2026-06-09T18:32:01.985Z","repository":{"id":99104395,"uuid":"568560735","full_name":"kislerdm/terraform-google-child-project","owner":"kislerdm","description":"Terraform module to provision a child GCP project managed with CI","archived":false,"fork":false,"pushed_at":"2022-11-21T07:03:56.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-30T00:12:37.991Z","etag":null,"topics":["gcp","google","iam","terraform-module"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/kislerdm/child-project/google/latest","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kislerdm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-20T22:31:54.000Z","updated_at":"2022-11-21T07:08:11.000Z","dependencies_parsed_at":"2023-06-03T20:30:42.022Z","dependency_job_id":null,"html_url":"https://github.com/kislerdm/terraform-google-child-project","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/kislerdm/terraform-google-child-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fterraform-google-child-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fterraform-google-child-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fterraform-google-child-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fterraform-google-child-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kislerdm","download_url":"https://codeload.github.com/kislerdm/terraform-google-child-project/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fterraform-google-child-project/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34121021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":["gcp","google","iam","terraform-module"],"created_at":"2024-11-11T18:21:50.558Z","updated_at":"2026-06-09T18:32:01.956Z","avatar_url":"https://github.com/kislerdm.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform module to provision a child GCP project managed with CI\n\nThe module provisions a GCP project and assigns a billing account to it.\n\nThe following resources are also provisioned in the newly created account:\n\n- the service account to provision project specific resources using terraform;\n- the bucket to be used as the terraform backend to keep state of project specific resources;\n- the workload identity pool to authenticate and authorise the created service account for CI jobs.\n\nThe module supports the following CI:\n\n- GitHub Actions.\n\n## Architecture Diagram\n\n![diagram](https://raw.githubusercontent.com/kislerdm/terraform-google-child-project/master/module-diagram.svg)\n\n## Prerequisites\n\n1. The [GCP Account](https://console.cloud.google.com/).\n2. Activated [billing](https://console.cloud.google.com/billing).\n3. The root GCP project -\u003e `{{.rootProjectID}}`.\n4. The service account (SA) to be assumed to provision child projects using terraform -\u003e `{{.serviceAccountEmail}}`.\n5. The following roles attached to the SA on the _organisation level_:\n    - roles/axt.admin\n    - roles/billing.user\n    - roles/resourcemanager.projectCreator\n    - roles/resourcemanager.projectIamAdmin\n    - roles/resourcemanager.projectDeleter\n6. Follow [the steps](https://github.com/google-github-actions/auth#setting-up-workload-identity-federation) to setup\n   workload ID federation\n7. Configure the GitHub action authN/Z step:\n\n```yaml\n- id: 'auth'\n  name: 'Authenticate to Google Cloud'\n  uses: 'google-github-actions/auth@v0'\n  with:\n    workload_identity_provider: '{{.outputOfStep6}}'\n    service_account: '{{.serviceAccountEmail}}'\n```\n\nwhere\n\n- `serviceAccountEmail` is the email of the terraform root's SA, output from the step 4;\n- `outputOfStep6` provider's ID output from the step 6.\n\n8. Export `ORG_ID` and `BILLING_ACCOUNT`\n   as [GitHub secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets)\n\n### How to create a new project\n\nAdd the configuration to the [main.tf](main.tf) of the terraform project:\n\n```terraform\nmodule \"{{.projectName}}\" {\n  source          = \"kislerdm/child-project/google\"\n  root_project    = \"{{.rootProjectID}}\"\n  root_sa_email   = \"{{.serviceAccountEmail}}\"\n  project_id      = \"{{.projectName}}\"\n  github_repo     = \"{{.githubOwner}}/{{.githubRepoName}}\"\n  bucket_prefix   = \"sys\"\n  org_id          = var.org_id\n  billing_account = var.billing_account\n}\n```\n\n\u003c!-- BEGIN_TF_DOCS --\u003e\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_google\"\u003e\u003c/a\u003e [google](#requirement\\_google) | ~\u003e 4.41.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_google\"\u003e\u003c/a\u003e [google](#provider\\_google) | ~\u003e 4.41.0 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [google_iam_workload_identity_pool.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/iam_workload_identity_pool) | resource |\n| [google_iam_workload_identity_pool_provider.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/iam_workload_identity_pool_provider) | resource |\n| [google_project.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project) | resource |\n| [google_project_iam_member.admin](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_iam_member) | resource |\n| [google_project_iam_member.tf_admin](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_iam_member) | resource |\n| [google_project_service.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/project_service) | resource |\n| [google_service_account.tf_admin](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account) | resource |\n| [google_service_account_iam_binding.this](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account_iam_binding) | resource |\n| [google_service_account_iam_member.admin](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account_iam_member) | resource |\n| [google_service_account_iam_member.tf_admin](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/service_account_iam_member) | resource |\n| [google_storage_bucket.projects_tf](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/storage_bucket) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_billing_account\"\u003e\u003c/a\u003e [billing\\_account](#input\\_billing\\_account) | Billing account. | `string` | n/a | yes |\n| \u003ca name=\"input_bucket_prefix\"\u003e\u003c/a\u003e [bucket\\_prefix](#input\\_bucket\\_prefix) | Prefix of the gcs bucket to store tf state within the provisioned project. | `string` | `\"sys\"` | no |\n| \u003ca name=\"input_github_repo\"\u003e\u003c/a\u003e [github\\_repo](#input\\_github\\_repo) | GitHub repository to keep tf codebase defining resources in the provisioned project. The format: {{owner}}/{{repoName}} | `string` | n/a | yes |\n| \u003ca name=\"input_org_id\"\u003e\u003c/a\u003e [org\\_id](#input\\_org\\_id) | Organisation ID. | `string` | n/a | yes |\n| \u003ca name=\"input_project_id\"\u003e\u003c/a\u003e [project\\_id](#input\\_project\\_id) | Name of the project to create. | `string` | n/a | yes |\n| \u003ca name=\"input_root_project\"\u003e\u003c/a\u003e [root\\_project](#input\\_root\\_project) | Parent project\\_id. | `string` | n/a | yes |\n| \u003ca name=\"input_root_sa_email\"\u003e\u003c/a\u003e [root\\_sa\\_email](#input\\_root\\_sa\\_email) | Parent project SA's email. | `string` | n/a | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_instructions\"\u003e\u003c/a\u003e [instructions](#output\\_instructions) | Instruction to setting up the tf state codebase to manage the newly created project. |\n\u003c!-- END_TF_DOCS --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkislerdm%2Fterraform-google-child-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkislerdm%2Fterraform-google-child-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkislerdm%2Fterraform-google-child-project/lists"}