This project is an example to show how to manipule multiple files in AWS S3. The idea happening when I needed to work with multiples files simultaneously. AWS SAM based application.
- app - Code for the application's Lambda function.
- events - Invocation events that you can use to invoke the function, in this case, a S3 object.
- tests - Unit tests for the application code.
- template.yaml - A template that defines the application's AWS resources, generated automatically with sam init.
The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.
To use the SAM CLI, you need the following tools.
- SAM CLI - Install the SAM CLI
- [Python 3 installed]
- Docker - Install Docker community edition
To build and deploy your application for the first time, run the following in your shell:
sam build
sam deploy --guided
Build your application with the sam build
command.
sam-app$ sam build
The SAM CLI installs dependencies defined in hello_world/requirements.txt
, creates a deployment package, and saves it in the .aws-sam/build
folder.
Test a single function by invoking it directly with a test event. An event is a JSON document that represents the input that the function receives from the event source. Test events are included in the events
folder in this project.
Run functions locally and invoke them with the sam local invoke
command.
sam-app$ sam local invoke HelloWorldFunction --event events/event.json