Skip to content

Instantly share code, notes, and snippets.

@afaquejam
Created June 3, 2021 09:23
Show Gist options
  • Save afaquejam/5c8278fa41e0cd60523095b4d1311f7f to your computer and use it in GitHub Desktop.
Save afaquejam/5c8278fa41e0cd60523095b4d1311f7f to your computer and use it in GitHub Desktop.
Example Serverless Service
service: restaurants-service
frameworkVersion: '2'
plugins:
- serverless-bundle
provider:
name: aws
runtime: nodejs12.x
lambdaHashingVersion: 20201221
stage: dev
region: eu-central-1
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:PutItem
Resource: 'arn:aws:dynamodb:*:*:table/solt-restaurants'
functions:
createRestaurantsHandler:
handler: handler.createRestaurantsHandler
memorySize: 512
events:
- http:
path: /restaurants
method: POST
resources:
- Resources:
ShopsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: solt-restaurants
AttributeDefinitions:
- AttributeName: restaurantId
AttributeType: S
KeySchema:
- AttributeName: restaurantId
KeyType: HASH
BillingMode: PAY_PER_REQUEST
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment