Skip to content

Instantly share code, notes, and snippets.

@ppshein
Created March 3, 2020 10:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppshein/ad37c0379b6b0c69409ea21ade7d7f8c to your computer and use it in GitHub Desktop.
Save ppshein/ad37c0379b6b0c69409ea21ade7d7f8c to your computer and use it in GitHub Desktop.
Sample serverless.yml file to deploy nodejs application to AWS Lambda and API Gateway
service: my-nodejs-api
custom:
customDomain:
domainName: api.ppshein.com
basePath: ''
stage: ${self:provider.stage}
createRoute53Record: true
provider:
name: aws
runtime: nodejs8.10
stage: dev
region: ap-southeast-1
memorySize: 128
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
Resource: "arn:aws:dynamodb:ap-southeast-1:*:*"
- Effect: Allow
Action:
- s3:*
Resource:
- arn:aws:s3:::mybucket/*
- arn:aws:s3:::mybucket
- Effect: Allow
Action:
- lambda:InvokeFunction
Resource: "*"
functions:
app:
handler: index.handler
events:
- http:
method: any
path: /{proxy+}
cors: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment