Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skynewz/terraform-credentials-gcs
Terraform credentials helper for Google Cloud Storage
https://github.com/skynewz/terraform-credentials-gcs
google-cloud-storage terraform terraform-credentials-helper
Last synced: about 7 hours ago
JSON representation
Terraform credentials helper for Google Cloud Storage
- Host: GitHub
- URL: https://github.com/skynewz/terraform-credentials-gcs
- Owner: SkYNewZ
- License: gpl-3.0
- Created: 2020-10-21T21:06:28.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-21T22:01:14.000Z (about 4 years ago)
- Last Synced: 2024-06-21T02:08:46.128Z (5 months ago)
- Topics: google-cloud-storage, terraform, terraform-credentials-helper
- Language: Go
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terrafrom credentials helper for Google Cloud Storage
`terraform-credentials-gcs` is a Terraform ["credentials helper"](https://www.terraform.io/docs/internals/credentials-helpers.html) plugin that allows providing credentials for Terraform-native services (private module registries, Terraform Cloud, etc) publish in private Google Cloud Storage bucket.
To use it, download a release archive and extract it into the [`~/.terraform.d/plugins`](https://www.terraform.io/docs/extend/how-terraform-works.html#plugin-locations) directory where Terraform looks for credentials helper plugins. (The filename of the file inside the archive is important for Terraform to discover it correctly, so don't rename it).
Terraform will take the newest version of the plugin it finds in the plugin search directory, so if you are switching between versions you may prefer to remove existing installed versions in order to ensure Terraform selects the desired version.
Once you've installed the plugin, enable it by adding the following block to your [Terraform CLI configuration](https://www.terraform.io/docs/commands/cli-config.html): `credentials_helper "gcs" {}`.
This credentials helper plugin does not take any additional arguments, so the block must be left empty as shown above.
To enable authentication on Google Cloud Storage, use **at least**:
- Use [`gcloud`](https://cloud.google.com/sdk/docs/install) with `gcloud auth login --update-adc --no-launch-browser`
- `export GOOGLE_APPLICATION_CREDENTIALS=/path/to/your/service/account/file.json`: file path
- `export GOOGLE_CREDENTIALS=$(cat /path/to/your/service/account/file.json | tr -d "\n")`: file contentThis will provided authentication to [`golang.org/x/oauth2/google`](https://pkg.go.dev/golang.org/x/oauth2/google) wich understand these methods. See https://cloud.google.com/docs/authentication/production.
This helper will store credentials for registries in `$HOME/.config/terraform-credentials-gcs`.