I am looking for a way to use a custom domain with the S3 pre signed post functionality. Right now the URL returned is the default S3 bucket URL e.g. https://mybucket.s3.amazonaws.com/
. Using python I generate the pre-signed post data as such:
content_type = "text/csv"
data = s3.generate_presigned_post(
Bucket="my-bucket",
Key=path,
Fields={
"Content-Type": content_type
},
Conditions=[
{"Content-Type": content_type},
["content-length-range", 0, 10 * 1000000]
],
ExpiresIn=300,
)
The data returned by boto3 to perform a multi-part form upload is:
{
"url": "https://my-bucket.s3.amazonaws.com/",
"fields": {
"Content-Type": "text/csv",
"key": "pri...",
"AWSAccessKeyId": "A....",
"policy": "e....",
"signature": "CJR..."
}
}
I would like to get a custom domain as the "url" part to upload to. How can I do this?
Edit: This question is about AWS S3 Pre-Signed POST data for multi-part form upload. Not Pre-Signed URLs.