1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Since the bucket name is unique, you don't need to specify the region at all. Try without it. If not working, refer to these other solutions: https://stackoverflow.com/questions/49522014/imagefield-with-django-storages-leads-to-error-parsing-the-x-amz-credential-pa
I have working result with my lambda in eu-west-1 and the bucket in us-east-1 with this:
import uuid import os import boto3 def lambda_handler(event, context): # Get the service client. s3 = boto3.client('s3') # Generate a random S3 key name upload_key = uuid.uuid4().hex # Generate the presigned URL for put requests presigned_url = s3.generate_presigned_url( ClientMethod='put_object', Params={ 'Bucket': 'test-abaschen-todelete', 'Key': upload_key, 'ContentType': 'application/zip' }, HttpMethod='PUT' ) # Return the presigned URL return { "upload_url": presigned_url }
répondu il y a un an
Contenus pertinents
- demandé il y a 2 mois
- demandé il y a 7 mois
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a 7 mois
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 4 mois