Skip to content

LambdaSharp/ServerlessPatterns-ServiceComposition

Repository files navigation

Service Composition

This repository shows how services can be composed by importing values from deployed CloudFormation stacks.

BitcoinTopic

The BitcoinTopic module creates a Lambda function that publishes the most recent bitcoin price on an SNS topic. The SNS topic is exported from the CloudFormation stack so that other stacks can subscribe to it.

BitcoinTable

The BitcoinTable module creates a Lambda function that subscribes to the SNS topic from the BitcoinTopic stack and stores the received value in a DynamoDB table. Stored values are automatically forgotten after 15 minutes to minimize the number of stored rows. The DynamoDB table is exported for other stacks to query against.

BitcoinActivity

The BitcoinActivity module creates a REST API for recording buy/sell activity. It imports the table from the BitcoinTable stack to fetch the most recently recorded price.

A Postman collection is provided to easily interact with the REST API.

Deploy

lash deploy BitcoinTopic BitcoinTable BitcoinActivity

About

This repository shows how services can be composed by importing values from deployed CloudFormation stacks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages