Skip to content

Instantly share code, notes, and snippets.

@bjclark13
Created June 6, 2019 00:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjclark13/6ed31b6f976dd54c71095df5a47334a6 to your computer and use it in GitHub Desktop.
Save bjclark13/6ed31b6f976dd54c71095df5a47334a6 to your computer and use it in GitHub Desktop.
service: feature-toggling
provider:
name: aws
runtime: nodejs10.x
stage: dev
region: us-east-1
iamManagedPolicies:
- 'arn:aws:iam::aws:policy/AmazonDynamoDBFullAccess'
environment:
FEATURES_TABLE: ${self:service}-features-${opt:stage, self:provider.stage}
functions:
features:
handler: handler.features
events:
- http:
path: features
method: GET
cors: true
admin-features:
handler: handler.allFeatures
events:
- http:
path: admin-features
method: GET
cors: true
featureDelete:
handler: handler.deleteFeature
events:
- http:
path: features
method: DELETE
cors: true
featuresPost:
handler: handler.featuresPost
events:
- http:
path: features
method: POST
cors: true
timeout: 30
resources:
Resources:
DevotionalsTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
-
AttributeName: name
AttributeType: S
KeySchema:
-
AttributeName: name
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 10
WriteCapacityUnits: 1
TableName: ${self:provider.environment.FEATURES_TABLE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment