Open charlesfused opened 6 months ago
I tested it and it works for me. I removed the "NetApp_sa" resource. It is not needed. Please make sure that "/path/to/netapp_sa.json" is an absolute path. I don't expect that to be the problem, since that would throw a different error. Did you create the service account in the same project as the CVS resources? Maybe you google provider is pointing to a different project?
I also encourage you to use service account impersonation to get rid of SA key files.
More infos: https://cloud.google.com/architecture/partners/netapp-cloud-volumes/api#authenticate_using_a_service_account_key https://registry.terraform.io/providers/NetApp/netapp-gcp/latest/docs#service_account
Thanks for responding so quickly!
I tried removing the netapp_sa
resource and also confirmed path. However still getting 403 denied.
Also tried using credentials
via setting the JSON key as runtime variable.
And tried using service account impersonation.
In all cases 403 is returned.
Also tried setting project
to the project ID and project number, neither helped. Confirmed that the same project is being used everywhere in Terraform.
When TF_LOG=debug
is set, the only error shown is 2024-04-20T13:24:40.371-0400 [ERROR] vertex "netapp-gcp_storage_pool.xxx" error: code: 403, message: Authentication failure
I'm not sure what else to try at this point. Are there any other log files?
No. TF_LOG is the only log available as far as I know. Have a look into your key.json file. Is it the right one? Is it for the project you want to access? The service uses HTTPS calls with JWT bearer auth. The error seems to indicate the provider doesn't offer a valid JWT token. The token is created from the SA key using standard Google SDK libraries.
Thanks for the response.
Confirmed the key.json file is correct. I am able to use it with the google-cloud-netapp
Python SDK as well - it just doesn't work with this provider
I am out of ideas. When using a JSON key, the provider passes the key down into standard Google auth libraries to get a JWT token. It is using that key to do APi calls. Nothing really which can fail here. I am out of ideas. Maybe expect one: Did you specify a valid region? project NUMBER and region are part of the API URL used. If one of them is wrong, you are calling invalid URLs, which may result in a misleading error (just guessing here). I recommend enabling TF_LOG=debug and have a very, very careful look at the URL the provider is calling.
I have created a service account as follows
Downloaded JSON key, and configured provider as follows
When attempting to create any Netapp resource a 403 error is immediately returned.
This is the resource I'm trying to create
What permissions need to be set in order for the provider to work?