Created
June 3, 2021 09:23
-
-
Save afaquejam/5c8278fa41e0cd60523095b4d1311f7f to your computer and use it in GitHub Desktop.
Example Serverless Service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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