Search code examples
python-3.xgoogle-cloud-storagegdal

How to get GS_SECRET_ACCESS_KEY and GS_ACCESS_KEY_ID in google cloud storage


I try to read data from public google cloud storage (https://console.cloud.google.com/storage/browser/gcp-public-data-landsat) with Landsat images.

I use for it Python3 with GDAL. But I have an error

ERROR 15: GS_SECRET_ACCESS_KEY+GS_ACCESS_KEY_ID, GS_OAUTH2_REFRESH_TOKEN or GOOGLE_APPLICATION_CREDENTIALS or GS_OAUTH2_PRIVATE_KEY+GS_OAUTH2_CLIENT_EMAIL configuration options and /home/qwerty/.boto not defined

How can I get GS_SECRET_ACCESS_KEY and GS_ACCESS_KEY_ID ?


Solution

  • gs_access_key_id and gs_secret_access_key can be generated by

    1.navigating to your Google Cloud Storage console and clicking on Settings.

    2.on the Settings page, navigate to the Interoperability tab.

    3.on this page you can now choose a service account and click Create a new key to generate an access key and a matching secret.

    Output:

    New service account HMAC key
    [email protected]
    Access key  
    xxxxxxxxxxxxxxxxxxx
    Secret  
    xxxxxxxxxxxxxxxxxxx
    Copy this key's secret if you'll need it in the future. Once you close this dialog, the secret can't be recovered.