You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So essentially my company has a setup where we use a cloudfront distribution as an origin for presigned URLs.
The S3 origin domain name is in the format https://BUCKET.s3.REGION.amazonaws.com in cloudfront
The V1 presigned URL library gave presigned URLs in this format e.g. https://BUCKET.s3.REGION.amazonaws.com/KEY?param=xyz
We then rename the domain part of the URL to the company domain name and the client sees a URL with the comany name rather than the bucket e.g. https://company-domain/file?...
gives a URL in the format https://s3.REGION.amazonaws.com/BUCKET which when the domain part is renamed we see errors from cloudfront.
I've tried modifying cloudfront to accept https://s3.REGION.amazonaws.com/BUCKET as an origin but this is rejected with Error: updating CloudFront Distribution: InvalidArgument: The parameter Origin DomainName does not refer to a valid S3 bucket.
and it works perfectly ... but the AwsS3V4Signer is marked internal/unstable so I have concerns introducing this into the codebase.
I've tried using the 'official' S3Presigner client to make the URLs in the format we need but without success e.g. using endpointOverride.
Can anyone shine a light on how to resolve this please? Or have any ideas?
From AWS - is this small change in behaviour a permement change from V1 to V2 or something that might become configurable in the future?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So essentially my company has a setup where we use a cloudfront distribution as an origin for presigned URLs.
The S3 origin domain name is in the format
https://BUCKET.s3.REGION.amazonaws.com
in cloudfrontThe V1 presigned URL library gave presigned URLs in this format e.g.
https://BUCKET.s3.REGION.amazonaws.com/KEY?param=xyz
We then rename the domain part of the URL to the company domain name and the client sees a URL with the comany name rather than the bucket e.g.
https://company-domain/file?...
The V2 presigned URL library using this code
gives a URL in the format
https://s3.REGION.amazonaws.com/BUCKET
which when the domain part is renamed we see errors from cloudfront.I've tried modifying cloudfront to accept
https://s3.REGION.amazonaws.com/BUCKET
as an origin but this is rejected withError: updating CloudFront Distribution: InvalidArgument: The parameter Origin DomainName does not refer to a valid S3 bucket.
I can use the V2 SDK like so
and it works perfectly ... but the
AwsS3V4Signer
is marked internal/unstable so I have concerns introducing this into the codebase.I've tried using the 'official'
S3Presigner
client to make the URLs in the format we need but without success e.g. usingendpointOverride
.Can anyone shine a light on how to resolve this please? Or have any ideas?
From AWS - is this small change in behaviour a permement change from V1 to V2 or something that might become configurable in the future?
Beta Was this translation helpful? Give feedback.
All reactions