Skip to content

Instantly share code, notes, and snippets.

@marklit
Last active July 5, 2024 09:07
Show Gist options
  • Save marklit/ea314dc5da5349ffad8c13a69a3c3b6d to your computer and use it in GitHub Desktop.
Save marklit/ea314dc5da5349ffad8c13a69a3c3b6d to your computer and use it in GitHub Desktop.
Satellogic Samples

Signature version complaint via awscli

$ virtualenv ~/.aws
$ source ~/.aws/bin/activate
$ pip install awscli

$ aws --version
aws-cli/1.33.21 Python/3.10.12 Linux/5.15.153.1-microsoft-standard-WSL2 botocore/1.34.139
$ aws configure set s3.signature_version s3v4
$ cat ~/.aws/config
[default]
s3 =
    signature_version = s3v4
$ aws --no-sign-request s3 sync s3://satellogic-sample-data/ ./
download failed: s3://satellogic-sample-data/Baotou/0392e349-af81-4b9f-90ca-283070dc4dbb/20240601_064039_NS43_L1D_MS/rasters/20240601_064039_NS43_L1D_CLOUD_MS_360_4520.tif to Baotou/0392e349-af81-4b9f-90ca-283070dc4dbb/20240601_064039_NS43_L1D_MS/rasters/20240601_064039_NS43_L1D_CLOUD_MS_360_4520.tif An error occurred (InvalidArgument) when calling the GetObject operation: Requests specifying Server Side Encryption with AWS KMS managed keys require AWS Signature Version 4. You can enable AWS Signature Version 4 by running the command:
aws configure set s3.signature_version s3v4

HTTPS via wget

import boto3
from botocore.client import Config
from botocore import UNSIGNED


url = boto3.client('s3',
                   config=Config(signature_version=UNSIGNED))\
           .generate_presigned_url(
                'get_object',
                ExpiresIn=0,
                Params={'Bucket': 'satellogic-sample-data',
                        'Key':    'Baotou/0392e349-af81-4b9f-90ca-283070dc4dbb/20240601_064039_NS43_L1D-SR_MS/20240601_064039_NS43_L1D-SR_CLOUD_MS.vrt'})

print(url)
https://satellogic-sample-data.s3.amazonaws.com/Baotou/0392e349-af81-4b9f-90ca-283070dc4dbb/20240601_064039_NS43_L1D-SR_MS/20240601_064039_NS43_L1D-SR_CLOUD_MS.vrt
$ wget https://satellogic-sample-data.s3.amazonaws.com/Baotou/0392e349-af81-4b9f-90ca-283070dc4dbb/20240601_064039_NS43_L1D-SR_MS/20240601_064039_NS43_L1D-SR_CLOUD_MS.vrt
ERROR 400: Bad Request
$ wget https://s3.eu-west-1.amazonaws.com/satellogic-sample-data/Baotou/0392e349-af81-4b9f-90ca-283070dc4dbb/20240601_064039_NS43_L1D-SR_MS/20240601_064039_NS43_L1D-SR_CLOUD_MS.vrt
ERROR 400: Bad Request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment