Triggers a build in circleci when the lambda receives a post request.
Post request to lambda API
curl -X POST <lambda-api>/trigger
Create an AWS user with programmatic access, setup the environment variables.
Setup environment variables required for deployment, by copying and editing the example values.
cp example.env .env
Serverless User
If you already have programmatic access just export the AWS_PROFILE to your shell and deploy
export AWS_PROFILE=<one-of-your-configured-profiles>
Alternatively:
- Sign Up for an AWS account or log in if you already have one.
- In the AWS search bar, search for "IAM".
- On the IAM page, click on "Users" on the sidebar, then the "Add user" button.
- On the Add user page, give the user a name – something like "serverless-contact-form-user" is appropriate. Check "Programmatic access" under Access type then click next.
- On the permissions screen, click on the "Attach existing policies directly" tab, search for "AdministratorAccess" in the list, check it, and click next.
- On the review screen you should see your user name, with "Programmatic access", and "AdministratorAccess", then create the user.
- Locally run:
npm run sls -- config credentials --provider aws --key <AWS_KEY> --secret <AWS_SECRET>
Please use nvm
# Set node version
nvm use
# Install Dependencies
npm install
# Deploy
npm run deploy