Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion blog/graphql/event.json

This file was deleted.

65 changes: 0 additions & 65 deletions blog/graphql/s-function.json

This file was deleted.

3 changes: 0 additions & 3 deletions blog/graphql/s-templates.json

This file was deleted.

7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

import graphql from './blog/graphql/handler'

// Lambda Handler
export default { graphql }

7 changes: 0 additions & 7 deletions s-project.json

This file was deleted.

154 changes: 0 additions & 154 deletions s-resources-cf.json

This file was deleted.

10 changes: 10 additions & 0 deletions serverless.env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
vars: null
stages:
dev:
vars: null
regions:
us-west-2:
vars:
service: serverless-graphql-blog
stage: dev

84 changes: 84 additions & 0 deletions serverless.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
service: "serverless-graphql-blog"
provider: "aws"
plugins:
- serverless-optimizer-plugin
functions:
sadiavas:
handler: "index.graphql"
include:
- blog/
- index.js
events:
- http:
path: "blog/graphql"
method: "POST"

custom:
excludePatterns: []
optimize:
exclude:
- "aws-sdk"
transforms:
-
name: "babelify"
opts:
presets:
- "es2015"

defaults:
stage: "dev"
region: "us-west-2"
memory: 1024
timeout: 6

resources:
Resources:
PostsDynamo:
Type: "AWS::DynamoDB::Table"
DeletionPolicy: "Retain"
Properties:
AttributeDefinitions:
-
AttributeName: "id"
AttributeType: "S"
KeySchema:
-
AttributeName: "id"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: "${service}-posts-${stage}"
AuthorsDynamo:
Type: "AWS::DynamoDB::Table"
DeletionPolicy: "Retain"
Properties:
AttributeDefinitions:
-
AttributeName: "id"
AttributeType: "S"
KeySchema:
-
AttributeName: "id"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: "${service}-authors-${stage}"
CommentsDynamo:
Type: "AWS::DynamoDB::Table"
DeletionPolicy: "Retain"
Properties:
AttributeDefinitions:
-
AttributeName: "id"
AttributeType: "S"
KeySchema:
-
AttributeName: "id"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: "${service}-comments-${stage}"