@go-to-k/cdkd 0.280.36 → 0.280.37

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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { $ as requireConfigObject, $t as AssemblyReader, A as green, At as runDockerForeground, B as disableInstanceApiTermination, Bt as resolveCaptureObservedState, C as MULTI_REGION_RECREATE_BLOCKED_TYPES, Cn as StackTerminationProtectionError, Ct as getBootstrapMarkerKey, D as bold, Dt as buildDockerImage, E as formatResourceLine, Et as validateContainerRepoName, F as clearOnUpdateRemoval, Ft as synthesisStatusMessage, G as WAFv2WebACLProvider, Gt as stateBucketExistenceConfirmed, H as IntrinsicFunctionResolver, Ht as resolveStateBucketWithDefault, I as ProviderRegistry, It as getDefaultStateBucketName, J as assertRegionMatch, Jt as CFN_TEMPLATE_URL_LIMIT, K as normalizeAwsTagsToCfn, Kt as warnDeprecatedNoPrefixCliFlag, L as findActionableSilentDrops, Lt as getLegacyStateBucketName, M as yellow, Mt as AssetManifestLoader, N as IAMRoleProvider, Nt as getDockerImageBySourceHash, O as cyan, On as normalizeAwsError, Ot as formatDockerLoginError, P as collectInlinePolicyNamesManagedBySiblings, Pt as Synthesizer, Q as requireConfigArray, Qt as expectedOwnerParam, R as CloudControlProvider, Rt as resolveApp, S as extractDeploymentEventError, Sn as StackHasActiveImportsError, St as ensureAssetStorage, T as renderStatefulReason, Tt as validateAssetBucketName, U as cfnRefValueFromPhysicalId, Ut as resolveStateBucketWithDefaultAndSource, V as isTerminationProtectionPropagationError, Vt as resolveSkipPrefix, W as refStateLookupFromResource, Wt as resolveUseCdkBootstrapAssets, X as readConfigString, Xt as findLargeInlineResources, Y as configStringRefusal, Yt as MIGRATE_TMP_PREFIX, Z as replayWarn, Zt as uploadCfnTemplate, _ as createPreDeleteFinalSnapshot, _n as NestedStackChildDirectDestroyError, _t as createAssetRedirectResolver, a as DeploymentEventsStore, an as resetAwsClients, at as isRetryableTransientError, b as unsupportedFinalSnapshotError, bn as ResourceTimeoutError, bt as AssetModeResolver, c as replayFailedOperations, cn as CdkdError, ct as TemplateParser, d as IMPLICIT_DELETE_DEPENDENCIES, dn as DeployCancelledError, dt as rebuildClientForBucketRegion, en as processStackMessages, et as requireConfigString, f as computeImplicitDeleteEdges, fn as LocalInvokeBuildError$1, ft as shouldRetainResource, g as ccRoutedFinalSnapshotError, gn as MissingCdkCliError, gt as buildAssetRedirectMap, h as buildFinalSnapshotIdentifier, ht as WorkGraph, i as DeploymentEventsReader, in as getAwsClients, it as withRetry, j as red, jt as runDockerStreaming, k as gray, kn as withErrorHandling, kt as getDockerCmd, l as replayRollback, lt as LockManager, m as PRE_DELETE_SNAPSHOT_TYPES, mn as LocalStartServiceError, mt as stringifyValue, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as resolveBucketRegion, nt as DiffCalculator, o as planFailedOps, on as setAwsClients, ot as isThrottlingError, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as LocalMigrateError, pt as AssetPublisher, q as resolveExplicitPhysicalId, qt as CFN_TEMPLATE_BODY_LIMIT, r as DeployEngine, rn as AwsClients, rt as describeTypeWithThrottleRetry, s as planRollback, st as DagBuilder, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as applyRoleArnIfSet, u as withResourceDeadline, ut as S3StateBackend, v as isFinalSnapshotError, vn as PartialFailureError, vt as loadPublishableAssetManifest, w as isStatefulRecreateTargetSync, wt as parseBootstrapMarker, x as makeCanonicalizePropertiesFn, xn as ResourceUpdateNotSupportedError, xt as BOOTSTRAP_MARKER_PREFIX, y as refusesFinalSnapshot, yn as ProvisioningError, yt as rewriteTemplateAssetReferences, z as slowCcOperationTimeoutMs, zt as resolveAutoAssetStorage } from "./deploy-engine-BcorBRVN.js";
2
+ import { $ as requireConfigObject, $t as AssemblyReader, A as green, At as runDockerForeground, B as disableInstanceApiTermination, Bt as resolveCaptureObservedState, C as MULTI_REGION_RECREATE_BLOCKED_TYPES, Cn as StackTerminationProtectionError, Ct as getBootstrapMarkerKey, D as bold, Dt as buildDockerImage, E as formatResourceLine, Et as validateContainerRepoName, F as clearOnUpdateRemoval, Ft as synthesisStatusMessage, G as WAFv2WebACLProvider, Gt as stateBucketExistenceConfirmed, H as IntrinsicFunctionResolver, Ht as resolveStateBucketWithDefault, I as ProviderRegistry, It as getDefaultStateBucketName, J as assertRegionMatch, Jt as CFN_TEMPLATE_URL_LIMIT, K as normalizeAwsTagsToCfn, Kt as warnDeprecatedNoPrefixCliFlag, L as findActionableSilentDrops, Lt as getLegacyStateBucketName, M as yellow, Mt as AssetManifestLoader, N as IAMRoleProvider, Nt as getDockerImageBySourceHash, O as cyan, On as normalizeAwsError, Ot as formatDockerLoginError, P as collectInlinePolicyNamesManagedBySiblings, Pt as Synthesizer, Q as requireConfigArray, Qt as expectedOwnerParam, R as CloudControlProvider, Rt as resolveApp, S as extractDeploymentEventError, Sn as StackHasActiveImportsError, St as ensureAssetStorage, T as renderStatefulReason, Tt as validateAssetBucketName, U as cfnRefValueFromPhysicalId, Ut as resolveStateBucketWithDefaultAndSource, V as isTerminationProtectionPropagationError, Vt as resolveSkipPrefix, W as refStateLookupFromResource, Wt as resolveUseCdkBootstrapAssets, X as readConfigString, Xt as findLargeInlineResources, Y as configStringRefusal, Yt as MIGRATE_TMP_PREFIX, Z as replayWarn, Zt as uploadCfnTemplate, _ as createPreDeleteFinalSnapshot, _n as NestedStackChildDirectDestroyError, _t as createAssetRedirectResolver, a as DeploymentEventsStore, an as resetAwsClients, at as isRetryableTransientError, b as unsupportedFinalSnapshotError, bn as ResourceTimeoutError, bt as AssetModeResolver, c as replayFailedOperations, cn as CdkdError, ct as TemplateParser, d as IMPLICIT_DELETE_DEPENDENCIES, dn as DeployCancelledError, dt as rebuildClientForBucketRegion, en as processStackMessages, et as requireConfigString, f as computeImplicitDeleteEdges, fn as LocalInvokeBuildError$1, ft as shouldRetainResource, g as ccRoutedFinalSnapshotError, gn as MissingCdkCliError, gt as buildAssetRedirectMap, h as buildFinalSnapshotIdentifier, ht as WorkGraph, i as DeploymentEventsReader, in as getAwsClients, it as withRetry, j as red, jt as runDockerStreaming, k as gray, kn as withErrorHandling, kt as getDockerCmd, l as replayRollback, lt as LockManager, m as PRE_DELETE_SNAPSHOT_TYPES, mn as LocalStartServiceError, mt as stringifyValue, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as resolveBucketRegion, nt as DiffCalculator, o as planFailedOps, on as setAwsClients, ot as isThrottlingError, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as LocalMigrateError, pt as AssetPublisher, q as resolveExplicitPhysicalId, qt as CFN_TEMPLATE_BODY_LIMIT, r as DeployEngine, rn as AwsClients, rt as describeTypeWithThrottleRetry, s as planRollback, st as DagBuilder, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as applyRoleArnIfSet, u as withResourceDeadline, ut as S3StateBackend, v as isFinalSnapshotError, vn as PartialFailureError, vt as loadPublishableAssetManifest, w as isStatefulRecreateTargetSync, wt as parseBootstrapMarker, x as makeCanonicalizePropertiesFn, xn as ResourceUpdateNotSupportedError, xt as BOOTSTRAP_MARKER_PREFIX, y as refusesFinalSnapshot, yn as ProvisioningError, yt as rewriteTemplateAssetReferences, z as slowCcOperationTimeoutMs, zt as resolveAutoAssetStorage } from "./deploy-engine-Dwwm7AXI.js";
3
3
  import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, h as withStackName, i as runStackBuffered, m as withSkipPrefix, n as getLogger, o as PATTERN_B_NAME_OPTIONS, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-zRrlbaQt.js";
