Here is the command to deploy the lambda:
$ sam package --template-file sam.yaml --s3-bucket mybucket --output-template-file packaged.yaml
But can I specify a bucket prefix? so it gets deployed to subfolder instead of root of bucket?
In this short post, I will show you how to upload file to AWS S3 using AWS Lambda. We will use Python's boto3 library to upload the file to the bucket. Once the file is uploaded to S3, we will generate a pre-signed GET URL and return it to the client.
To upload folders and files to an S3 bucketSign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to upload your folders or files to. Choose Upload.
You can provide the bucket prefix using --s3-prefix
parameter
$ sam package --template-file sam.yaml --s3-bucket mybucket --s3-prefix path/to/file --output-template-file packaged.yaml
Under the hood sam
is calling aws
command and all the options listed here are valid.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With