Serverless solution for AWS Sandbox
sudo dnf install nodejs
sudo npm i serverless -g
Make sure, that you have an AWS profile configured in ~/.aws/config
[profile production-dmitry_rendov]
role_arn = arn:aws:iam::562495469185:role/dmitry_rendov
region = us-east-1
source_profile = sts
And you have valid STS session (aws-login.sh login) Then configure ENV variables (or update .bash_rc) to enable AWS Profiles with Severless, including IAM cross-account role assumption.
export AWS_SDK_LOAD_CONFIG=1
export AWS_PROFILE="production-dmitry_rendov"
This enables any tool which uses the AWS SDK for Go (e.g. Serverless framework) to use AWS Profiles.
You can just package the Lambda Functions, using the command
sls package
The resulted zip archives will be available in the folder .serverless
Or, you can deploy all the functions and resources, using the command
sls deploy
Install and configure miniconda on your local machine.
Note: can be downloaded via
make setuprun.
Install the dev dependencies and activate conda environment with the following command:
make environment
conda activate aws-sandbox-serverlessNow you can start AWS λ, API Gateway and DynamoDB local with the following command:
sls offline start --stage devAt this point, you can run web application locally with the following command:
sls wsgi serve --stage devCheck that web application is up-and-running by the following link: http://localhost:5000/