@@ -393,7 +393,7 @@ describe("bucketHostname", () => {
393
393
[
394
394
{
395
395
bucketArn : "arn:aws:sqs:us-west-2:123456789012:someresource" ,
396
- message : "Expect 's3' or 's3-outposts' in ARN service component" ,
396
+ message : "Expect 's3' or 's3-outposts' or 's3-object-lambda' in ARN service component" ,
397
397
} ,
398
398
{
399
399
bucketArn : "arn:aws:s3:us-west-2:123456789012:bucket_name:mybucket" ,
@@ -713,4 +713,23 @@ describe("bucketHostname", () => {
713
713
expect ( signingService ) . toBe ( "s3-outposts" ) ;
714
714
} ) ;
715
715
} ) ;
716
+
717
+ describe ( "from Object Lamdba ARN" , ( ) => {
718
+ describe ( "populates access point endpoint from ARN" , ( ) => {
719
+ it ( "should use the proper endpoint" , ( ) => {
720
+ const region = "eu-west-1" ;
721
+ const expectedEndpoint = "js-sdk-ap-name-123456789012.s3-object-lambda.eu-west-1.amazonaws.com" ;
722
+ [ "arn:aws:s3-object-lambda:eu-west-1:123456789012:accesspoint/js-sdk-ap-name" ] . forEach ( ( outpostArn ) => {
723
+ const { bucketEndpoint, hostname } = bucketHostname ( {
724
+ bucketName : parseArn ( outpostArn ) ,
725
+ baseHostname : "s3.eu-west-1.amazonaws.com" ,
726
+ isCustomEndpoint : false ,
727
+ clientRegion : region ,
728
+ } ) ;
729
+ expect ( bucketEndpoint ) . toBe ( true ) ;
730
+ expect ( hostname ) . toBe ( expectedEndpoint ) ;
731
+ } ) ;
732
+ } ) ;
733
+ } ) ;
734
+ } ) ;
716
735
} ) ;
0 commit comments