https://github.com/warfox/clojure-cdk-example
Clojure CDK example
https://github.com/warfox/clojure-cdk-example
cdk cdk-example cljs clojure
Last synced: 5 months ago
JSON representation
Clojure CDK example
- Host: GitHub
- URL: https://github.com/warfox/clojure-cdk-example
- Owner: WarFox
- License: mit
- Created: 2023-09-07T23:05:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-13T23:32:33.000Z (almost 2 years ago)
- Last Synced: 2025-01-05T13:31:12.557Z (6 months ago)
- Topics: cdk, cdk-example, cljs, clojure
- Language: Clojure
- Homepage:
- Size: 18.6 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+title: Clojure CDK Example
This is an example project for CDK development with Clojure.
The `cdk.json` file tells the CDK Toolkit how to execute your app.
** Stack
This example systhesises an SQS Queue and an SNS Topic and adds a
subscription for the topic** Useful commands
* `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** Multi-Stack deployment
* `cdk deploy StorageStack` deploy the storage stack
* `cdk deploy TopicStack` deploy the topic stack
* `cdk deploy --all` deploy all stacks** How it works
[[https://github.com/weavejester/integrant][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= instancesIntegrant is used to manage the dependencies between them. The following
is the configuration used by the integrant system.#+begin_src clojure
(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)]}})
#+end_srcYou can define more stacks and add them to the =:stacks= vector in =:app/synth=
Refer [[https://docs.aws.amazon.com/cdk/v2/guide/work-with-cdk-java.html#java-running][CDK Java documentation]] for more.
Enjoy!
** License
Copyright © 2023 Deepu Mohan PuthroteDistributed under the MIT License.