Skip to content

Template for initiating AWS API Gateway with Lambda and DynamoDB

License

Notifications You must be signed in to change notification settings

vtcaregorodtcev/aws-rest-api-template

Repository files navigation

API Gateway Lambda Template

How to use?

You need an AWS account to have access to AWS console.

  1. Click "Access keys (access key ID and secret access key)" tab and create Id and Key
  2. Create or update ~/.aws/config and ~/.aws/credentials on your machine to setup profile with secrets which you got on the first step.
# ~/.aws/config

[rest-dev] # or rest-prod, configured in sls/profiles, applied from serverless.yml/stage
region = us-west-1 # or whatever you prefer
output = json
# ~/.aws/credentials

[rest-dev] # or rest-prod, configured in sls/profiles, applied from serverless.yml/stage
aws_access_key_id=YOUR_ID
aws_secret_access_key=YOUR_KEY
  1. Then deploy.
pnpm run deploy
  1. After deploy you can check your api services under your AWS account and test endpoints.
  2. If you want to use preconfigured profiles or other regions you can extend above command.
PROFILE=local REGION=us-west-2 pnpm run deploy