@go-to-k/cdkd 0.94.2 → 0.94.5

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/README.md CHANGED
@@ -8,6 +8,8 @@ Drop-in CDK CLI for existing CDK apps — faster deploys via AWS SDK instead of
8
8
 
9
9
  ![cdkd demo](https://github.com/user-attachments/assets/0128730d-186d-4bd3-abea-aabc80ba4dd5)
10
10
 
11
+ **cdkd complements the AWS CDK CLI rather than replacing it.** Use cdkd in dev/test for rapid iteration and SAM-style local execution; use the AWS CDK CLI in production for full CloudFormation tooling. Bidirectional migration is supported — [import an existing CloudFormation stack](#importing-existing-resources) into cdkd for iteration, or [export back to CloudFormation](#exporting-a-stack-back-to-cloudformation) when ready for production.
12
+
11
13
  > **⚠️ WARNING: NOT PRODUCTION READY**
12
14
  >
13
15
  > An experimental project exploring direct SDK provisioning as an alternative to the AWS CDK CLI — **NOT a replacement** and **NOT suitable for production use**. Features are incomplete, APIs may change without notice, and bugs may affect your AWS infrastructure. Use at your own risk in development / testing environments only.
package/dist/cli.js CHANGED
@@ -17838,6 +17838,14 @@ var PATTERN_B_RESOURCE_TYPES = [
17838
17838
  "AWS::ElasticLoadBalancingV2::LoadBalancer",
17839
17839
  "AWS::ElasticLoadBalancingV2::TargetGroup"
17840
17840
  ];
17841
+ var PATTERN_B_NAME_PROPERTIES = {
17842
+ "AWS::IAM::Role": "RoleName",
17843
+ "AWS::IAM::User": "UserName",
17844
+ "AWS::IAM::Group": "GroupName",
17845
+ "AWS::IAM::InstanceProfile": "InstanceProfileName",
17846
+ "AWS::ElasticLoadBalancingV2::LoadBalancer": "Name",
17847
+ "AWS::ElasticLoadBalancingV2::TargetGroup": "Name"
17848
+ };
17841
17849
  function generateResourceName(name, options) {
17842
17850
  const {
17843
17851
  maxLength,
@@ -65532,6 +65540,12 @@ function findPendingPrefixRenames(stackName, state) {
65532
65540
  continue;
65533
65541
  if (!resource.physicalId.startsWith(prefix))
65534
65542
  continue;
65543
+ const nameProperty = PATTERN_B_NAME_PROPERTIES[resource.resourceType];
65544
+ if (!nameProperty)
65545
+ continue;
65546
+ const userSuppliedName = resource.properties?.[nameProperty];
65547
+ if (typeof userSuppliedName !== "string" || userSuppliedName === "")
65548
+ continue;
65535
65549
  const newPhysicalId = resource.physicalId.slice(prefix.length);
65536
65550
  if (newPhysicalId.length === 0)
65537
65551
  continue;
@@ -80283,15 +80297,6 @@ async function exportCommand(stackArg, options) {
80283
80297
  `${blocked.length} resource(s) block migration. Either destroy them first (cdkd destroy / cdkd state destroy cherry-picked), or remove them from the CDK app and re-synthesize.`
80284
80298
  );
80285
80299
  }
80286
- if (phase2Creates.length > 0 && !options.includeNonImportable) {
80287
- logger.error("The following resources cannot be imported into CloudFormation:");
80288
- for (const p of phase2Creates) {
80289
- logger.error(` - ${p.logicalId} (${p.resourceType}): CFn cannot import this type`);
80290
- }
80291
- throw new Error(
80292
- `${phase2Creates.length} non-importable resource(s) detected (Custom::*). Pass --include-non-importable to run a 2-phase migration: phase 1 imports the importable resources; phase 2 CFn-CREATEs the non-importable ones (re-invoking each Custom Resource's backing Lambda onCreate handler \u2014 make sure those are idempotent). Or destroy these resources first.`
80293
- );
80294
- }
80295
80300
  if (phase1Imports.length === 0 && phase2Creates.length === 0 && recreateBeforePhase2.length === 0) {
80296
80301
  logger.warn("No resources to migrate \u2014 cdkd state is empty.");
80297
80302
  return;
@@ -80322,9 +80327,23 @@ async function exportCommand(stackArg, options) {
80322
80327
  logger.info("");
80323
80328
  }
80324
80329
  if (options.dryRun) {
80330
+ if (phase2Creates.length > 0 && !options.includeNonImportable) {
80331
+ logger.warn(
80332
+ `${phase2Creates.length} non-importable resource(s) detected (Custom::*). A real run (without --dry-run) would require --include-non-importable to run a 2-phase migration: phase 1 imports the importable resources; phase 2 CFn-CREATEs the non-importable ones (re-invoking each Custom Resource's backing Lambda onCreate handler \u2014 make sure those are idempotent).`
80333
+ );
80334
+ }
80325
80335
  logger.info("--dry-run: no CloudFormation changeset will be created.");
80326
80336
  return;
80327
80337
  }
80338
+ if (phase2Creates.length > 0 && !options.includeNonImportable) {
80339
+ logger.error("The following resources cannot be imported into CloudFormation:");
80340
+ for (const p of phase2Creates) {
80341
+ logger.error(` - ${p.logicalId} (${p.resourceType}): CFn cannot import this type`);
80342
+ }
80343
+ throw new Error(
80344
+ `${phase2Creates.length} non-importable resource(s) detected (Custom::*). Pass --include-non-importable to run a 2-phase migration: phase 1 imports the importable resources; phase 2 CFn-CREATEs the non-importable ones (re-invoking each Custom Resource's backing Lambda onCreate handler \u2014 make sure those are idempotent). Or destroy these resources first.`
80345
+ );
80346
+ }
80328
80347
  if (!options.yes) {
80329
80348
  const phase2Note = phase2Creates.length > 0 ? ` Phase 2 will then CREATE ${phase2Creates.length} non-importable resource(s) (invoking each Custom Resource's onCreate handler).` : "";
80330
80349
  const recreateNote = recreateBeforePhase2.length > 0 ? ` cdkd will also DELETE ${recreateBeforePhase2.length} AWS resource(s) between phases so CFn can re-CREATE them in phase 2 (brief unavailability window \u2014 see plan above for the affected resources).` : "";
@@ -81162,7 +81181,7 @@ function reorderArgs(argv) {
81162
81181
  }
81163
81182
  async function main() {
81164
81183
  const program = new Command18();
81165
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.94.2");
81184
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.94.5");
81166
81185
  program.addCommand(createBootstrapCommand());
81167
81186
  program.addCommand(createSynthCommand());
81168
81187
  program.addCommand(createListCommand());