According to several examples, gsutil config can be used to create GCS-compatible .boto files from OAuth2 credentials for service accounts.
For example, https://cloud.google.com/storage/docs/xml-api/gspythonlibrary suggests under service account credentials that you should use gsutil config -e to configure a .boto file; however, when running that command, I get:
CommandException: OAuth2 is the preferred authentication mechanism
with the Cloud SDK. Run "gcloud auth login" to configure authentication,
unless you want to authenticate with an HMAC access key and secret,
in which case run "gsutil config -a".
Following instructions, I do try to use gcloud auth activate-service-account:
$ gcloud auth activate-service-account --key-file=/Users/crschmidt/mirandum-local/cloud-storage-service.json
Activated service account credentials for: [[email protected]]
But this does not create a .boto file.
I can configure an interoperable HMAC project-id/secret under interoperability mode and use that, but since OAuth2 credentials are preferred, and service account credentials seem the right way to go, I'm not sure how to proceed. How can I write a .boto file for a service account?
crschmidt-macbookair:~ crschmidt$ gsutil --version
gsutil version: 4.19
gcloud config set pass_credentials_to_gsutil falseand then run the command account. I've done that and it generated the .boto file. - Athir Nuaimi