I have successfully added the ability to connect and transfer files from a GCP instance using my own local account on the GCP-instance using a by adding the API access for a Google Cloud service-account.
I have a service, NGINX, running on the GCP instance and it is running with a local account privileges (nginx) on the instance. However as the user 'nginx' I cannot use the gsutil command. What I'm trying to do is to transfer log files from the GCP-instance to a bucket for safe keeping so that I can free up the space on the instance.
Now to my question: How can I set up the permissions or environment so that the user so that local accounts on GCP instances can use the gsutil and/or gcloud (or similar) commands to copy data from the instance to a bucket using an GCP service account?