equinix / terraform-equinix-metal-anthos-on-baremetal

Terraform module for quick deployment of baremetal Anthos on Equinix Metal
https://registry.terraform.io/modules/equinix/anthos-on-baremetal
Apache License 2.0
25 stars 24 forks source link

GCP permissions for application-default login #48

Open denisj3030 opened 3 years ago

denisj3030 commented 3 years ago

Use case - you don't own the target GCP project for the deployment. Owner of the project provides the service-account keys and you do the rest.

This may be a corner case issue but in the above scenario the keys and permissions generated by the setup_gcp_project.sh script are not enough. You need to give GCP application-default credentials for terraform to use. The instructions in README use gcloud application-default login for this but if you don't have access to the target GCP project, it will error a about 3 minutes into the terraform run.

Prior to changing the super-admin SA to bmctl SA and reducing permissions, you could use the super-admin SA key for the application-default credentials (link). That account had project editor and IAM admin roles.

displague commented 3 years ago

Relates to #14 which made setup_gcp_project.sh unncessary, but still usable.

The keys gcp_keys_path should allow for any custom keys to be used, with setup_gcp_project.sh preparing the keys for the general case.

I see two possible remediations:

We could do both. Would this help in your scenario?