Skip to content

Instantly share code, notes, and snippets.

@dzimine
Last active December 19, 2017 18:26
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 dzimine/79545222f4a4aa1c21e0424fa9d375b1 to your computer and use it in GitHub Desktop.
Save dzimine/79545222f4a4aa1c21e0424fa9d375b1 to your computer and use it in GitHub Desktop.
service: signup-stormless
provider:
name: aws
runtime: python2.7
timeout: 12
memorySize: 128
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:
InviteSlack:
stackstorm:
action: slack.users.admin.invite
input:
email: "{{ input.body.email }}"
first_name: "{{ input.body.first_name }}"
config:
admin: ${file(env.yml):slack}
output:
statusCode: 200
body: "{{ output }}"
RecordAC:
stackstorm:
action: activecampaign.contact_add
input:
email: "{{ input.body.email }}"
first_name: "{{ input.body.first_name }}"
last_name: "{{ input.body.last_name }}"
config: ${file(env.yml):active_campaign}
RecordDB:
handler: record_db/handler.endpoint
resources:
Resources:
UsersDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
AttributeDefinitions:
-
AttributeName: email
AttributeType: S
KeySchema:
-
AttributeName: email
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: ${self:provider.environment.DYNAMODB_TABLE}
plugins:
- serverless-plugin-stackstorm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment