{"id":13685682,"url":"https://github.com/terraform-google-modules/terraform-google-gcloud","last_synced_at":"2025-11-09T08:30:32.221Z","repository":{"id":37677142,"uuid":"171495325","full_name":"terraform-google-modules/terraform-google-gcloud","owner":"terraform-google-modules","description":"Executes Google Cloud CLI commands within Terraform","archived":false,"fork":false,"pushed_at":"2025-02-03T09:59:50.000Z","size":554,"stargazers_count":147,"open_issues_count":11,"forks_count":95,"subscribers_count":37,"default_branch":"main","last_synced_at":"2025-02-03T10:35:49.160Z","etag":null,"topics":["cft-terraform","developer-tools"],"latest_commit_sha":null,"homepage":"https://registry.terraform.io/modules/terraform-google-modules/gcloud/google","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/terraform-google-modules.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-19T15:09:57.000Z","updated_at":"2025-01-29T17:26:15.000Z","dependencies_parsed_at":"2023-09-28T17:09:53.992Z","dependency_job_id":"e9cd31b7-ad03-4993-ac4a-5ed0062e9853","html_url":"https://github.com/terraform-google-modules/terraform-google-gcloud","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-google-modules%2Fterraform-google-gcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-google-modules%2Fterraform-google-gcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-google-modules%2Fterraform-google-gcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-google-modules%2Fterraform-google-gcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terraform-google-modules","download_url":"https://codeload.github.com/terraform-google-modules/terraform-google-gcloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239571542,"owners_count":19661164,"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":["cft-terraform","developer-tools"],"created_at":"2024-08-02T14:00:55.895Z","updated_at":"2025-11-09T08:30:32.177Z","avatar_url":"https://github.com/terraform-google-modules.png","language":"HCL","funding_links":[],"categories":["HCL"],"sub_categories":[],"readme":"# terraform-google-gcloud\n\nThis module allows you to use gcloud, gsutil, any gcloud component, and jq in Terraform. Sometimes, there isn't Terraform GCP support for a particular feature, or you'd like to do something each time Terraform runs (ie: upload a file to a Kubernetes pod) that lacks Terraform support.\n\nThis module *does not* create any resources on GCP itself, rather exposes the GCP SDK to you for usage in null resources \u0026 external data resources.\n\n## Usage\n\nBasic usage of this module is as follows:\n\n```hcl\nmodule \"gcloud\" {\n  source  = \"terraform-google-modules/gcloud/google\"\n  version = \"~\u003e 3.5\"\n\n  platform = \"linux\"\n  additional_components = [\"kubectl\", \"beta\"]\n\n  create_cmd_entrypoint  = \"gcloud\"\n  create_cmd_body        = \"version\"\n  destroy_cmd_entrypoint = \"gcloud\"\n  destroy_cmd_body       = \"version\"\n}\n```\n\nFunctional examples are included in the\n[examples](https://github.com/terraform-google-modules/terraform-google-gcloud/tree/master/examples) directory.\n\nThe [jq](https://stedolan.github.io/jq/) binary is also included in this module so you can use it as well for either of your `create_cmd_entrypoint` or `destroy_cmd_entrypoint` values.\n\n## Downloading\nBy default, this module assumes you already have gcloud installed in your $PATH.\n\nIf you need to run Terraform in environments without a gcloud binary available, you can override this behavior by setting the `skip_download` variable to `false`.\n\nYou can also override the behavior by setting the `GCLOUD_TF_DOWNLOAD` environment variable.\nThis environment variable will override all other settings.\nSetting it to `never` will *never* gcloud download and setting it to `always` will always download gcloud.\n\n\u003c!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| activate\\_service\\_account | Set to false to skip running `gcloud auth activate-service-account`. Optional. | `bool` | `true` | no |\n| additional\\_components | Additional gcloud CLI components to install. Defaults to none. Valid value are components listed in `gcloud components list` | `list(string)` | `[]` | no |\n| create\\_cmd\\_body | On create, the command body you'd like to run with your entrypoint. | `string` | `\"info\"` | no |\n| create\\_cmd\\_entrypoint | On create, the command entrypoint you'd like to use. Can also be set to a custom script. Module's bin directory will be prepended to path. | `string` | `\"gcloud\"` | no |\n| create\\_cmd\\_triggers | List of any additional triggers to re-run the create command execution when either of values in the maps change. Some keys are reserved and will be overwritten if specified in this option. (eg. `md5`, `arguments`, `download_gcloud_command`, `download_jq_command`, etc. See details in [the source](https://github.com/terraform-google-modules/terraform-google-gcloud/blob/master/main.tf).) | `map(any)` | `{}` | no |\n| destroy\\_cmd\\_body | On destroy, the command body you'd like to run with your entrypoint. | `string` | `\"info\"` | no |\n| destroy\\_cmd\\_entrypoint | On destroy, the command entrypoint you'd like to use.  Can also be set to a custom script. Module's bin directory will be prepended to path. | `string` | `\"gcloud\"` | no |\n| enabled | Flag to optionally disable usage of this module. | `bool` | `true` | no |\n| gcloud\\_download\\_url | Custom gcloud download url. Optional. | `string` | `\"\"` | no |\n| gcloud\\_sdk\\_version | The gcloud sdk version to download. | `string` | `\"481.0.0\"` | no |\n| jq\\_download\\_url | Custom jq download url. Optional. | `string` | `\"\"` | no |\n| jq\\_version | The jq version to download. | `string` | `\"1.6\"` | no |\n| module\\_depends\\_on | List of modules or resources this module depends on. | `list(any)` | `[]` | no |\n| platform | Platform CLI will run on. Defaults to linux. Valid values: linux, darwin | `string` | `\"linux\"` | no |\n| service\\_account\\_key\\_file | Path to service account key file to run `gcloud auth activate-service-account` with. Optional. | `string` | `\"\"` | no |\n| skip\\_download | Whether to skip downloading gcloud (assumes gcloud is already available outside the module) | `bool` | `true` | no |\n| upgrade | Whether to upgrade gcloud at runtime | `bool` | `true` | no |\n| use\\_tf\\_google\\_credentials\\_env\\_var | Use `GOOGLE_CREDENTIALS` environment variable to run `gcloud auth activate-service-account` with. Optional. | `bool` | `false` | no |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| bin\\_dir | The full bin path of the modules executables |\n| create\\_cmd\\_bin | The full bin path \u0026 command used on create |\n| destroy\\_cmd\\_bin | The full bin path \u0026 command used on destroy |\n| downloaded | Whether gcloud was downloaded or not |\n| wait | An output to use when you want to depend on cmd finishing |\n\n\u003c!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --\u003e\n\n## Requirements\n\nThese sections describe requirements for using this module.\n\n### Software\n\nThe following dependencies must be available:\n\n- [Terraform][terraform] v0.12\n- [Terraform Provider for GCP][terraform-provider-gcp] plugin v2.0\n- [curl][curl]\n\n### Service Account\n\nA service account must be created, along with a key, to use this module.\nThe service account must have the proper IAM roles for whatever\ncommands you're running with this module.\n\n### APIs\n\nA project is not required to host resources of this module, since\nthis module does not create any resources.\n\nHowever you will likely need a project for your service account\nand any resources you'd like to interact with while using this module.\n\n## Contributing\n\nRefer to the [contribution guidelines](./CONTRIBUTING.md) for\ninformation on contributing to this module.\n\n[iam-module]: https://registry.terraform.io/modules/terraform-google-modules/iam/google\n[project-factory-module]: https://registry.terraform.io/modules/terraform-google-modules/project-factory/google\n[terraform-provider-gcp]: https://www.terraform.io/docs/providers/google/index.html\n[terraform]: https://www.terraform.io/downloads.html\n[curl]: https://curl.haxx.se\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-google-modules%2Fterraform-google-gcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterraform-google-modules%2Fterraform-google-gcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-google-modules%2Fterraform-google-gcloud/lists"}