fix: configure S3 client with explicit endpoint URL and v4 signature version
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 20s
All checks were successful
Deploy Beta (NATIVE) / deploy (push) Successful in 20s
This commit is contained in:
parent
a5e39e1cb5
commit
5ac86cd6dc
1 changed files with 4 additions and 1 deletions
|
|
@ -287,11 +287,14 @@ class PresignedUrlView(APIView):
|
|||
if aws_access and aws_secret:
|
||||
try:
|
||||
import boto3
|
||||
from botocore.client import Config
|
||||
s3_client = boto3.client(
|
||||
's3',
|
||||
aws_access_key_id=aws_access,
|
||||
aws_secret_access_key=aws_secret,
|
||||
region_name=region_name
|
||||
region_name=region_name,
|
||||
endpoint_url=f"https://s3.{region_name}.amazonaws.com",
|
||||
config=Config(signature_version='s3v4')
|
||||
)
|
||||
presigned_url = s3_client.generate_presigned_url(
|
||||
'put_object',
|
||||
|
|
|
|||
Loading…
Reference in a new issue