
service: lambda
frameworkVersion: ">=1.12.0 <2.0.0"

provider:
  name: aws
  runtime: nodejs6.10
  region: us-west-2
  profile: tab-sls
  stage: dev

# Package each function individually to reduce file sizes.
# https://serverless.com/framework/docs/providers/aws/guide/packaging#packaging-functions-separately
# Relevant Github issues addressing this:
#   https://github.com/serverless/serverless/issues/569
#   https://github.com/serverless/serverless/issues/2709
package:
  individually: true
  exclude:
    - node_modules/**
    - __mocks__/**
    - __tests__/**
    - yarn-error.log


functions:
  hearts:
    handler: hearts/hearts.serverlessHandler
    package:
      include:
        - hearts/**
    events:
      - http:
          path: hearts/
          method: get
          cors: true
          ## TODO: reenable later
          # authorizer:
          #   name: authorizer_${opt:stage, self:provider.stage}
          #   arn:  arn:aws:cognito-idp:us-west-2:167811431063:userpool/us-west-2_9MWuEqLeW 


service: lambda
frameworkVersion: ">=1.12.0 <2.0.0"

provider:
  name: aws
  runtime: nodejs6.10
  region: us-west-2
  profile: tab-sls
  stage: dev
  iamRoleStatements:
    - Effect: "Allow"
      Action:
        - "dynamodb:BatchGetItem"
        - "dynamodb:BatchWriteItem"
        - "dynamodb:DeleteItem"
        - "dynamodb:DescribeReservedCapacity"
        - "dynamodb:DescribeReservedCapacityOfferings"
        - "dynamodb:DescribeTable"
        - "dynamodb:DescribeTimeToLive"
        - "dynamodb:GetItem"
        - "dynamodb:ListTables"
        - "dynamodb:ListTagsOfResource"
        - "dynamodb:PutItem"
        - "dynamodb:Query"
        - "dynamodb:Scan"
        - "dynamodb:UpdateItem"
      Resource: "*"

# Package each function individually to reduce file sizes.
# https://serverless.com/framework/docs/providers/aws/guide/packaging#packaging-functions-separately
# Relevant Github issues addressing this:
#   https://github.com/serverless/serverless/issues/569
#   https://github.com/serverless/serverless/issues/2709
package:
  individually: true
  exclude:
    - node_modules/**
    - __mocks__/**
    - __tests__/**
    - yarn-error.log


functions:
  hearts:
    handler: hearts/hearts.serverlessHandler
    package:
      include:
        - hearts/**
    events:
      - http:
          path: hearts/
          method: get
          cors: true
          ## TODO: reenable later
          # authorizer:
          #   name: authorizer_${opt:stage, self:provider.stage}
          #   arn:  arn:aws:cognito-idp:us-west-2:167811431063:userpool/us-west-2_9MWuEqLeW 

Add IAM role for lambda service.
Add IAM role for lambda service.
