For Compute Engine vm instance to have access to Cloud Storage, follow the steps below:
- Go to Compute Engine
- Click your vm instance
- Check Cloud API access scopes at the very bottom.
Note: If it is set to Allow default access, you must change it by the following steps:
Stop your VM and click Edit
Go to Cloud API access scopes
Select the option below:
A. Allow full access to all Cloud APIs, to have an access to all Cloud API including Cloud Storage.
B. Set access for each API, only selected Cloud API will have an access.
Save and Start/Resume your vm.
solved Unable to upload files on Google Cloud Storage using PHP via Google Compute Engine