aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

S3 presign don't work with S3 Object Lambda arn

Open koiker opened this issue 2 years ago • 1 comments

Describe the bug

When running the command: aws s3 presign <object-lambda-arn>/<object_key> We receive the error: s3 commands do not support S3 Object Lambda resources. Use s3api commands instead. The problem is that presign is not an API operation and the s3api commands don't have a presign operation.

Expected Behavior

When running the aws s3 presign with an Object Lambda arn and object we expect to receive a presigned URL in return of this command

Current Behavior

We receive the error: s3 commands do not support S3 Object Lambda resources. Use s3api commands instead.

The error message is a dead-end as there is no API action for presign URLs. It's just a way to sign an API request using querystring parameters instead of header.

Reproduction Steps

Run the following command:

aws s3 presign arn:aws:s3-object-lambda:us-east-1:1111111111111:accesspoint/ol-ap-amazon-s3/myobject.ext

Possible Solution

Implement the presign URL with S3 Object Lambda ARNs

Additional Information/Context

No response

CLI version used

2.7.25

Environment details (OS name and version, etc.)

MacOS

koiker avatar Sep 08 '22 21:09 koiker

Hi @koiker thanks for reaching out. It looks like S3 Lambda Objects were announced just over a year ago per this blog post: https://aws.amazon.com/blogs/aws/introducing-amazon-s3-object-lambda-use-your-code-to-process-data-as-it-is-being-retrieved-from-s3/.

As mentioned there you can get the presigned URL from inputS3Url (part of getObjectContext). Will that work for what you're trying to do or if not could you explain more about your use case?

tim-finnigan avatar Sep 08 '22 22:09 tim-finnigan

Since we haven't heard back in a few weeks I'm going to close this issue. If you are still affected by this please refer to the comment above and follow up here. Thanks!

tim-finnigan avatar Oct 14 '22 22:10 tim-finnigan

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Oct 14 '22 22:10 github-actions[bot]

Hi Tim,

The presigned URL mentioned in the blog post is one created by the S3 service when an client request is made to the S3 Object Lambda endpoint. My request is to be able to construct a presigned URL that can be used by the originating client to make a request to a S3 Object Lambda endpoint. In this case I can only do this by using a SDK like boto3 or crafting my own SigV4. My request is to include this feature in AWS CLI

koiker avatar Oct 17 '22 04:10 koiker

Thanks @koiker for following up. There's another recent issue related to this: https://github.com/aws/aws-cli/issues/7350. For now I think we should use that issue to track both feature requests but we can consider reopening this one in the future if necessary.

tim-finnigan avatar Oct 24 '22 14:10 tim-finnigan