I am seeing some behavior which I am struggling to explain - has anyone else seen this kind of thing?
Friday Afternoon (13-May-2022)
- I create a new S3 bucket on Friday afternoon.
- I use my standard Python Boto3 code in a Lambda function to generate and output a pre-signed URL to retrieve an Excel file from the bucket.
- I attempt to use these pre-signed URL in a number of different browsers.
- Most of these URL fail with the well known message, although occasionally a test run will work:
The request signature we calculated does not match the signature you provided. Check your key and signing method.
Monday Morning (16-May-2022)
- No change to my Lambda code
- Every single pre-signed URL works (successive Lambda executions generate new URL due to the advance of the clock, so I am free to test this as often as I like.
The Python code I am using is a simple Boto3 call I have used in lots of other places:
import boto3
s3 = boto3.client("s3")
...
excelFileUrl = s3.generate_presigned_url('get_object',
Params = {'Bucket': MY_BUCKET, 'Key': MY_KEY},
ExpiresIn = 604799)
Logically, if there was something wrong with bucket security or the way I was using Boto3, it would be equally broken today as Friday, so I am a bit stumped.