Skip to content

Instantly share code, notes, and snippets.

@raysrashmi
Created June 21, 2018 12:21
Show Gist options
  • Save raysrashmi/585e90a1610f19fc640928fd109c279b to your computer and use it in GitHub Desktop.
Save raysrashmi/585e90a1610f19fc640928fd109c279b to your computer and use it in GitHub Desktop.
service: social-feeds
provider:
name: aws
runtime: nodejs8.10
stage: dev
region: eu-west-1
environment:
SOCIAL_FEED_TWITTER_TABLE: "twitter-feed-${self:service}-${opt:stage, self:provider.stage}"
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
Resource: "*"
resources:
Resources:
SocialFeedsDynamoDbTable:
Type: "AWS::DynamoDB::Table"
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
-
AttributeName: "id"
AttributeType: "S"
KeySchema:
-
AttributeName: "id"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
StreamSpecification:
StreamViewType: "NEW_AND_OLD_IMAGES"
TableName: ${self:provider.environment.SOCIAL_FEED_TWITTER_TABLE}
functions:
fetchFeeds:
handler: src/handler.fetchFeedsFn
events:
- schedule:
rate: rate(10 minutes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment