1 Resposta
- Mais recentes
- Mais votos
- Mais comentários
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 }
respondido há um ano
Conteúdo relevante
- AWS OFICIALAtualizada há 2 meses