4
- import { t as ASGProvider } from "./asg-provider-DeR16ts4.js";
4
+ import { t as ASGProvider } from "./asg-provider-CiF_JsrI.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { createHash, randomBytes, randomUUID } from "node:crypto";
7
7
  import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -37371,6 +37371,55 @@ var AppSyncProvider = class {
37371
37371
  //#endregion
37372
37372
  //#region src/provisioning/providers/glue-provider.ts
37373
37373
  /**
37374
+ * Read a template-borne value that is about to be forwarded to a Glue read
37375
+ * API as a string.
37376
+ *
37377
+ * `import()` runs against the RAW template, where `substituteOverrideRefs`
37378
+ * has resolved only the `Ref`s whose target is in the overrides map — a
37379
+ * pseudo parameter is never in that map, so `CatalogId: {Ref: AWS::AccountId}`
37380
+ * (what `@aws-cdk/aws-glue-alpha` renders for an environment-agnostic stack)
37381
+ * survives as an OBJECT. A bare `as string` cast then hands that object to
37382
+ * `GetTable` / `GetDatabase` as if it were an id. Dropping it instead matches
37383
+ * the API default (the caller's own account), which is what the intrinsic
37384
+ * would have resolved to anyway.
37385
+ */
37386
+ function importableString(value) {
37387
+ return typeof value === "string" && value.length > 0 ? value : void 0;
37388
+ }
37389
+ function resolveTableIdentity(input) {
37390
+ const { knownPhysicalId, templateDatabaseName, templateTableName } = input;
37391
+ let databaseName;
37392
+ let tableName;
37393
+ if (knownPhysicalId === void 0) {
37394
+ databaseName = templateDatabaseName;
37395
+ tableName = templateTableName;
37396
+ } else if (knownPhysicalId.includes("|")) {
37397
+ const parts = knownPhysicalId.split("|");
37398
+ if (parts.length !== 2) return {
37399
+ ok: false,
37400
+ reason: "pipe-in-name"
37401
+ };
37402
+ databaseName = parts[0] || void 0;
37403
+ tableName = parts[1] || void 0;
37404
+ } else {
37405
+ databaseName = templateDatabaseName;
37406
+ tableName = importableString(knownPhysicalId);
37407
+ }
37408
+ if (databaseName === void 0 || tableName === void 0) return {
37409
+ ok: false,
37410
+ reason: knownPhysicalId === void 0 ? "unidentified" : "unpairable"
37411
+ };
37412
+ if (databaseName.includes("|") || tableName.includes("|")) return {
37413
+ ok: false,
37414
+ reason: "pipe-in-name"
37415
+ };
37416
+ return {
37417
+ ok: true,
37418
+ databaseName,
37419
+ tableName
37420
+ };
37421
+ }
37422
+ /**
37374
37423
  * SDK Provider for AWS Glue resources
37375
37424
  *
37376
37425
  * Supports:
@@ -38000,8 +38049,8 @@ var GlueProvider = class {
38000
38049
  }
38001
38050
  }
38002
38051
  async importDatabase(input) {
38003
- const explicitName = input.knownPhysicalId ?? input.properties["DatabaseInput"]?.["Name"];
38004
- const catalogId = input.properties["CatalogId"];
38052
+ const explicitName = input.knownPhysicalId ?? importableString(input.properties["DatabaseInput"]?.["Name"]);
38053
+ const catalogId = importableString(input.properties["CatalogId"]);
38005
38054
  if (explicitName) try {
38006
38055
  await this.getClient().send(new GetDatabaseCommand({
38007
38056
  Name: explicitName,
@@ -38018,42 +38067,42 @@ var GlueProvider = class {
38018
38067
  return null;
38019
38068
  }
38020
38069
  async importTable(input) {
38021
- const databaseName = input.properties["DatabaseName"];
38022
- const templateTableName = input.properties["TableInput"]?.["Name"];
38023
- const catalogId = input.properties["CatalogId"];
38024
- if (input.knownPhysicalId) {
38025
- const [dbName, tName] = input.knownPhysicalId.split("|");
38026
- if (!dbName || !tName) return null;
38027
- try {
38028
- await this.getClient().send(new GetTableCommand({
38029
- DatabaseName: dbName,
38030
- Name: tName,
38031
- ...catalogId && { CatalogId: catalogId }
38032
- }));
38033
- return {
38034
- physicalId: input.knownPhysicalId,
38035
- attributes: {}
38036
- };
38037
- } catch (err) {
38038
- if (err instanceof EntityNotFoundException) return null;
38039
- throw err;
38070
+ const databaseName = importableString(input.properties["DatabaseName"]);
38071
+ const tableInput = input.properties["TableInput"];
38072
+ const templateTableName = importableString(tableInput?.["Name"]);
38073
+ const catalogId = importableString(input.properties["CatalogId"]);
38074
+ const identity = resolveTableIdentity({
38075
+ knownPhysicalId: input.knownPhysicalId,
38076
+ templateDatabaseName: databaseName,
38077
+ templateTableName
38078
+ });
38079
+ if (!identity.ok) {
38080
+ switch (identity.reason) {
38081
+ case "pipe-in-name":
38082
+ this.logger.warn(`AWS::Glue::Table ${input.logicalId}: cannot be imported because a name contains '|', which cdkd currently uses as the separator in this type's physical id (<databaseName>|<tableName>). Adopting it would record an id cdkd cannot decode back to the same table. CloudFormation manages such a table fine; this is a cdkd limitation tracked in https://github.com/go-to-k/cdkd/issues/1672. Until it is lifted, rename the table or database to omit '|', or manage this resource outside cdkd.`);
38083
+ break;
38084
+ case "unpairable":
38085
+ this.logger.warn(`AWS::Glue::Table ${input.logicalId}: cannot resolve a database for physical id '${input.knownPhysicalId}'. ` + (input.knownPhysicalId === "" ? `The supplied physical id is empty. ` : "The template's DatabaseName is absent or is an unresolved intrinsic, so the bare table name cannot be paired. ") + `Pass the composite form instead: --resource '${input.logicalId}=<databaseName>|<tableName>' (quote it — '|' is a shell pipe).`);
38086
+ break;
38087
+ case "unidentified": break;
38040
38088
  }
38089
+ return null;
38041
38090
  }
38042
- if (databaseName && templateTableName) try {
38091
+ const { databaseName: dbName, tableName: tName } = identity;
38092
+ try {
38043
38093
  await this.getClient().send(new GetTableCommand({
38044
- DatabaseName: databaseName,
38045
- Name: templateTableName,
38094
+ DatabaseName: dbName,
38095
+ Name: tName,
38046
38096
  ...catalogId && { CatalogId: catalogId }
38047
38097
  }));
38048
38098
  return {
38049
- physicalId: `${databaseName}|${templateTableName}`,
38099
+ physicalId: `${dbName}|${tName}`,
38050
38100
  attributes: {}
38051
38101
  };
38052
38102
  } catch (err) {
38053
38103
  if (err instanceof EntityNotFoundException) return null;
38054
38104
  throw err;
38055
38105
  }
38056
- return null;
38057
38106
  }
38058
38107
  };
38059
38108
  /**
@@ -71517,7 +71566,7 @@ function createMigrateCommand() {
71517
71566
  */
71518
71567
  function buildProgram() {
71519
71568
  const program = new Command();
71520
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.280.36");
71569
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.280.37");
71521
71570
  program.hook("preAction", (_thisCommand, actionCommand) => {
71522
71571
  const { profile } = actionCommand.optsWithGlobals();
71523
71572
  if (profile !== void 0) process.env["AWS_PROFILE"] = profile;