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

Authentication fails to "iap.googleapis.com" when using service account not associated with compute instance #79

Closed
caddac opened this issue Mar 12, 2021 · 2 comments

Comments

@caddac
Copy link

caddac commented Mar 12, 2021

I'm using a custom service account to apply this module from an external service (not running in GCP). When applying this module I'm seeing an authentication failed (HTTP 403) error to iap.googleapis.com/v1/projects/my_service_project/iap_tunnel/zones/us-west1-a/instances/my_bastion_instance:getIamPolicy?alt=json HTTP/1.1. From these docs my service account requires the Access Scope https://www.googleapis.com/auth/cloud-platform. However I can't figure out how to assign a scope to a custom service account. Per this SO answer, I need to associate my service account with an instance.

Can I apply this module using a service account not associated with a compute instance? Or does it have to be associated with an instance so I can assign this Access Scope?

@caddac
Copy link
Author

caddac commented Mar 12, 2021

well, looks like I was just missing IAP Policy Admin role. Google docs aren't really clear you need this role to manage IAP, hashicorp/terraform-provider-google#4515 (comment) finally led me to the solution. Adding required roles to the readme for this would really awesome.

@caddac caddac closed this as completed Mar 12, 2021
@onetwopunch
Copy link
Contributor

@caddac thanks for finding this. We are always trying to improve docs. Please feel free to update the README in a PR and I’ll happily review it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants