This is an example project for CDK development with Clojure.
The `cdk.json` file tells the CDK Toolkit how to execute your app.
This example systhesises an SQS Queue and an SNS Topic and adds a subscription for the topic
- `clj -M:test` Run Tests
- `cdk ls` list all stacks in the app
- `cdk synth` emits the synthesized CloudFormation template
- `cdk deploy` deploy this stack to your default AWS account/region
- `cdk diff` compare deployed stack with current state
- `cdk docs` open CDK documentation
- `cdk deploy StorageStack` deploy the storage stack
- `cdk deploy TopicStack` deploy the topic stack
- `cdk deploy –all` deploy all stacks
Integrant is the main tool behind this setup, it manages the dependencies between resources and stacks, by using a simple configuration map {}
CDK Java depends on software.amazon.awscdk.App
instance and related
software.amazon.awscdk.Stack
instances
Integrant is used to manage the dependencies between them. The following is the configuration used by the integrant system.
(def config
{:app/instance {}
:stacks/topic {:app (ig/ref :app/instance)
:stack-id "TopicStack"}
:stacks/storage {:app (ig/ref :app/instance)
:stack-id "StorageStack"}
:app/synth {:app (ig/ref :app/instance)
:stacks [(ig/ref :stacks/topic)
(ig/ref :stacks/storage)]}})
You can define more stacks and add them to the :stacks
vector in :app/synth
Refer CDK Java documentation for more.
Enjoy!
Copyright © 2023 Deepu Mohan Puthrote
Distributed under the MIT License.