Skip to content

Latest commit

 

History

History

share-resources-across-stacks

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

How to share resources across stacks in AWS CDK


Stability: Stable

This is a stable example. It should successfully build out of the box


This example is explained in detail on my blog 👇

This example is used for the blog post on: https://towardsthecloud.com/share-resources-across-stacks-aws-cdk

cdk diagram

How to use this example

git clone git@github.com:dannysteenman/aws-cdk-examples.git

2. Change to this example directory

cd aws-cdk-examples/share-resources-across-stacks

3. Install the dependencies

npm install

4. Synthesize the stacks

To see the Cloudformation template generated by the CDK, run cdk synth, then check the output file in the "cdk.out" directory.

cdk synth

5. Deploy the stacks

Deploy the stacks in the following order:

cdk deploy SharedInfraStack

cdk deploy RdsStack

6. Login to the AWS Console

Go to CloudFormaton in the console to see the stacks you've deployed in your default region.

7. Cleanup

Delete the stacks in the following order

cdk destroy SharedInfraStack

cdk destroy RdsStack

Author

Danny Steenman

  NODES
COMMUNITY 1
Project 1
USERS 1