/cdkd-skills:cdkdfrom cdkd-skills
Installs and safely uses cdkd for rapid AWS CDK iteration in dev/test environments. Handles bootstrapping, synthesis, diff, deploy, rollback, migration, and stack teardown with safety checks.
Ships in cdkd-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use cdkd for rapid iteration in development and test environments. It complements the AWS CDK CLI; it is not the default production deployment engine.
Before installing or upgrading, verify the current release and runtime requirement from the npm registry:
npm view @cdkd/cli version engines --json
cdkd requires Node.js 22.12 or later. If the user asks to install it, prefer an explicit version so the action is reproducible:
npm install --global @cdkd/cli@'<version>'
cdkd --version
Do not silently upgrade an existing installation during an unrelated deployment.
Before any AWS-changing command:
Read the CDK project's cdk.json, package scripts, stack definitions, and local instructions.
Identify the AWS profile, account ID, region, CDK app, named stack, and environment classification.
Verify the active identity explicitly:
AWS_PROFILE='<profile>' AWS_REGION='<region>' aws sts get-caller-identity
State the resolved account, region, stack, and intended operation before proceeding.
Confirm that the credentials have direct permissions for every deployed resource. cdkd calls AWS service APIs directly; the CDK bootstrap deploy role alone is not sufficient.
Keep these ownership rules:
cdkd deploy against an existing CloudFormation-managed stack as an implicit migration. Continue using cdk deploy, or plan an explicit cdkd import --migrate-from-cloudformation operation.cdkd import, cdkd export, cdkd orphan, cdkd state orphan, and cdkd refactor as changes to the system of record. Explain the ownership change and obtain explicit confirmation before running them.To stop managing something WITHOUT deleting it from AWS, orphan it: cdkd orphan '<stack/ConstructPath>' drops one resource from cdkd state (the AWS resource stays), cdkd state orphan '<stack>' --resource <logicalId> drops one resource's record without the CDK app (also for a resource whose construct is already gone from the template), and cdkd state orphan '<stack>' removes the whole stack's state record (all AWS resources stay) — never run that bare form on a stack that is still deployed, since the next deploy re-creates or collides with every resource. Remove the corresponding construct from the CDK app in the same change — otherwise the next cdkd deploy re-creates what the template still declares.
For a proposed CloudFormation migration, read the deployed CloudFormation template and compare its logical IDs with the current synthesized template so local changes do not accidentally leave retained resources unmanaged. Preview resource matching with the non-migrating form:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd import '<stack>' --dry-run
--migrate-from-cloudformation itself is intentionally incompatible with --dry-run: it writes cdkd state, adds retain policies, and retires the CloudFormation stack record. Do not bootstrap, import, or migrate until the user approves that ownership-change plan.
A cdkd-deployed stack can consume values from a producer stack that stays managed by CloudFormation (cdk deploy): when an Fn::ImportValue or Fn::GetStackOutput reference is not found in cdkd state, cdkd falls back to CloudFormation (ListExports / stack outputs). Use this for the common split — shared infrastructure stays on the CDK CLI while dev/test app stacks deploy via cdkd — WITHOUT migrating or re-deploying the producer. Keep these boundaries:
cloudformation:ListExports and cloudformation:DescribeStacks for the fallback. Without them cdkd logs a warning and fails with the ordinary not-found error.--no-cfn-fallback on cdkd deploy / cdkd diff when the user wants cdkd-state-only resolution (minimal IAM, or fail-fast on export-name typos).Have cdkd synthesize the app:
cdkd synth
cdkd synth validates the synthesized app and does not accept a stack selector.
If it fails, isolate the cause by running the project's normal synthesis (cdk synth or the project's own build/test scripts): if that also fails, fix the CDK app first; if it succeeds, the difference is a cdkd issue worth reporting upstream.
Check supported resources and any property-level preflight errors before deployment. Do not add --allow-unsupported-properties merely to bypass a security-relevant encryption, IAM, networking, or TLS warning.
For a new cdkd-managed stack, bootstrap cdkd once per target AWS account after the preflight checks:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd bootstrap
Skip this when deploying into AWS Emulator: under --aws-emulator, cdkd deploy bootstraps the emulator itself (see Against AWS Emulator).
This creates cdkd's S3 state storage, cdkd-owned asset storage and a per-region HMAC KMS key (alias/cdkd-noecho-mac); with kms:GenerateMac on that key, a deploy re-sends a write-only property fed by a NoEcho parameter only when the value changed, for a property that reads nothing but NoEcho parameters and literals, or whose other inputs (a resource attribute, a plain parameter) resolve to what they were when it was last sent (an input cdkd cannot resolve, or no key, re-sends it every deploy, as before). Re-run cdkd bootstrap on an older account to add the key. A stack whose state then records such a MAC is written as state schema 17, which an older cdkd refuses, so upgrade every machine that deploys it together. It does not replace or remove the normal CDK bootstrap resources. The current default state bucket is account-scoped; older region-suffixed buckets are handled as a legacy layout. Use a custom --state-bucket or CDKD_STATE_BUCKET only when the project has an intentional isolation or naming requirement. A different bucket or --state-prefix separates records, not deployments: a stack name is one deployment per account and region, as in CloudFormation, so never deploy the same stack name under two buckets or prefixes in one account and region (unsupported; within one bucket cdkd refuses it, and in any bucket it refuses a create that would take over the other deployment's resource). To run two copies of an app, give their stacks different names.
Use an explicit stack name when more than one stack exists or whenever ambiguity would be risky:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd diff '<stack>'
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd deploy '<stack>' --dry-run
Review the complete plan for replacements, deletions, IAM changes, unsupported properties, retained resources, and state-bucket selection. Do not hide confirmation prompts with --yes or force flags by default.
To check mechanically whether the change would lose an existing resource, run the diff with --fail-on=destructive. It exits 1 when a change replaces, deletes, or orphans an existing resource (always walking nested stacks), and lists each one after the diff; additions and in-place updates exit 0. Exit 3 means cdkd deploy would refuse the stack regardless, and takes precedence over the list. On exit 1 with listed resources, show them to the user and get explicit confirmation before deploying; exit 1 with no list means the command itself failed. A listed replacement whose line ends so a failed deploy's rollback does not restore what AWS held for it beyond its recorded properties deletes the old resource before the deploy succeeds; tell the user its contents (queued messages, subscriptions made outside the stack) cannot come back if the deploy fails:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd diff '<stack>' --fail-on=destructive
When a listed deletion is a renamed or moved construct — an old logical ID deleted and a new logical ID of the same type created, in the same stack or in another stack of the same account and region — keep the resource instead of letting the deploy replace it. Run cdkd refactor BEFORE deploying: it renames the resource's cdkd state record and touches no AWS resource. Show the dry-run plan to the user and get confirmation first:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd refactor '<stack>' --dry-run
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd refactor '<stack>'
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd diff '<stack>' --fail-on=destructive
It renames a pair only when the new resource then shows no change. Look-alikes it cannot tell apart (two identical queues) make it refuse and print a mapping file; ask the user which old logical ID is which new one, write that file, and pass it with --override-file. A resource whose properties also changed is refused: revert the property change, refactor, deploy, then reapply the property change. For a move between stacks, select both stacks (cdkd refactor '<source>' '<destination>'); the destination must already be deployed, and it must be deployed before the stacks that import from it. If cdkd deploy or cdkd destroy refuses because a cdkd refactor "did not finish", an earlier refactor was interrupted mid-move: run cdkd refactor '<that stack>' to finish it, and never edit the state to get past the refusal.
--fail-on takes any-change, broadening (an IAM or security-group change that grants something new), destructive, or never (default); --fail / --no-fail are aliases for any-change / never.
cdkd deploy --require-approval=destructive (or broadening / any-change) makes the deploy itself ask after the diff and before changing the stack; it is also read from "requireApproval" in cdk.json, where "broadening" (the AWS CDK CLI's default) is honoured. It asks only on a terminal: without one — an agent's non-interactive shell, or CI — that stack's deploy fails instead of asking. That failure is not "nothing changed" for the whole run: a nested stack is asked only when its parent's deploy reaches it, so the parent may already have changed and then rolls back (or keeps the changes under --no-rollback), and other stacks in the same run that do not depend on it still deploy. Treat the failure as the stop it is: check cdkd state show / cdkd events for what did change, report the destructive changes to the user, and do not add --yes (which approves without asking) unless the user approved that exact scope.
For an ordinary development deployment:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd deploy '<stack>'
Choose the wait mode from what happens after deployment:
--full-wait: use before smoke tests, DNS cutovers, or follow-on jobs that require CloudFormation-like completion: it adds the waits the default skips, a CloudFront distribution reaching Deployed and a Multi-AZ RDS DB cluster reaching available after an instance class or storage change (a storage optimization can take hours: pair it with --resource-timeout AWS::RDS::DBCluster=<n>h).--no-wait: use only when the user accepts background stabilization and nothing immediately depends on completion. Never combine it with --full-wait.For example, a deploy followed by a website smoke test should use:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd deploy '<stack>' --full-wait
cdkd refactor '<stack>' --dry-run
Do not report success solely because resources appeared in AWS. Require a zero command exit status and complete the relevant verification.
After deployment, inspect cdkd's state and recorded deployment events:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd state info
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd state show '<stack>' --stack-region '<region>'
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd events '<stack>' --stack-region '<region>'
cdkd state browse is an interactive picker for a person at a terminal; without one it refuses (exit 1), so read state with cdkd state list, cdkd state resources and cdkd state show instead, and suggest cdkd state browse to a user who wants to look around themselves.
Also verify the stack outputs, the critical AWS resource state, and an application-level smoke test when applicable. Treat a non-zero exit as an unsuccessful command, but interpret it per command: exit 1 normally indicates failure, while diff --fail / diff --fail-on and drift also use it to report detected changes; exit 2 indicates partial failure for commands that support it. Inspect state and events, then follow the command-specific recovery guidance.
For an interrupted or failed deployment:
cdkd events '<stack>'.cdkd state show '<stack>' before retrying.cdkd rollback '<stack>' for a failed --no-rollback or interrupted deployment when rollback is appropriate.cdkd force-unlock '<stack>' only after proving no deployment is still running.cdkd drift '<stack>' compares each managed resource's live AWS configuration against cdkd state (state-driven; no synth) and exits 1 when drift is detected. Reconcile in one of two explicit directions:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd drift '<stack>' # detect only
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd drift '<stack>' --accept # state <- AWS (keep the live change)
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd drift '<stack>' --revert # AWS <- state (undo the live change)
--accept and --revert are mutually exclusive; both honor --dry-run. --revert changes live AWS resources — treat it as a destructive operation (see below).
cdkd resolves CloudFormation dynamic references ({{resolve:secretsmanager:...}}) and, on the DEPLOY path, stores the UNRESOLVED expression rather than the resolved plaintext, so the value does not land in the state.json a deploy writes, nor in cdkd state show, cdkd diff, or cdkd drift output for such a record. A normal cdkd deploy already scrubs state this way as a side effect. That describes what the deploy path is designed to do; it is NOT a guarantee about state.json. The redaction substitutes only at positions it can certify against the template, and where it cannot — a reshaped container, an identity key AWS normalised, a bag refreshed with no recorded secrets to match on — it leaves the value it was handed, and that configuration is reachable on the deploy path itself through the observed-properties refresh of an unchanged resource. Other commands widen it further: cdkd state refresh-observed when the stored properties hold a raw intrinsic shape rather than the reference as a string, and cdkd import for the attributes bag it captures from a live read.
That is a statement about what cdkd WRITES. The state bucket is versioned, so a write SUPERSEDES a plaintext version an older binary already wrote rather than erasing it: the earlier body stays readable with GetObject and a VersionId. A deploy's implicit scrub never purges those versions (they are the state-recovery history). A real cdkd scrub purges the earlier versions of each state.json it rewrites (and of the exports index it rewrites); cdkd scrub --purge-history also purges them for every record it examines and does not refuse, rewritten or not — the way to clear what a deploy left behind. Both need s3:ListBucketVersions and s3:DeleteObjectVersion, and warn rather than fail without them; a replicated bucket keeps its replica's copies. A green --dry-run --fail gate therefore means the CURRENT object holds no plaintext of a value the template names through a {{resolve:...}} reference, and nothing more — treat any value ever persisted in plaintext as compromised and ROTATE it. A secret the template never references (one an operator set out of band over a placeholder literal, or a key of a Cloud Control model) is recorded in the observedProperties drift baseline (and, for a Cloud Control resource, in attributes) as AWS returned it, BY DESIGN, and scrub cannot see it, since it learns a secret's value only by resolving a reference; so state.json is sensitive by construction. Likewise, a physical name DERIVED from a secret (a {{resolve:...}} reference or a NoEcho parameter in a name or other identifier property, e.g. an SQS QueueName) is the resource's identity: it is stored in plaintext in that resource's physicalId, in other resources' resolved Ref / Fn::GetAtt / Fn::Sub copies of it (or of an identifier embedding it), in the stack outputs and exports index entries that carry it, in the rollback journal and an orphans record, and in a deployment event's physicalId field; scrub rewrites neither the physical id nor other resources' copies and reports those records clean (an undeclared leftover output, or another resource's orphans record (its stored bags, not its physical id), that holds or embeds the secret's resolved value is rewritten; otherwise an undeclared output is dropped or kept and reported like any undeclared key; a leftover exports index entry is reported when it holds a recorded secret's value), and logs, cdkd diff output and deployment event text mask it only where cdkd recognises the read (an unrecognised read prints it, which is a bug to report; cdkd state show / cdkd events print it as stored) — as in CloudFormation, which advises keeping dynamic references out of identifier properties (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html). Removal is in A value your template never references is recorded as AWS holds it.
cdkd scrub '<stack>' is the permanent state secret-hygiene command — clean and audit, not incident-only tooling. It synthesizes the app to learn which values are secrets, then rewrites the state record so each plaintext secret becomes its {{resolve:...}} expression, WITHOUT a redeploy. It mutates no AWS resource, but it is not read-only: a real run writes state.json, takes and releases the stack lock, and — for an export the stack owns whose indexed value has diverged from the {{resolve:...}} expression now in state — patches the region-wide cross-stack exports index, then purges the earlier versions of what it rewrote. --dry-run writes and purges none of them, and cannot be combined with --purge-history. Scrubbing a stack also scrubs every nested stack under it (a nested stack cannot be named on its own; name its parent). Use it to clean state written by an older cdkd, and use --dry-run --fail as a STANDING CI gate that continuously asserts no value the template names through a {{resolve:...}} reference lives in state as plaintext (a physical name derived from one aside, except in an output or exports index entry the template no longer declares) (secrets landing in IaC state is a structural, recurring concern, so it is worth checking on every build rather than once).
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd scrub '<stack>' # scrub in place
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd scrub '<stack>' --dry-run # report only, no write
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd scrub '<stack>' --dry-run --fail # CI gate: exit 1 on any finding
--fail exits 1 for a finding scrub cannot REMEDY as well as for plaintext it
can — a state KEY holding a secret, a cross-stack read cdkd declines to perform,
a cross-stack read NAME still holding a secret's value from before a rotation,
while the template still reads a secret-bearing name of that shape (scrub matches only the current value, so it reports that name without printing
it and cannot rewrite it; a deploy that updates the stack does), and a record
whose {{resolve:...}} scan was ABANDONED because a reference did
not resolve (a deleted SSM parameter, a secret with no SecretString). The last
one matters most as a gate result: the resolver stops at the first failing token,
so a real secret AFTER it in the same value was never fetched, recorded no
needle, and would otherwise have let the stack report clean. Each such record is
named in a warning; resolve the reference and re-run.
Not every abandoned scan raises the exit code. A scan stopped by something scrub
cannot bind with template defaults alone — an unresolvable Ref / Fn::GetAtt,
a parameter with no Default, or a reference whose own argument holds a
${...} no Fn::Sub substitutes — is WARNED but does not fail --fail,
because a gate failure there could not be cleared. An Fn::Sub placeholder that
names no resource or parameter of the template, kept inside a {{resolve:...}}
reference, DOES fail it: fixing the template clears it. So a green --dry-run --fail does not by
itself mean every record was examined: read the warnings, since a record cdkd
could not certify may still hold a plaintext written by an older binary.
Scrub DROPS a stored output key today's template no longer declares whose value it cannot identify (a deleted output's leftover), naming the key but never its value, so --dry-run --fail also exits 1 until a real scrub or a deploy removes it. It keeps such a key when it may be a live export alias whose name scrub could not reproduce, and when another stack's state still records reading it — both are findings, so --fail exits 1; when the other stacks' state cannot be read it drops nothing and exits 2.
Scrubbing needs the CDK app (--app / CDKD_APP / cdk.json) because state records the resolved value with no marker of which values are secrets — only the template carries the references. Scrub only stops a plaintext secret being re-read out of state going forward; rotating it in Secrets Manager is what retires it.
cdkd destroy keeps content-addressed assets (another stack or a rollback may use them), so asset storage grows. cdkd gc deletes only assets no state file references, one region per invocation, and never touches CDK's own bootstrap storage:
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd gc --dry-run # print the reclaim plan first
AWS_PROFILE='<profile>' AWS_REGION='<region>' cdkd gc # delete after reviewing the plan
Keep the default --older-than 30d age guard unless the user accepts a shorter window; it protects in-flight publishes and rollback targets.
Before destroy, state destroy, orphan, refactor, import, export, drift --accept, drift --revert, or gc:
destroy also takes the stacks depending on a named one (as cdk destroy); -e keeps to the named ones.state destroy also deletes the earlier S3 versions of each state record it removes, so it cannot be restored from the versioned bucket unless it warns otherwise; destroy and orphan keep them.
Do not use --force, --yes, --purge-events, or other confirmation-bypassing flags unless the user approved that exact destructive scope.
cdkd's main CI use case is per-PR preview environments: deploy on PR open/sync, destroy on close. Deploy time is CI job time, so the speedup compounds across every push. Key rules when authoring such workflows:
-c prNumber=...) and suffix the stack name in the app. State is keyed by (stack name, region) and locks are per-stack, so PR environments deploy concurrently.sts:AssumeRole on a dedicated deploy role, switch into it with --role-arn / CDKD_ROLE_ARN, and pin the deploy role's trust policy to that base role. The deploy role needs direct permissions for every deployed resource — CDK's cdk-hnb659fds-* roles do not work with cdkd. Run cdkd bootstrap once per account beforehand.--yes on deploy / destroy / state destroy is the sanctioned confirmation mechanism — the approval happened when a human reviewed the workflow. The interactive-confirmation rules above still apply whenever a human is driving the session.cdkd diff '<stack>' --fail-on=destructive: beyond the command failing or a deploy-would-refuse exit 3, it fails the job only when a change would replace, delete, or orphan an existing resource. --require-approval cannot ask without a terminal, so in CI it fails the deploy rather than pausing it; use the diff gate for review and keep --yes as the approval.cdkd state destroy '<stack>' --yes: it works from the state record alone (no checkout, npm ci, or synth — works even after the branch is deleted). When the environment contains protection-enabled resources (RDS / DynamoDB deletion protection, EC2 termination protection, and more), add --remove-protection so the teardown completes in one pass — appropriate for ephemeral PR environments; do not default it for long-lived stacks.DeletionPolicy: Snapshot leave a final snapshot behind on every close by default, and so does an RDS DB cluster or standalone DB instance that declares NO DeletionPolicy (CloudFormation's default for them is Snapshot); add --skip-final-snapshot ONLY when the user confirms the environment's data is disposable (it is an explicit data-loss opt-out). To leave an object listing of the state bucket empty, cdkd destroy --purge-events also deletes the event history (after a state destroy, use cdkd events prune '<stack>' --all); on the versioned state bucket both also purge every earlier version under the stack's deployments/ prefix, including history an earlier delete left behind a delete marker, unless a warning says otherwise.cdkd force-unlock '<stack>'.cdkd state list --json on a schedule; reclaim unreferenced assets with cdkd gc outside deploy hours (it aborts while any stack is locked). Read outputs for PR comments with cdkd state show '<stack>' --json.See the CI per-PR guide for a complete GitHub Actions example.
cdkd local * runs Lambda functions, API Gateway APIs, ECS tasks and services, ALBs, CloudFront distributions, Bedrock AgentCore runtimes, Lambda Web Functions, and Lambda MicroVM images on the developer's machine via Docker — no AWS deploy involved, so the deployment-boundary steps above do not apply to these commands:
cdkd local invoke '<function>' # one-shot Lambda invoke
cdkd local start-api # long-running local API Gateway
cdkd local run-task '<task>' # one-shot ECS task
cdkd local start-service '<service>' # long-running ECS service emulator
cdkd local start-web-function '<endpoint|function>' # long-running Lambda Web Function server
cdkd local start-microvm '<image>' # long-running Lambda MicroVM(s) from a MicrovmImage
The most important choice is the environment source: --from-state or --from-cfn-stack. A workload whose environment variables reference other resources (Ref / Fn::GetAtt table names, queue URLs — the common case) runs with those variables dropped unless one of the two fills them with the REAL values of the already-deployed resources — the physical IDs and attributes of the tables, queues, and buckets actually running in the AWS account:
cdkd local invoke '<function>' --from-state # env vars <- the deployed resources' real values, when the stack was deployed with cdkd deploy
cdkd local invoke '<function>' --from-cfn-stack # env vars <- the deployed resources' real values, when the stack was deployed with cdk deploy
--from-state and --from-cfn-stack are mutually exclusive — pick the one matching how the stack was deployed. Both make read-only AWS calls, so they need credentials; a plain local run without them does not.
With the environment source resolved, a local run is a hybrid: the handler executes on the developer's machine (edit and re-invoke — no deploy round-trip), while talking to the real deployed dev resources. That removes the usual local-testing overhead — no hand-maintained .env files mirroring resource names, because the code reads and writes the actual dev-environment tables, queues, and buckets.
When the developer runs AWS Emulator and wants nothing to reach a real account, add --aws-emulator to BOTH the deploy and the local run. cdkd wires the emulator's endpoint, keys, and certificate itself, and bootstraps the emulator on first use (no cdkd bootstrap):
cdkd deploy --aws-emulator
cdkd local invoke '<function>' --from-state --aws-emulator
cdkd local start-api --from-state --aws-emulator
Switch real AWS and the emulator per service by combining --from-state with an --env-vars file: every service goes to the emulator except those set to "real-aws", and --from-state resolves each reference from the matching side — a secret ARN from the real deploy, a table name from the emulator deploy. Deploy the stack to both sides first. Keys go under Parameters (all functions) or a function's name (that function only):
{ "Parameters": { "AWS_ENDPOINT_URL_SECRETS_MANAGER": "real-aws", "AWS_ENDPOINT_URL_BEDROCK_RUNTIME": "real-aws" } }
cdkd deploy --aws-emulator && cdkd deploy
cdkd local invoke '<function>' --from-state --aws-emulator --env-vars routing.json
Under --aws-emulator, custom-resource handlers (e.g. autoDeleteObjects, BucketDeployment, and a cr.Provider's handlers and waiter) run in the official Lambda runtime image via Docker, because the emulator's own runtimes lack parts of the standard library. Without Docker they fall back to the emulator and may fail; --no-local-custom-resources opts out.
The stack outputs name real AWS hosts. To call an API Gateway API inside the emulator, send the request to the emulator endpoint with the API's host in the Host header (see the guide).
By default the container gets the developer's credentials, which usually allow more than the function's role. --assume-role (--assume-task-role on run-task) runs it as the deployed execution role so a missing IAM permission shows up locally. A role CDK creates trusts only its service (e.g. lambda.amazonaws.com), so the real assume is refused; cdkd then emulates the role's permissions with session policies and warns that it is an approximation. A caller that is not an IAM user (IAM Identity Center, role sessions) names a role it can assume with --emulate-role-via '<arn>'. A role with a permissions boundary, or with policies over the session-policy limits, is not emulated.
Most cdkd local commands require Docker, and the first run pulls base images (up to ~600 MB). See the local execution guide for the full subcommand list (ALB, CloudFront, AgentCore, Web Functions, MicroVMs) and flags.
Use the same verified profile, region, state bucket, and binary form throughout a workflow:
cdkd bootstrap
cdkd synth
cdkd diff '<stack>'
cdkd diff '<stack>' --fail-on=destructive
cdkd deploy '<stack>' --dry-run
cdkd deploy '<stack>'
cdkd deploy '<stack>' --require-approval=destructive # terminal only; fails without one
cdkd deploy '<stack>' --full-wait
cdkd state info
cdkd state show '<stack>' --stack-region '<region>'
cdkd events '<stack>' --stack-region '<region>'
cdkd drift '<stack>'
cdkd scrub '<stack>'
cdkd gc --dry-run
cdkd destroy '<stack>'
Options such as --app, --state-bucket, and context values may come from CLI flags, environment variables, or cdk.json. Inspect the project instead of assuming defaults.
For current command behavior, consult the documentation site — in particular the CLI reference, state management, and import guidance.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub go-to-k/cdkd --plugin cdkd-skillsOther plugins' skills for the same job