@go-to-k/cdkd 0.94.6 → 0.94.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -80449,7 +80449,7 @@ async function exportCommand(stackArg, options) {
80449
80449
  const injectedCount = injectDeletionPolicyForImport(phase1Template);
80450
80450
  if (injectedCount > 0) {
80451
80451
  logger.info(
80452
- `Injected DeletionPolicy: Retain on ${injectedCount} resource(s) without an explicit DeletionPolicy (required by CFn IMPORT). The first \`cdk deploy\` after export will reset each to your CDK-declared value.`
80452
+ `Injected DeletionPolicy: Delete on ${injectedCount} resource(s) without an explicit DeletionPolicy (required by CFn IMPORT \u2014 matches the CDK/CFn default for resources without RemovalPolicy).`
80453
80453
  );
80454
80454
  }
80455
80455
  await executeImportChangeSet(
@@ -80499,10 +80499,11 @@ The CloudFormation stack '${cfnStackName}' contains the phase-1 imports but the
80499
80499
  const phase2Count = phase2Creates.length + recreateBeforePhase2.length;
80500
80500
  if (phase2Count > 0) {
80501
80501
  try {
80502
+ const phase2Template = applyImportOverlayForPhase2(template, phase1Imports);
80502
80503
  await executeUpdateChangeSet(
80503
80504
  awsClients.cloudFormation,
80504
80505
  cfnStackName,
80505
- template,
80506
+ phase2Template,
80506
80507
  cfnParameters
80507
80508
  );
80508
80509
  const parts = [];
@@ -80841,7 +80842,7 @@ function injectDeletionPolicyForImport(template) {
80841
80842
  continue;
80842
80843
  const r = resource;
80843
80844
  if (r["DeletionPolicy"] === void 0) {
80844
- r["DeletionPolicy"] = "Retain";
80845
+ r["DeletionPolicy"] = "Delete";
80845
80846
  injected++;
80846
80847
  }
80847
80848
  }
@@ -80874,6 +80875,21 @@ function overlayResourceIdentifierOnProperties(resource, entry) {
80874
80875
  }
80875
80876
  return { ...r, Properties: properties };
80876
80877
  }
80878
+ function applyImportOverlayForPhase2(template, phase1Imports) {
80879
+ const result = JSON.parse(JSON.stringify(template));
80880
+ const resources = result["Resources"];
80881
+ if (!resources || typeof resources !== "object" || Array.isArray(resources)) {
80882
+ return result;
80883
+ }
80884
+ const resourcesMap = resources;
80885
+ for (const entry of phase1Imports) {
80886
+ const r = resourcesMap[entry.logicalId];
80887
+ if (r !== void 0) {
80888
+ resourcesMap[entry.logicalId] = overlayResourceIdentifierOnProperties(r, entry);
80889
+ }
80890
+ }
80891
+ return result;
80892
+ }
80877
80893
  function reportDriftBaselineGaps(state, logger) {
80878
80894
  const entries = Object.entries(state.resources ?? {});
80879
80895
  if (entries.length === 0)
@@ -81240,7 +81256,7 @@ function reorderArgs(argv) {
81240
81256
  }
81241
81257
  async function main() {
81242
81258
  const program = new Command18();
81243
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.94.6");
81259
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.94.8");
81244
81260
  program.addCommand(createBootstrapCommand());
81245
81261
  program.addCommand(createSynthCommand());
81246
81262
  program.addCommand(createListCommand());