Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use preexisting service account from another GCP project #1859

Closed
conchaox opened this issue Jan 29, 2024 · 1 comment
Closed

Use preexisting service account from another GCP project #1859

conchaox opened this issue Jan 29, 2024 · 1 comment
Labels
enhancement New feature or request Stale

Comments

@conchaox
Copy link

conchaox commented Jan 29, 2024

TL;DR

Use a preexisting SA from another GCP project different form the one where the module resources will be created.

Terraform Resources

No response

Detailed design

Is it possible to create the module resources using a preexisting GCP SA (K8s SA will have the same name)that belongs to a project different from the one where we are installing the module resources? I'm trying to do something like this:

`module "my-app-workload-identity" {
  source                          = "terraform-google-modules/kubernetes-engine/google//modules/workload-identity"
  use_existing_gcp_sa             = true
  gcp_sa_name                     = var.gcp_sa_name
  name                            = var.service_account != "" ? var.service_account : google_service_account.service_account[0].account_id
  namespace                       = kubernetes_namespace.namespace.metadata[0].name
  project_id                      = data.google_project.project.project_id
  automount_service_account_token = true
  roles = [
    "roles/cloudsql.client",
    "roles/iam.workloadIdentityUser",
    "roles/storage.admin",
  ]
}`

using `gcp_sa_name` I'm trying to pass the FQDN for an SA that belongs to a project different to  `project_id` this value should override whatever it it sin `var.name` according to the docs.

Additional information

No response

@conchaox conchaox added the enhancement New feature or request label Jan 29, 2024
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Mar 29, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale
Projects
None yet
Development

No branches or pull requests

1 participant