Created
July 3, 2018 07:32
-
-
Save merictaze/70d295e86e9006b98e22c94e12534eb7 to your computer and use it in GitHub Desktop.
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: test-serverless | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: dev | |
environment: | |
DYNAMODB_USER_TABLE: ${self:service}-${opt:stage, self:provider.stage}-Users | |
functions: | |
usersGet: | |
handler: handler.usersGet | |
events: | |
- http: | |
path: '' | |
method: get | |
usersCreate: | |
handler: handler.usersCreate | |
events: | |
- http: | |
path: '/create' | |
method: get # setting the method to GET for testing | |
resources: | |
Resources: | |
UsersTable: | |
Type: AWS::DynamoDB::Table | |
Properties: | |
TableName: ${self:service}-${opt:stage, self:provider.stage}-Users | |
AttributeDefinitions: | |
- AttributeName: email | |
AttributeType: S | |
KeySchema: | |
- AttributeName: email | |
KeyType: HASH | |
ProvisionedThroughput: | |
ReadCapacityUnits: 1 | |
WriteCapacityUnits: 1 | |
plugins: | |
- serverless-dynamodb-local | |
- serverless-offline | |
custom: | |
dynamodb: | |
start: | |
port: 8000 | |
inMemory: true | |
migrate: true # create tables on start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment