Home > other >  Upload file to Amazon S3 with access key and secret, without using SDK
Upload file to Amazon S3 with access key and secret, without using SDK

Time:01-26

Is there an S3 endpoint which will take the access key, secret, and the file in the body, and then accept the file upload? I would rather not import the entire AWS SDK for just minimal operations.

My use case: I have an AWS lambda function which uploads files to S3. At the moment, I use the AWS SDK for the file upload, but this makes the lambda function package size larger than actually required, since I need to upload aws-sdk npm package along with my code.

CodePudding user response:

Is there an S3 endpoint which will take the access key, secret, and the file in the body, and then accept the file upload? I would rather not import the entire AWS SDK for just minimal operations.

You never pass the access key and secret directly to the AWS API. You have to sign your requests with the key and secret. It is much easier to use the SDK than write custom request signing code.

However, the AWS SDK is included in the AWS Lambda runtime environment. You don't need to upload the SDK as part of your Lambda function deployment unless you need a different version of the SDK than the one provided in the runtime environment.

CodePudding user response:

Yes! here is the AWS S3 official RestAPI documentation AWS s3 restAPI docs

  • Related