@go-to-k/cdkd 0.152.2 → 0.154.0

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
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { _ as withSkipPrefix, a as runDockerStreaming, c as getLogger, d as getLiveRenderer, f as PATTERN_B_NAME_PROPERTIES, g as generateResourceNameWithFallback, h as generateResourceName, i as runDockerForeground, n as formatDockerLoginError, p as PATTERN_B_RESOURCE_TYPES, r as getDockerCmd, u as runStackBuffered, v as withStackName } from "./docker-cmd-EtWSTAje.js";
3
- import { $ as CdkdError, A as shouldRetainResource, B as resolveSkipPrefix, C as IntrinsicFunctionResolver, D as TemplateParser, E as DagBuilder, F as Synthesizer, G as CFN_TEMPLATE_URL_LIMIT, H as resolveStateBucketWithDefaultAndSource, I as getDefaultStateBucketName, J as uploadCfnTemplate, K as MIGRATE_TMP_PREFIX, L as getLegacyStateBucketName, M as stringifyValue, N as WorkGraph, O as LockManager, P as buildDockerImage, R as resolveApp, S as assertRegionMatch, T as DiffCalculator, U as warnDeprecatedNoPrefixCliFlag, V as resolveStateBucketWithDefault, W as CFN_TEMPLATE_BODY_LIMIT, Y as AssemblyReader, Z as resolveBucketRegion, _ as matchesCdkPath, a as withRetry, b as ProviderRegistry, bt as withErrorHandling, c as bold, ct as PartialFailureError, d as green, dt as ResourceUpdateNotSupportedError, f as red, ft as RouteDiscoveryError, g as CDK_PATH_TAG, h as collectInlinePolicyNamesManagedBySiblings, i as withResourceDeadline, it as LocalStartServiceError, j as AssetPublisher, k as S3StateBackend, l as cyan, lt as ProvisioningError, m as IAMRoleProvider, mt as StackTerminationProtectionError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as LocalInvokeBuildError, o as IMPLICIT_DELETE_DEPENDENCIES, ot as MissingCdkCliError, p as yellow, pt as StackHasActiveImportsError, q as findLargeInlineResources, r as DeployEngine, rt as LocalMigrateError, s as formatResourceLine, st as NestedStackChildDirectDestroyError, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as gray, ut as ResourceTimeoutError, v as normalizeAwsTagsToCfn, w as applyRoleArnIfSet, x as CloudControlProvider, y as resolveExplicitPhysicalId, yt as normalizeAwsError, z as resolveCaptureObservedState } from "./deploy-engine-C4yMO329.js";
3
+ import { $ as CdkdError, A as shouldRetainResource, B as resolveSkipPrefix, C as IntrinsicFunctionResolver, D as TemplateParser, E as DagBuilder, F as Synthesizer, G as CFN_TEMPLATE_URL_LIMIT, H as resolveStateBucketWithDefaultAndSource, I as getDefaultStateBucketName, J as uploadCfnTemplate, K as MIGRATE_TMP_PREFIX, L as getLegacyStateBucketName, M as stringifyValue, N as WorkGraph, O as LockManager, P as buildDockerImage, R as resolveApp, S as assertRegionMatch, T as DiffCalculator, U as warnDeprecatedNoPrefixCliFlag, V as resolveStateBucketWithDefault, W as CFN_TEMPLATE_BODY_LIMIT, Y as AssemblyReader, Z as resolveBucketRegion, _ as matchesCdkPath, a as withRetry, b as ProviderRegistry, bt as withErrorHandling, c as bold, ct as PartialFailureError, d as green, dt as ResourceUpdateNotSupportedError, f as red, ft as RouteDiscoveryError, g as CDK_PATH_TAG, h as collectInlinePolicyNamesManagedBySiblings, i as withResourceDeadline, it as LocalStartServiceError, j as AssetPublisher, k as S3StateBackend, l as cyan, lt as ProvisioningError, m as IAMRoleProvider, mt as StackTerminationProtectionError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as LocalInvokeBuildError, o as IMPLICIT_DELETE_DEPENDENCIES, ot as MissingCdkCliError, p as yellow, pt as StackHasActiveImportsError, q as findLargeInlineResources, r as DeployEngine, rt as LocalMigrateError, s as formatResourceLine, st as NestedStackChildDirectDestroyError, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as gray, ut as ResourceTimeoutError, v as normalizeAwsTagsToCfn, w as applyRoleArnIfSet, x as CloudControlProvider, y as resolveExplicitPhysicalId, yt as normalizeAwsError, z as resolveCaptureObservedState } from "./deploy-engine-Yb3E5e9J.js";
4
4
  import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-BF03Alpe.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { createHash, createHmac, createPublicKey, createVerify, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
@@ -377,8 +377,24 @@ const noWaitOption = new Option("--no-wait", "Skip waiting for async resources t
377
377
  */
378
378
  const aggressiveVpcParallelOption = new Option("--no-aggressive-vpc-parallel", "Disable the default relaxation of CDK-injected VPC route DependsOn (on by default; opt out to keep the strict CDK ordering)");
379
379
  /**
380
- * Deploy options
380
+ * Escape hatch for the pre-flight unsupported-type rejection. Comma-separated
381
+ * (and repeatable) resource types that cdkd will attempt via Cloud Control
382
+ * even though it reports them unsupported (AWS NON_PROVISIONABLE). Shared by
383
+ * `cdkd deploy` and `cdkd destroy` so a stack deployed with the flag can also
384
+ * be destroyed. Per-type (not blanket) so the user explicitly names each type.
385
+ *
386
+ * Format-checks each token against the CFn resource-type shape
387
+ * (`Namespace::Service::Type` / `Custom::Foo`) so a typo like
388
+ * `--allow-unsupported-types AWS::AppMash::Mesh` aborts at parse time
389
+ * instead of silently being added to the allowlist with no effect.
381
390
  */
391
+ const RESOURCE_TYPE_FORMAT = /^[A-Z][A-Za-z0-9]+(::[A-Z][A-Za-z0-9]+)+$/;
392
+ function parseAllowUnsupportedTypesToken(value, previous) {
393
+ const parsed = value.split(",").map((s) => s.trim()).filter(Boolean);
394
+ for (const token of parsed) if (!RESOURCE_TYPE_FORMAT.test(token)) throw new Error(`Invalid --allow-unsupported-types value "${token}": expected a CloudFormation resource type like AWS::Service::Type or Custom::Foo.`);
395
+ return [...previous ?? [], ...parsed];
396
+ }
397
+ const allowUnsupportedTypesOption = new Option("--allow-unsupported-types <types>", "Comma-separated resource types to attempt via Cloud Control even though cdkd reports them unsupported (AWS NON_PROVISIONABLE). Escape hatch — Cloud Control will likely still fail. Example: --allow-unsupported-types AWS::Foo::Bar,AWS::Baz::Qux").argParser(parseAllowUnsupportedTypesToken);
382
398
  const deployOptions = [
383
399
  new Option("--concurrency <number>", "Maximum concurrent resource operations").default(10).argParser((value) => parseInt(value, 10)),
384
400
  new Option("--stack-concurrency <number>", "Maximum concurrent stack deployments").default(4).argParser((value) => parseInt(value, 10)),
@@ -392,6 +408,7 @@ const deployOptions = [
392
408
  noWaitOption,
393
409
  aggressiveVpcParallelOption,
394
410
  new Option("-e, --exclusively", "Only deploy requested stacks, do not include dependencies").default(false),
411
+ allowUnsupportedTypesOption,
395
412
  ...resourceTimeoutOptions
396
413
  ];
397
414
  /**
@@ -444,7 +461,11 @@ function effectiveAssumeRoleArn(logicalId, opt) {
444
461
  * never calls `provider.delete()` — does not advertise per-resource timeout
445
462
  * flags it would silently ignore.
446
463
  */
447
- const destroyOptions = [new Option("-f, --force", "Do not ask for confirmation before destroying the stacks").default(false), new Option("--remove-protection", "Bypass deletion protection on protected resources by flipping the per-resource protection flag off in-place before delete. Covers stack-level terminationProtection (CDK property) and resource-level protection on AWS::Logs::LogGroup, AWS::RDS::DBInstance, AWS::RDS::DBCluster, AWS::DocDB::DBCluster, AWS::Neptune::DBCluster, AWS::Neptune::DBInstance, AWS::DynamoDB::Table, AWS::EC2::Instance, AWS::Cognito::UserPool, AWS::AutoScaling::AutoScalingGroup, and AWS::ElasticLoadBalancingV2::LoadBalancer.").default(false)];
464
+ const destroyOptions = [
465
+ new Option("-f, --force", "Do not ask for confirmation before destroying the stacks").default(false),
466
+ new Option("--remove-protection", "Bypass deletion protection on protected resources by flipping the per-resource protection flag off in-place before delete. Covers stack-level terminationProtection (CDK property) and resource-level protection on AWS::Logs::LogGroup, AWS::RDS::DBInstance, AWS::RDS::DBCluster, AWS::DocDB::DBCluster, AWS::Neptune::DBCluster, AWS::Neptune::DBInstance, AWS::DynamoDB::Table, AWS::EC2::Instance, AWS::Cognito::UserPool, AWS::AutoScaling::AutoScalingGroup, and AWS::ElasticLoadBalancingV2::LoadBalancer.").default(false),
467
+ allowUnsupportedTypesOption
468
+ ];
448
469
 
449
470
  //#endregion
450
471
  //#region src/cli/commands/bootstrap.ts
@@ -31504,6 +31525,7 @@ async function runDestroyForStack(stackName, state, ctx) {
31504
31525
  destroyProviderRegistry = new ProviderRegistry();
31505
31526
  registerAllProviders(destroyProviderRegistry);
31506
31527
  destroyProviderRegistry.setCustomResourceResponseBucket(ctx.stateBucket);
31528
+ if (ctx.allowUnsupportedTypes?.length) destroyProviderRegistry.allowUnsupportedTypes(ctx.allowUnsupportedTypes);
31507
31529
  }
31508
31530
  logger.info(`\nAcquiring lock for stack ${stackName}...`);
31509
31531
  await ctx.lockManager.acquireLock(stackName, regionForState, void 0, "destroy");
@@ -32369,6 +32391,7 @@ async function deployCommand(stacks, options) {
32369
32391
  const stackProviderRegistry = new ProviderRegistry();
32370
32392
  registerAllProviders(stackProviderRegistry);
32371
32393
  stackProviderRegistry.setCustomResourceResponseBucket(stateBucket, baseRegion);
32394
+ if (options.allowUnsupportedTypes?.length) stackProviderRegistry.allowUnsupportedTypes(options.allowUnsupportedTypes);
32372
32395
  try {
32373
32396
  if (skipPrefix) {
32374
32397
  const existing = await stackStateBackend.getState(stackInfo.stackName, stackRegion);
@@ -34619,6 +34642,7 @@ async function destroyCommand(stackArgs, options) {
34619
34642
  const providerRegistry = new ProviderRegistry();
34620
34643
  registerAllProviders(providerRegistry);
34621
34644
  providerRegistry.setCustomResourceResponseBucket(stateBucket);
34645
+ if (options.allowUnsupportedTypes?.length) providerRegistry.allowUnsupportedTypes(options.allowUnsupportedTypes);
34622
34646
  const appCmd = options.app || resolveApp();
34623
34647
  let appStacks = [];
34624
34648
  if (appCmd) try {
@@ -34755,6 +34779,7 @@ async function destroyCommand(stackArgs, options) {
34755
34779
  skipConfirmation: options.yes || options.force,
34756
34780
  removeProtection: options.removeProtection === true,
34757
34781
  exportIndexStore,
34782
+ ...options.allowUnsupportedTypes?.length && { allowUnsupportedTypes: options.allowUnsupportedTypes },
34758
34783
  ...options.resourceWarnAfter?.globalMs !== void 0 && { resourceWarnAfterMs: options.resourceWarnAfter.globalMs },
34759
34784
  ...options.resourceTimeout?.globalMs !== void 0 && { resourceTimeoutMs: options.resourceTimeout.globalMs },
34760
34785
  ...options.resourceWarnAfter?.perTypeMs && { resourceWarnAfterByType: options.resourceWarnAfter.perTypeMs },
@@ -39004,6 +39029,7 @@ async function stateDestroyCommand(stackArgs, options) {
39004
39029
  const providerRegistry = new ProviderRegistry();
39005
39030
  registerAllProviders(providerRegistry);
39006
39031
  providerRegistry.setCustomResourceResponseBucket(setup.bucket);
39032
+ if (options.allowUnsupportedTypes?.length) providerRegistry.allowUnsupportedTypes(options.allowUnsupportedTypes);
39007
39033
  try {
39008
39034
  const stateRefs = await setup.stateBackend.listStacks();
39009
39035
  const knownStackNames = new Set(stateRefs.map((r) => r.stackName));
@@ -39087,6 +39113,7 @@ async function stateDestroyCommand(stackArgs, options) {
39087
39113
  skipConfirmation: options.yes || options.all === true,
39088
39114
  removeProtection: options.removeProtection === true,
39089
39115
  exportIndexStore: setup.exportIndexStore,
39116
+ ...options.allowUnsupportedTypes?.length && { allowUnsupportedTypes: options.allowUnsupportedTypes },
39090
39117
  ...options.resourceWarnAfter?.globalMs !== void 0 && { resourceWarnAfterMs: options.resourceWarnAfter.globalMs },
39091
39118
  ...options.resourceTimeout?.globalMs !== void 0 && { resourceTimeoutMs: options.resourceTimeout.globalMs },
39092
39119
  ...options.resourceWarnAfter?.perTypeMs && { resourceWarnAfterByType: options.resourceWarnAfter.perTypeMs },
@@ -39118,7 +39145,8 @@ function createStateDestroyCommand() {
39118
39145
  [
39119
39146
  ...commonOptions,
39120
39147
  ...stateOptions,
39121
- ...resourceTimeoutOptions
39148
+ ...resourceTimeoutOptions,
39149
+ allowUnsupportedTypesOption
39122
39150
  ].forEach((opt) => cmd.addOption(opt));
39123
39151
  cmd.addOption(deprecatedRegionOption);
39124
39152
  return cmd;
@@ -58041,7 +58069,7 @@ function reorderArgs(argv) {
58041
58069
  */
58042
58070
  async function main() {
58043
58071
  const program = new Command();
58044
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.152.2");
58072
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.154.0");
58045
58073
  program.addCommand(createBootstrapCommand());
58046
58074
  program.addCommand(createSynthCommand());
58047
58075
  program.addCommand(createListCommand());