Skip to content

Instantly share code, notes, and snippets.

@theburningmonk
Created February 13, 2019 02:19
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 theburningmonk/88f50d37eac03b4e5a55b420975ab00e to your computer and use it in GitHub Desktop.
Save theburningmonk/88f50d37eac03b4e5a55b420975ab00e to your computer and use it in GitHub Desktop.
service: thundra-chaos
provider:
name: aws
runtime: python3.6
timeout: 6
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
Resource:
- Fn::GetAtt: [UsersTable, Arn]
- Fn::GetAtt: [UserPreferencesTable, Arn]
environment:
thundra_apiKey: <enter-your-key-here>
functions:
add-user:
handler: handler.addUser
events:
- http:
path: /user
method: post
get-user-preference:
handler: handler.getUserPreference
events:
- http:
path: /user/{userId}/pref
method: get
# you can add CloudFormation resource templates here
resources:
Resources:
UsersTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: users
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: Id
AttributeType: S
KeySchema:
- AttributeName: Id
KeyType: HASH
UserPreferencesTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: user_preferences
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: Id
AttributeType: S
KeySchema:
- AttributeName: Id
KeyType: HASH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment