Skip to content

Commit

Permalink
Reset serverless.yml to a template
Browse files Browse the repository at this point in the history
  • Loading branch information
JaydenLiang committed Nov 19, 2017
1 parent 8118c59 commit 9a1476c
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
service: forex

#frameworkVersion: ">=1.9.0"
custom:
namespace: ${self:service}-${self:custom.stage}
stage: ${opt:stage, self:provider.stage}

provider:
name: aws
runtime: nodejs4.3
stage: dev
region: us-west-2
environment:
CLIENT_ID: '<YOUR_SLACK_CLIENT_ID>'
CLIENT_SECRET: '<YOUR_SLACK_CLIENT_SECRET>'
VERIFICATION_TOKEN: '<YOUR_SLACK_VERIFICATION_TOKEN>'
INSTALL_ERROR_URL: '<YOUR_SLACK_INSTALL_ERROR_URL>'
INSTALL_SUCCESS_URL: '<YOUR_SLACK_INSTALL_SUCCESS_URL>'
NAMESPACE: ${self:custom.namespace}
TEAMS_TABLE: ${self:custom.namespace}-teams
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:GetItem
- dynamodb:PutItem
Resource:
- arn:aws:dynamodb:*:*:table/${self:provider.environment.TEAMS_TABLE}
- Effect: Allow
Action:
- lambda:invokeFunction
Resource:
- arn:aws:lambda:*:*:function:${self:custom.namespace}-actions

functions:
actions:
handler: actions.handler
install:
handler: install.handler
events:
- http:
path: install
method: get
events:
handler: events.handler
events:
- http:
path: events
method: post

resources:
Resources:
TeamsDynamoDbTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:provider.environment.TEAMS_TABLE}
AttributeDefinitions:
- AttributeName: team_id
AttributeType: S
KeySchema:
- AttributeName: team_id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5

0 comments on commit 9a1476c

Please sign in to comment.