Skip to content

Coming from CDK, SAM or CloudFormation

llms.txt lists every page for a coding agent.

Optional: hand this page to your coding agentThe steps work by hand too.
Show the prompt
Read https://intentius.io/loomster/guides/coming-from-cdk-or-sam/ and walk the person through one component in this checkout: its composite in src/composites/, its component in src/components/, and the template `npm run synth` writes for it.
Run `npm run synth` and `chant lint .` and report the results.
Never run `chant approve` or `just grant`, never deploy to or delete from a real AWS account unless the person asked for that in this session, never register an identity provider in Loom, and never push or edit the `chant/lifecycle` branch.

A map from CDK, SAM and raw CloudFormation to loomster’s chant source, so you can read a composite, change a parameter and deploy.

npm install
npm run synth # writes dist/<component>.template.json

Every file in dist/ is a plain CloudFormation template, the same output CDK and SAM produce.

To do thisCDKSAM or CloudFormationloomster
Define infrastructurea Stack class and constructstemplate.yamla composite in src/composites/, wrapped as a component in src/components/
Reuse a patternan L3 constructa nested stack or a modulea composite with props
Synthesizecdk synthsam buildnpm run synth, or chant build src/<stack> --lexicon aws
Deploy one stackcdk deploy Stacksam deploynpx chant run --components <name>
Deploy everything in ordercdk deploy --alla script or pipeline you writenpx chant run --components all
Pass values between stacksprops or Fn.importValueoutputs copied into parametersstackOutput("<component>", "<output>")
Parameterizecontext in cdk.json--parameter-overrides, samconfig.tomlbuild parameters in chant.config.ts, set by LOOM_* variables
Separate environmentsa Stage, the env of a stacksamconfig environmentsLOOM_ENV and LOOM_INSTANCE in every name and stack name
Preview a changecdk diffa change setchant lifecycle diff --live, or npm run watch
Lintcdk-nagcfn-lintchant lint ., with loomster’s own rules in .chant/rules/
Unit testaws-cdk-lib/assertionsvitest over the composites (npm test)
Deletecdk destroysam deletechant run loom-teardown, gated
PipelineCDK Pipelinessam pipeline initgenerated GitHub, GitLab and Forgejo pipelines (Add CI to your forge)
Bootstrap an accountcdk bootstrapan artifact bucketnone for the templates; images go to the stack’s own ECR repositories
  • chant evaluates source at build time and never at deploy time. Its lint (EVL001 to EVL004) refuses property values it can’t reduce statically, so a composite reads like data, not a program that runs during deploy.
  • There is no CDK runtime, no asset bucket and no bootstrap stack. A template is synthesized once and applied as is.
  • Stack names carry {project}-{env}-{instance}, so two deployments never collide (Tiers and instances).
  • Physical names come from one helper, loomNaming, and lint rule LOOM001 rejects a hard-coded one (Naming and tagging).
  • Day-2 work is Ops with approval gates recorded in git, not scripts beside the app.
  • CloudFormation still holds the state, as with CDK and SAM.
Not hereIn CDK or SAMloomster’s ruleDo this instead
Runtime logic in the infrastructure code (loops over API calls, lookups at synth)Vpc.fromLookup, custom code in synththe template depends only on source and parameterspass ids as build parameters (Provision, reference or omit)
Deploying from a laptop as the normal pathcdk deployproduction deploys go through your change processthe gated deploy.yml, after a first run you do by hand