| description | cdkd asset publishing layer (S3 file upload with ZIP packaging, ECR Docker image build & push) | ||
|---|---|---|---|
| paths |
|
- Self-implemented (no external CDK asset libraries)
FileAssetPublisherhandles S3 file upload with ZIP packaging (usingarchiver)DockerAssetPublisherhandles ECR Docker image build & pushAssetPublisherorchestrates using above publishers (standalonepublish-assetscommand)- For
deploy,WorkGraphmanages asset nodes directly: file assets asasset-publishnodes, Docker assets asasset-build → asset-publishnode chains AssetManifestLoaderloads asset manifests from cdk.outasset-storage.ts(issue #1002 PR 1) owns cdkd-owned asset storage: naming (defaultcdkd-assets-{acct}-{region}bucket /cdkd-container-assets-{acct}-{region}ECR repo; issue #1011 addscdkd bootstrap --asset-bucket <name>/--container-repo <name>custom-name overrides — validated pre-AWS-call (validateAssetBucketName/validateContainerRepoName), threaded throughensureAssetStorage's probe/create/marker-write, written into the marker as the single source of truth; a plain re-bootstrap reuses the marker's names, a DIFFERING requested name hard-errorsASSET_STORAGE_NAME_CONFLICTpointing atcdkd bootstrap --destroy; rejected with--no-assets/--destroy; the #1007 auto-create always uses default names), the per-region bootstrap marker (s3://{stateBucket}/cdkd-bootstrap/{region}.json, written LAST byensureAssetStoragefromcdkd bootstrap;--no-assetsopts out; squatting defense viaExpectedBucketOwner+ owned-elsewhere hard errors, applied identically to custom names), and the deploy-timeAssetModeResolver(marker absent → legacy mode byte-identical + onecdk gc-hazard info line per legacy region naming the exactcdkd bootstrap --region <r>fix; present →cdkd-assetsmode with bucket/repo existence verification, hard error on missing — never silent fallback;autoCreate(issue #1007, deploy-only, not under --dry-run) auto-creates bucket+repo+marker via the sameensureAssetStorageon first deploy into an un-opted-in region — confirm-gated (--yes/non-TTY auto-approve), decline/failure falls back to legacy + warning, opt out via--no-auto-asset-storage/context.cdkd.autoAssetStorage: false;useCdkBootstrapAssetsopt pins legacy with no marker read + no notice,suppressLegacyNoticequiets non-publishing commands). Teardown iscdkd bootstrap --destroy(issue #1010,src/cli/commands/bootstrap-destroy.ts): asset bucket emptied+deleted → ECR repo force-deleted → marker deleted LAST (mirror ordering); names read from the marker, deployed-stack reference scan refuses unless--force,--include-state-bucketadds the state bucket (refused while any stack state / other-region marker exists). Garbage collection iscdkd gc(issue #1012,src/cli/commands/gc.ts): deletes unreferenced+old objects/images from one region's asset storage (names from the marker; whole-bucket state-file reference scan; lock/malformed-state aborts;--older-thanage guard default 30d;--dry-run/ y/N confirm; CDK bootstrap storage untouched). Design:docs/design/1002-cdkd-asset-storage.md.asset-redirect.ts(issue #1002 PR 2) wires thecdkd-assetsmode:buildAssetRedirectMapbuilds the §6 destination-driven mapping table from a stack's*.assets.json(scope rule §8 — onlycdk-[a-z0-9]+-(container-)?assets-{acct}-{region}shapes for the deploy account+region redirect; user-chosen names / cross-region destinations stay verbatim; template-asset destinations included so nestedTemplateURLrewrites harmlessly);rewriteTemplateAssetReferencesis the §7 boundary-aware deep rewrite (plain strings +Fn::Subtemplate strings + folded pseudo-parameter-onlyFn::Joinruns — folds persist only when a source matched);findUnrewrittenAssetReferencesbacks the deploy engine's §7-step-3 post-resolution audit (DeployEngineOptions.assetRedirect— any resolved property still naming a mapped source fails the resource before provisioning);redirectFileAsset/redirectDockerAssetapply the SAME table at publish time (AssetPublisher.addAssetsToGraph'sredirectoption; keys/tags untouched);createAssetRedirectResolveris the lazy STS+marker gate used bydiff/import;loadPublishableAssetManifestgates everything so asset-less stacks stay byte-identical. Rewrite call sites: deploy.ts (top-level),NestedStackProvider.readChildTemplate(viaNestedStackProviderContext.assetRedirect), diff-recursive'sbuildDiffTree, import.ts (top-level + recursive CFn-migration child walk).synth/exportstay unrewritten by design (§7.1).--use-cdk-bootstrap-assets(deploy/diff/import/publish-assets) +cdk.json context.cdkd.useCdkBootstrapAssetspin legacy per invocation / per app (resolveUseCdkBootstrapAssets). Integ:tests/integration/asset-migration/.