Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
78 lines (73 sloc) 2.29 KB
service: partymode
custom:
tableName: ${self:service}-${self:provider.stage}
dynamoEndpoint: https://dynamodb.us-west-2.amazonaws.com
snsTopic: ${self:service}-${self:provider.stage}
provider:
name: aws
runtime: java8
stage: ${opt:stage, "dev"}
region: us-west-2
memorySize: 512
timeout: 20
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:Scan
- dynamodb:Query
Resource: arn:aws:dynamodb:${self:provider.region}:*:table/${self:custom.tableName}
- Effect: Allow
Action:
- SNS:Publish
Resource: arn:aws:sns:${self:provider.region}:*:${self:custom.snsTopic}
environment:
DYNAMODB_ENDPOINT: ${self:custom.dynamoEndpoint}
DYNAMODB_TABLE_NAME: ${self:custom.tableName}
MY_NUMBER: ${env:MY_NUMBER}
CALLBOX_NUMBER: ${env:CALLBOX_NUMBER}
BOT_TOKEN: ${env:BOT_TOKEN}
BOT_NAME: ${env:BOT_NAME}
SNS_TOPIC: { "Fn::Join" : ["", ["arn:aws:sns:${self:provider.region}:", { "Ref" : "AWS::AccountId" }, ":${self:custom.snsTopic}" ] ] }
TWILIO_AUTH_TOKEN: ${env:TWILIO_AUTH_TOKEN}
package:
artifact: build/libs/${self:service}.jar
functions:
call-handler:
handler: com.merricklabs.partymode.handlers.CallHandler
events:
- http:
path: call
method: post
slack-handler:
handler: com.merricklabs.partymode.handlers.SlackMessageHandler
events:
- http:
path: slack/event
method: post
# The following makes this endpoint async, so it immediately
# returns 200 while the Lambda is still processing.
# Otherwise Slack will retry messages which results in duplicate responses.
async: true
resources:
Resources:
RidesDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
- AttributeName: start_time
AttributeType: S
KeySchema:
- AttributeName: start_time
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:custom.tableName}
SNSTopic:
Type: AWS::SNS::Topic
Properties:
DisplayName: ${self:custom.snsTopic}
TopicName: ${self:custom.snsTopic}
You can’t perform that action at this time.