-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
122 changed files
with
53,691 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
|
||
# Build Frontend | ||
cd frontend && npm i && npm run build && cd .. && pwd | ||
|
||
# Build Created Trigger | ||
cd created-trigger && npm i && npm run compile && cd .. | ||
|
||
# Build Step Functions | ||
cd step-functions/functions/automate-sign-up && npm run compile && cd .. | ||
cd manual-sign-up && npm run compile && cd .. | ||
cd validate-complete && npm run compile && cd .. | ||
cd validate-sign-up && npm run compile && cd ../../.. | ||
|
||
# Build Email Handlers | ||
cd email-handlers/register-message-to-dynamodb/ && npm run compile && cd ../.. | ||
|
||
# Deploy | ||
|
||
cd infra/cdk && npx cdk deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { DynamoDBStreamEvent } from "aws-lambda"; | ||
import { Logger } from '@aws-lambda-powertools/logger'; | ||
import { DynamoDB, StepFunctions } from "aws-sdk"; | ||
|
||
const { STEPFUNCTION_ARN } = process.env; | ||
|
||
const stepFunctions = new StepFunctions({ apiVersion: '2016-11-23' }) | ||
const logger = new Logger({ serviceName: 'createdServiceLambda' }); | ||
|
||
export async function handler(event: DynamoDBStreamEvent): Promise<void> { | ||
const receivedEvents = event.Records | ||
.map(it => DynamoDB.Converter.unmarshall(it.dynamodb?.NewImage!)) | ||
|
||
logger.info(`Received Events ${JSON.stringify(receivedEvents)}`); | ||
|
||
const promiseStepfunctionsStart = receivedEvents.map(it => stepFunctions.startExecution({ stateMachineArn: STEPFUNCTION_ARN!, input: JSON.stringify(it) }).promise()) | ||
await Promise.all(promiseStepfunctionsStart); | ||
|
||
return; | ||
} |
Oops, something went wrong.