Skip to content

Instantly share code, notes, and snippets.

// storePromotions.js
import AWS from "aws-sdk";
const client = new AWS.DynamoDB.DocumentClient();
export const call = async (event, context) => {
const params = {
TableName: process.env.promotionsTable,
Item: {
service: step-functions
plugins:
- serverless-step-functions
- serverless-bundle
provider:
profile: medium
name: aws
runtime: nodejs12.x
// generateProposal.js
"use-strict";
import sample from "lodash/sample";
export const call = (event, context, callback) => {
const roles = [
"Tea Fetcher",
"CEO",
service: step-functions
plugins:
- serverless-step-functions
- serverless-bundle
provider:
profile: medium
name: aws
runtime: nodejs12.x
# serverless.yml
# ...
stepFunctions:
stateMachines:
promotionFlow:
events:
- http:
method: post
// proposePromotion.js
"use-strict";
import sample from "lodash/sample";
export const call = (event, context, callback) => {
const roles = [
"Tea Fetcher",
"CEO",
// email.js
'use-strict'
export const congratulations = (event, context) => {
return "Congrats! You got the job!";
};
export const commiserations = (event, context) => {
return "We're sorry, you weren't lucky this time.";
@owfm
owfm / serverless.yml
Created May 9, 2020 16:18
step-functions-serverless-yml-1
service: step-functions
plugins:
- serverless-step-functions
- serverless-bundle
provider:
profile: medium
name: aws
runtime: nodejs12.x