-
Notifications
You must be signed in to change notification settings - Fork 1.2k
How to Start Using sam sync
Disclaimer: This feature can change at any time based on customer and stakeholder feedback and prioritization activities.
Curious about the feature? Watch the video here.
We are targeting to release an installable public beta of new AWS SAM CLI features soon, but if you want to get your hands dirty, here is how to setup a local virtual environment to test these features.
For the simplicity, we will clone our projects into ~/sam-beta/
folder. Please feel free to change this directory if you prefer some other place.
- Create your project directory and move into it:
mkdir ~/sam-beta && cd ~/sam-beta
- Clone AWS SAM CLI repository into that directory and checkout accelerate branch:
git clone https://github.com/aws/aws-sam-cli.git && cd aws-sam-cli && git checkout accelerate
- Create a python virtual environment into that directory and activate it. Prefer using python3.8.
python -m venv .venv-beta && source .venv-beta/bin/activate
- Install development version of SAM CLI into newly created virtual environment;
make init
- In order to confirm, you can run
samdev --help
and it should display newly createdsam sync
command there.
With the latest improvements in lambda builders, we now support Incremental build for supported runtimes (python, ruby, nodejs). For these runtimes, if you run sam build --cached
it will check if dependencies have been changed, and if not it will use previously downloaded dependencies and update latest version of lambda function code.
So in order to use this new lambda builders with the development version of SAM CLI above;
- Activate previously created virtual environment, if you haven’t yet
cd ~/sam-beta && source .venv-beta/bin/activate
- Clone AWS Lambda Builders into your previously created workspace:
git clone https://github.com/aws/aws-lambda-builders.git && cd aws-lambda-builders
- Install lambda builders into current virtual environment
pip install -e .
- Update lambda builders version in SAM CLI
- Go to folder where SAM CLI is cloned on your local machine
- Open
requiremenents/base.txt
in previously cloned SAM CLI - Update
aws_lambda_builders
version to1.9.0
- Run
make init
- Now
samdev build --cached
andsamdev sync
commands should be using incremental build.
If you have feedback or comments, please leave them in this tracking issue.