Skip to content

A simple demo to showcase cross-stack reference feature using Serverless Framework on AWS CloudFormation. This demo shows a resource (DynamoDB) created on one Stack #1, while Lambda function on Stack #2 reference the ARN of DynamoDB resource from Stack #1.

License

Notifications You must be signed in to change notification settings

stanykh/serverless-cross-stack-reference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cross-stack deployment

Demonstrate CloudFormation cross-stack deployment where one stack is able to reference to resources created by a different stack.

In this demo there are two stacks:

  1. DynamoDB stack
  2. Lambda function stack

DynamoDB stack will export the value of it's table, while the Lambda function stack will import the value exported by DynamoDB stack.

Deploy

This demo allow both stack to be deployed into any staging environment (dev/staging/prod or etc). Simply use the --stage attribute for deployment. The default was set to dev.

Deploy DynamoDB stack:

$ cd ddb-stack 
$ sls deploy --stage dev

Deploy Lambda stack:

$ cd lambda-stack
$ sls deploy --stage dev

Test

Invoke the lambda function.

sls invoke -f createUser -d '{"email":"anonymous@gmail.com"}' --stage dev

About

A simple demo to showcase cross-stack reference feature using Serverless Framework on AWS CloudFormation. This demo shows a resource (DynamoDB) created on one Stack #1, while Lambda function on Stack #2 reference the ARN of DynamoDB resource from Stack #1.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published