Skip to content

feat: add Powertools and fire timer lambda #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { jackInTheCloud } from "./projenrc/jack-in-the-cloud";
import { jimmyTheDeckhand } from "./projenrc/jimmy-the-deckhand";

const depVersions: DepsProperties = {
sdkVersion: "3.609.0",
sdkVersion: "3.679.0",
};

const root = new monorepo.MonorepoTsProject({
Expand Down
6 changes: 4 additions & 2 deletions misfits/jack-in-the-cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

![jack-in-the-cloud](../../assets/jack-in-the-cloud.jpg)

Jack in the Cloud is a service that delivers scheduled notifications. It exposes three operations: `CreateTimer` `UpdateTimer` and `CancelTimer`.
Each `Timer` has a `type`, `payload` and `fireAt` timestamp. Whenever Timer fires (at `fireAt`), `payload` is delivered to target specified during deployment for give `type`.
Jack in the Cloud is a service that delivers scheduled notifications. It offers three operations: `CreateTimer`,
`UpdateTimer`, and `CancelTimer`. Each `Timer` comes with a `type`, `payload`, and `fireAt` timestamp. Whenever a
`Timer` is set to fire (at `fireAt`), the `payload` is delivered to the target specified during deployment for the given
`type`. Target can be anything that can subscribe to SNS topic, so: SQS, Lambda, HTTP endpoint, etc.

## Deployment

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions misfits/jack-in-the-cloud/api/handlers/typescript/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
import { SFNClient } from '@aws-sdk/client-sfn';
import { SNSClient } from '@aws-sdk/client-sns';
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
import { PowerTools } from '@the-band-of-misfits/jimmy-the-deckhand-utils';

const _dynamoDbClient = DynamoDBDocumentClient.from(new DynamoDBClient({}));
const _stepFunctionsClient = new SFNClient({});

export const dynamoDbClient = () => {
return PowerTools.tracer().captureAWSv3Client(_dynamoDbClient);
return PowerTools.tracer().captureAWSv3Client(DynamoDBDocumentClient.from(new DynamoDBClient({})));
};

export const stepFunctionsClient = () => {
return PowerTools.tracer().captureAWSv3Client(_stepFunctionsClient);
return PowerTools.tracer().captureAWSv3Client(new SFNClient({}));
};

export const snsClient = () => {
return PowerTools.tracer().captureAWSv3Client(new SNSClient({}));
};
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import {
MonitoringInterceptor,
PowerTools,
} from '@the-band-of-misfits/jimmy-the-deckhand-utils';
import { dynamoDbClient, stepFunctionsClient } from './aws-clients';
import { dynamoDbClient, snsClient, stepFunctionsClient } from './aws-clients';

const timerService = new TimerService({
machineArn: process.env.MACHINE_ARN!,
tableName: process.env.TABLE_NAME!,
topicArn: process.env.TOPICS_ARN!,
dynamoDbClient: dynamoDbClient,
snsClient: snsClient,
stepFunctionsClient: stepFunctionsClient,
});

Expand Down
Loading
Loading