Skip to content

Instantly share code, notes, and snippets.

@rhlsthrm
Created March 15, 2017 00:33
Show Gist options
  • Save rhlsthrm/f80fa6673888b0b948deeaf1c3bcb33e to your computer and use it in GitHub Desktop.
Save rhlsthrm/f80fa6673888b0b948deeaf1c3bcb33e to your computer and use it in GitHub Desktop.
service: bittman
provider:
name: aws
runtime: nodejs4.3
environment:
DYNAMODB_TABLE: ${self:service}-${opt:stage, self:provider.stage}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:provider.environment.DYNAMODB_TABLE}"
functions:
hello:
handler: handler.hello
calculateVolatility:
handler: calculateVolatility/handler.calculate
include:
- calculateVolatility/**
- node_modules
events:
- http: GET calculate
- schedule: cron(30 21 ? * WED *)
calculateTriggers:
handler: calculateTriggers/handler.calculate
include:
- calculateTriggers/**
- node_modules
events:
- http: GET triggers
- schedule: cron(31 14 ? * THU *)
resources:
Resources:
BittmanDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
-
AttributeName: id
AttributeType: S
KeySchema:
-
AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:provider.environment.DYNAMODB_TABLE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment