This Terraform module enables you to configure GitHub Actions as an GCP IAM OIDC identity provider in GCP, which enables GitHub Actions to access resources within an GCP account(s) without requiring long-lived credentials to be stored as GitHub secrets.
- GCP Project(s) and credentials
- GitHub repository
- Terraform >= 1.x
- Profit?
provider "google" {
region = var.region
project = var.project_id
}
provider "google-beta" {
region = var.region
project = var.project_id
}
module "github_oidc" {
source = "saidsef/github-oidc/gcp"
version = ">= 1"
project_id = var.project_id
pool_id = "github-action"
repositories = [{
org_name = "saidsef"
repository = "terraform-gcp-github-oidc"
}]
}
NOTE: You can undelete a provider for up to 30 days after deletion. After 30 days, deletion is permanent. Until a provider is permanently deleted, you cannot reuse its name when creating a new provider.
Please see TERRAFORM.md
Retrieve temporary credentials:
Our latest and greatest source of terraform-gcp-github-oidc
can be found on GitHub. Fork us!
We would ❤️ you to contribute by making a pull request.
Please read the official Contribution Guide for more information on how you can contribute.