Skip to content

Instantly share code, notes, and snippets.

@codepreneur
Last active October 24, 2016 08:54
Show Gist options
  • Save codepreneur/690a2f4b07af9ffc73f242855d4b749a to your computer and use it in GitHub Desktop.
Save codepreneur/690a2f4b07af9ffc73f242855d4b749a to your computer and use it in GitHub Desktop.

Revisions

  1. codepreneur revised this gist Jul 4, 2016. 1 changed file with 0 additions and 16 deletions.
    16 changes: 0 additions & 16 deletions serverless.yaml
    Original file line number Diff line number Diff line change
    @@ -9,22 +9,6 @@ functions:
    - http:
    path: "blog/graphql"
    method: "POST"
    type: "AWS"
    authorizationType: "none"
    authorizerFunction: false
    apiKeyRequired: false
    requestParameters: {}
    requestTemplates:
    application/json: "{\"query\" : $input.json(\"$\")}"
    responses:
    400:
    statusCode: "400"
    default:
    statusCode: "200"
    responseParameters: {}
    responseModels: {}
    responseTemplates: {}
    application/json: ""

    custom:
    excludePatterns: []
  2. codepreneur created this gist Jul 3, 2016.
    96 changes: 96 additions & 0 deletions serverless.yaml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,96 @@
    service: "sadiavasio"
    provider: "aws"
    functions:
    sadiavas:
    handler: "index.graphql"
    include:
    - blog/
    events:
    - http:
    path: "blog/graphql"
    method: "POST"
    type: "AWS"
    authorizationType: "none"
    authorizerFunction: false
    apiKeyRequired: false
    requestParameters: {}
    requestTemplates:
    application/json: "{\"query\" : $input.json(\"$\")}"
    responses:
    400:
    statusCode: "400"
    default:
    statusCode: "200"
    responseParameters: {}
    responseModels: {}
    responseTemplates: {}
    application/json: ""

    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}"