| description | CLI configuration resolution, options precedence, stack-name matching, concurrency / timeout flags | |
|---|---|---|
| paths |
|
--app(-a) is optional: falls back toCDKD_APPenv var, thencdk.json"app"field. Accepts either a shell command ("node app.ts") or a path to a pre-synthesized cloud assembly directory (cdk.out); when a directory is given, synthesis is skipped and the manifest is read directly.--state-bucketis optional: falls back toCDKD_STATE_BUCKETenv var, thencdk.jsoncontext.cdkd.stateBucket--regiononcdkd bootstrappicks the region of the new state bucket (a real, non-deprecated,--help-visible option there). On every other command (deploy,destroy,diff,synth,list,state,force-unlock,publish-assets, …)--regionis deprecated but still honored (PR #63, v0.12.0): it is registered as a hiddendeprecatedRegionOption, emits a one-shotwarnIfDeprecatedRegiondeprecation warning, and IS consumed as the highest-precedence region source — every command resolvesconst region = options.region || process.env['AWS_REGION'] || 'us-east-1', passes it toapplyRoleArnIfSet/ theAwsClientsconstructor, anddeploy/destroy/import/export/orphanadditionally inject it intoprocess.env.AWS_REGIONso the CDK synth subprocess inherits it. The recommended way to pick the region isAWS_REGION/ the AWS profile, but passing--regionis NOT a no-op (issue #818 corrected the earlier "has no effect" warning, which contradicted the actual consumption indeploy.tsetc.). The state-bucket S3 client still auto-detects the bucket's region viaGetBucketLocationindependent of--region(PR #60, v0.10.0).warnIfDeprecatedRegion+deprecatedRegionOptionlive insrc/cli/options.ts.--context/-cis optional: acceptskey=valuepairs (repeatable), merged with cdk.json context (CLI takes precedence)- Stack names are positional arguments:
cdkd deploy MyStack(not--stack-name) --allflag targets all stacks for deploy/diff/destroy (destroy --allonly targets stacks from the current CDK app via synthesis)- Wildcard support:
cdkd deploy 'My*' - Stack selection accepts both forms (CDK CLI parity): the physical CloudFormation stack name (
MyStage-MyStack) and the hierarchical display path from CDK synth (MyStage/MyStack). Patterns containing/are matched against the display path; patterns without/are matched against the physical name. This makes Stage-scoped wildcards likecdkd deploy 'MyStage/*'work as expected. Fordestroy, display-path matching requires synth to succeed (state alone only carries physical names). Implemented insrc/cli/stack-matcher.ts. - Single stack auto-detected (no stack name needed)
cdkd list(aliasls) — CDK CLI parity. Default output: each stack's CDK display id on its own line, ordered by dependency —<displayPath> (<physicalStackName>)when the two differ (Stage-scoped stacks), else just the display path.--long/-lemits structured{id, name, environment, [dependencies]}records (YAML, or JSON with--json);--show-dependencies/-demits{id, dependencies}pairs (id uses the same parens form). Positional patterns filter by physical name or display path with the same routing rules as deploy/diff/destroy. No state bucket / AWS credentials needed beyond what synthesis itself requires.- Concurrency options:
--concurrency(resource ops, default 10),--stack-concurrency(stacks, default 4),--asset-publish-concurrency(S3+ECR, default 8),--image-build-concurrency(Docker builds, default 4) - Per-resource timeout options (deploy + destroy + state destroy):
--resource-warn-after <duration_or_type=duration>(default5m) and--resource-timeout <duration_or_type=duration>(default30m). Both flags are repeatable and accept either form per invocation: a bare<duration>(30m) sets the global default;<TYPE>=<duration>(AWS::CloudFront::Distribution=1h) adds a per-resource-type override. At each per-resource call site, resolution isperTypeMs[resourceType] ?? max(provider.getMinResourceTimeoutMs?.(), globalMs) ?? compileTimeDefault— per-type CLI override always wins; otherwise the provider's self-reported minimum (Custom Resource returns its 1h polling cap) lifts the deadline against the global default for that resource type only. Wraps each individual provider call (CREATE / UPDATE / DELETE inprovisionResource()/runDestroyForStack's per-resource delete loop) in aPromise.race-based deadline. The warn timer mutates the live renderer's task label in place ([taking longer than expected, Nm+]) and emits alogger.warnline viaprintAbove; the hard timer throwsResourceTimeoutErrorwhich is caught and wrapped asProvisioningErrorat the same site as any other provider failure, so the existing rollback / state-preservation path runs unchanged. The 30m global default is intentional: most resources never need more, and long-running providers self-report their needed timeout — a Custom-Resource-heavy stack works out of the box without--resource-timeout 1hbecause the CR provider'sgetMinResourceTimeoutMs()reports its 1h polling cap, and a per-type override (--resource-timeout AWS::CloudFormation::CustomResource=5m) is the explicit escape hatch when a user wants to abort CR earlier. Durations accept<n>s/<n>m/<n>h; zero, negative, missing-unit, unknown-unit, malformedTYPE(must look likeAWS::Service::Resource), andwarn >= timeout(both globally and per-type) are all rejected at parse time. Helper atsrc/deployment/resource-deadline.ts; CLI parser atsrc/cli/options.ts(parseResourceTimeoutTokenbuilds aResourceTimeoutOption = { globalMs?, perTypeMs }); resolution helpereffectiveResourceTimeoutMs(resourceType, opt, fallbackMs). The cancellation isPromise.race-style — the underlying provider call keeps running for some time after the timer fires; threadingAbortControllerthrough every provider is deferred. -y/--yesis a global flag (CDK CLI parity) that auto-confirms interactive prompts (e.g.destroy).cdkd destroyadditionally accepts-f/--force— a destroy-specific flag with the same effect as-yin this context (matching CDK CLI, where--forceis per-subcommand and overlaps with the global--yesonly in the destroy confirmation path)--allow-unsupported-types <types>(deploy + destroy) is the escape hatch for the pre-flight unsupported-type rejection. cdkd rejects Tier 3 (ProvisioningType: NON_PROVISIONABLE) types before any resource is touched — the Tier 3 set is generated from the provider-coverage audit intosrc/provisioning/unsupported-types.generated.ts(vp run gen:unsupported-types; CI fails if stale) and consulted byCloudControlProvider.isSupportedResourceType. The flag is comma-separated and repeatable; named types are added toProviderRegistry.allowedUnsupportedTypesand routed through Cloud Control optimistically (likely still fails for a genuinely NON_PROVISIONABLE type — the hatch is for a cached-Tier-3 type AWS has since made provisionable). Per-type (not blanket) so the user explicitly names each type. The pre-flightvalidateResourceTypeserror names each unsupported type with a reason + 1-clickunsupportedTypeIssueUrl(type)link + the exact--allow-unsupported-typesre-run command. Deploy passes the list to the registry beforevalidateResourceTypes; destroy threads it throughDestroyRunnerContext.allowUnsupportedTypesso a stack deployed with the flag is also destroyable (incl. the region-scoped registry the runner spins up for a cross-region stack).--allow-unsupported-properties <entries>(deploy only) is the property-level analogue of--allow-unsupported-types. cdkd's per-Tier-1-type property-coverage map (generated byvp run gen:property-coveragefrom the CFn schema fixtures + each SDK provider'shandledProperties/unhandledByDesigndeclarations intosrc/provisioning/property-coverage.generated.ts; CI fails if stale) feedsProviderRegistry.validateResourceProperties, which rejects deploys whose templates use top-level CFn properties cdkd would silently drop on write. The flag accepts comma-separated<ResourceType>:<PropertyName>tokens (and is repeatable); each entry bypasses the silent-drop reject for that exact type+property pair. Per type+property (not blanket / not per-type) so the user explicitly acknowledges each silent drop. The pre-flight error groups by logical ID + sorts properties alphabetically + emits a deduplicated--allow-unsupported-propertiesre-run command. Deploy-only:destroyuses per-resource physical IDs and ignores template properties. The check runs AFTERvalidateResourceTypesso type-level errors are reported first; for a Tier 2 / Custom / unknown type the property check is a no-op (findSilentDropPropertiesreturns[]for any non-Tier-1 type — CC forwards the full property map to AWS, so there is no write-side silent drop at cdkd). Properties NOT in the CFn schema (likelyaddPropertyOverrideescape hatches or typos) pass through silently; read-only properties (AWS-managed Arns / Ids) also pass through silently.- Implemented in
src/cli/config-loader.ts