rancher / tf-rancher-up

MIT License
14 stars 5 forks source link

Create an option for users to specify a service account JSON file for GCP #162

Open Brianalmeida opened 2 months ago

Brianalmeida commented 2 months ago

Currently, it seems that for upstream GCP recipes require the user to download and use Google's SDK. Perhaps we can give the option to users to specify a service account json file and use that to authenticate with GCP.

For reference, Rancher's quickstart project has this for GCP:

Provider.tf:

provider "google" {
  credentials = file(var.gcp_account_json)
  project     = var.gcp_project
  region      = var.gcp_region
  zone        = var.gcp_zone
}

Varaibles.tf:

variable "gcp_account_json" {
  type        = string
  description = "File path and name of service account access token file."
}

tfvars file:

# File path and name of service account access token file.
gcp_account_json = ""

# GCP project in which the quickstart will be deployed.
gcp_project = ""