@go-to-k/cdkd 0.172.0 → 0.174.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-iDMcWcre.js";
3
- import { A as S3StateBackend, B as resolveCaptureObservedState, C as assertRegionMatch, D as DagBuilder, E as DiffCalculator, F as buildDockerImage, G as CFN_TEMPLATE_BODY_LIMIT, H as resolveStateBucketWithDefault, I as Synthesizer, J as findLargeInlineResources, K as CFN_TEMPLATE_URL_LIMIT, L as getDefaultStateBucketName, M as AssetPublisher, N as stringifyValue, O as TemplateParser, P as WorkGraph, Q as resolveBucketRegion, R as getLegacyStateBucketName, S as CloudControlProvider, T as applyRoleArnIfSet, U as resolveStateBucketWithDefaultAndSource, V as resolveSkipPrefix, W as warnDeprecatedNoPrefixCliFlag, X as AssemblyReader, Y as uploadCfnTemplate, _ as matchesCdkPath, a as withRetry, at as LocalStartServiceError, b as ProviderRegistry, bt as withErrorHandling, c as bold, ct as NestedStackChildDirectDestroyError, d as green, dt as ResourceTimeoutError, et as CdkdError, f as red, ft as ResourceUpdateNotSupportedError, g as CDK_PATH_TAG, h as collectInlinePolicyNamesManagedBySiblings, i as withResourceDeadline, it as LocalMigrateError, j as shouldRetainResource, k as LockManager, l as cyan, lt as PartialFailureError, m as IAMRoleProvider, mt as StackTerminationProtectionError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as IMPLICIT_DELETE_DEPENDENCIES, p as yellow, pt as StackHasActiveImportsError, q as MIGRATE_TMP_PREFIX, r as DeployEngine, rt as LocalInvokeBuildError$1, s as formatResourceLine, st as MissingCdkCliError, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as gray, ut as ProvisioningError, v as normalizeAwsTagsToCfn, w as IntrinsicFunctionResolver, x as findActionableSilentDrops, y as resolveExplicitPhysicalId, yt as normalizeAwsError, z as resolveApp } from "./deploy-engine-ZV67Rszk.js";
3
+ import { A as S3StateBackend, B as resolveCaptureObservedState, C as assertRegionMatch, D as DagBuilder, E as DiffCalculator, F as buildDockerImage, G as CFN_TEMPLATE_BODY_LIMIT, H as resolveStateBucketWithDefault, I as Synthesizer, J as findLargeInlineResources, K as CFN_TEMPLATE_URL_LIMIT, L as getDefaultStateBucketName, M as AssetPublisher, N as stringifyValue, O as TemplateParser, P as WorkGraph, Q as resolveBucketRegion, R as getLegacyStateBucketName, S as CloudControlProvider, T as applyRoleArnIfSet, U as resolveStateBucketWithDefaultAndSource, V as resolveSkipPrefix, W as warnDeprecatedNoPrefixCliFlag, X as AssemblyReader, Y as uploadCfnTemplate, _ as matchesCdkPath, a as withRetry, at as LocalStartServiceError, b as ProviderRegistry, bt as withErrorHandling, c as bold, ct as NestedStackChildDirectDestroyError, d as green, dt as ResourceTimeoutError, et as CdkdError, f as red, ft as ResourceUpdateNotSupportedError, g as CDK_PATH_TAG, h as collectInlinePolicyNamesManagedBySiblings, i as withResourceDeadline, it as LocalMigrateError, j as shouldRetainResource, k as LockManager, l as cyan, lt as PartialFailureError, m as IAMRoleProvider, mt as StackTerminationProtectionError, n as DEFAULT_RESOURCE_WARN_AFTER_MS, o as IMPLICIT_DELETE_DEPENDENCIES, p as yellow, pt as StackHasActiveImportsError, q as MIGRATE_TMP_PREFIX, r as DeployEngine, rt as LocalInvokeBuildError$1, s as formatResourceLine, st as MissingCdkCliError, t as DEFAULT_RESOURCE_TIMEOUT_MS, u as gray, ut as ProvisioningError, v as normalizeAwsTagsToCfn, w as IntrinsicFunctionResolver, x as findActionableSilentDrops, y as resolveExplicitPhysicalId, yt as normalizeAwsError, z as resolveApp } from "./deploy-engine-D5QbP-ot.js";
4
4
  import { a as setAwsClients, i as resetAwsClients, r as getAwsClients, t as AwsClients } from "./aws-clients-B15NAPbL.js";
5
5
  import { AsyncLocalStorage } from "node:async_hooks";
6
6
  import { randomBytes, randomUUID } from "node:crypto";
@@ -414,12 +414,12 @@ const RESOURCE_PROPERTY_FORMAT = /^[A-Z][A-Za-z0-9]+(::[A-Z][A-Za-z0-9]+)+:[A-Z]
414
414
  function parseAllowUnsupportedPropertiesToken(value, previous) {
415
415
  const parsed = value.split(",").map((s) => s.trim()).filter(Boolean);
416
416
  for (const token of parsed) {
417
- if (!RESOURCE_PROPERTY_FORMAT.test(token)) throw new Error(`Invalid --allow-unsupported-properties value "${token}": expected <ResourceType>:<PropertyName> with PascalCase on both halves (e.g. AWS::Lambda::Function:LoggingConfig).`);
417
+ if (!RESOURCE_PROPERTY_FORMAT.test(token)) throw new Error(`Invalid --allow-unsupported-properties value "${token}": expected <ResourceType>:<PropertyName> with PascalCase on both halves (e.g. AWS::Lambda::Function:RecursiveLoop).`);
418
418
  if (token.startsWith("Custom::")) throw new Error(`Invalid --allow-unsupported-properties value "${token}": Custom:: resources are routed through cfn-response and have no write-side silent drop at cdkd, so the flag would have no effect. Use --allow-unsupported-types for type-level escape hatches instead.`);
419
419
  }
420
420
  return [...previous ?? [], ...parsed];
421
421
  }
422
- const allowUnsupportedPropertiesOption = new Option("--allow-unsupported-properties <entries>", "Comma-separated <ResourceType>:<PropertyName> tokens to accept as silently dropped at deploy time. Escape hatch — the property will NOT be written to AWS, the deployed resource will be missing the field. Example: --allow-unsupported-properties AWS::Lambda::Function:LoggingConfig,AWS::RDS::DBInstance:CACertificateIdentifier").argParser(parseAllowUnsupportedPropertiesToken);
422
+ const allowUnsupportedPropertiesOption = new Option("--allow-unsupported-properties <entries>", "Comma-separated <ResourceType>:<PropertyName> tokens to accept as silently dropped at deploy time. Escape hatch — the property will NOT be written to AWS, the deployed resource will be missing the field. Example: --allow-unsupported-properties AWS::Lambda::Function:RecursiveLoop,AWS::RDS::DBInstance:CACertificateIdentifier").argParser(parseAllowUnsupportedPropertiesToken);
423
423
  /**
424
424
  * Issue [#615] — `--recreate-via-cc-api <LogicalId>` (repeatable). Each
425
425
  * named resource is destroyed + recreated this deploy via Cloud Control
@@ -1088,8 +1088,8 @@ function renderStatefulReason(reason) {
1088
1088
  * this is a structural limitation, not a data-loss footgun.
1089
1089
  *
1090
1090
  * Plus one cross-flag invariant: `--recreate-via-cc-api MyLambda`
1091
- * combined with `--allow-unsupported-properties AWS::Lambda::Function:LoggingConfig`
1092
- * on a resource whose template carries `LoggingConfig` is **ambiguous
1091
+ * combined with `--allow-unsupported-properties AWS::Lambda::Function:RecursiveLoop`
1092
+ * on a resource whose template carries `RecursiveLoop` is **ambiguous
1093
1093
  * intent** — does the user want SDK + silent drop, or CC migration?
1094
1094
  * Fail fast and let the user pick one strategy per resource.
1095
1095
  */
@@ -5512,6 +5512,24 @@ function serializeRedrivePolicy(value) {
5512
5512
  return JSON.stringify(value);
5513
5513
  }
5514
5514
  /**
5515
+ * Serialise a CFn-shape `RedriveAllowPolicy` to the string form
5516
+ * `SetQueueAttributes` / `CreateQueue` expect.
5517
+ *
5518
+ * In CloudFormation `RedriveAllowPolicy` is a JSON object (e.g.
5519
+ * `{ redrivePermission: 'allowAll' }`); the SQS API expects it as a JSON
5520
+ * string, exactly like `RedrivePolicy`. Unlike `serializeRedrivePolicy`,
5521
+ * this does NOT collapse an empty object to `""` — that quirk is specific
5522
+ * to `RedrivePolicy`, whose empty-object placeholder `readCurrentState`
5523
+ * always-emits and which AWS rejects when round-tripped as `"{}"`.
5524
+ * `RedriveAllowPolicy` has no such placeholder (it is emitted only when
5525
+ * AWS returns it), so an object is JSON-stringified verbatim and a string
5526
+ * passes through unchanged.
5527
+ */
5528
+ function serializeRedriveAllowPolicy(value) {
5529
+ if (typeof value === "string") return value;
5530
+ return JSON.stringify(value);
5531
+ }
5532
+ /**
5515
5533
  * CDK property name to SQS attribute name mapping
5516
5534
  */
5517
5535
  const CDK_TO_SQS_ATTRIBUTES = {
@@ -5521,6 +5539,7 @@ const CDK_TO_SQS_ATTRIBUTES = {
5521
5539
  DelaySeconds: "DelaySeconds",
5522
5540
  ReceiveMessageWaitTimeSeconds: "ReceiveMessageWaitTimeSeconds",
5523
5541
  RedrivePolicy: "RedrivePolicy",
5542
+ RedriveAllowPolicy: "RedriveAllowPolicy",
5524
5543
  FifoQueue: "FifoQueue",
5525
5544
  ContentBasedDeduplication: "ContentBasedDeduplication",
5526
5545
  KmsMasterKeyId: "KmsMasterKeyId",
@@ -5549,6 +5568,7 @@ var SQSQueueProvider = class {
5549
5568
  "DelaySeconds",
5550
5569
  "ReceiveMessageWaitTimeSeconds",
5551
5570
  "RedrivePolicy",
5571
+ "RedriveAllowPolicy",
5552
5572
  "FifoQueue",
5553
5573
  "ContentBasedDeduplication",
5554
5574
  "KmsMasterKeyId",
@@ -5574,6 +5594,7 @@ var SQSQueueProvider = class {
5574
5594
  for (const [cdkKey, sqsKey] of Object.entries(CDK_TO_SQS_ATTRIBUTES)) if (properties[cdkKey] !== void 0) {
5575
5595
  const value = properties[cdkKey];
5576
5596
  if (cdkKey === "RedrivePolicy" && typeof value === "object") attributes[sqsKey] = serializeRedrivePolicy(value);
5597
+ else if (cdkKey === "RedriveAllowPolicy") attributes[sqsKey] = serializeRedriveAllowPolicy(value);
5577
5598
  else attributes[sqsKey] = stringifyValue(value);
5578
5599
  }
5579
5600
  const tags = {};
@@ -5613,6 +5634,7 @@ var SQSQueueProvider = class {
5613
5634
  if (properties[cdkKey] !== void 0) {
5614
5635
  const value = properties[cdkKey];
5615
5636
  if (cdkKey === "RedrivePolicy" && typeof value === "object") attributes[sqsKey] = serializeRedrivePolicy(value);
5637
+ else if (cdkKey === "RedriveAllowPolicy") attributes[sqsKey] = serializeRedriveAllowPolicy(value);
5616
5638
  else attributes[sqsKey] = stringifyValue(value);
5617
5639
  }
5618
5640
  }
@@ -5802,6 +5824,11 @@ var SQSQueueProvider = class {
5802
5824
  result["RedrivePolicy"] = attributes["RedrivePolicy"];
5803
5825
  }
5804
5826
  else result["RedrivePolicy"] = {};
5827
+ if (attributes["RedriveAllowPolicy"]) try {
5828
+ result["RedriveAllowPolicy"] = JSON.parse(attributes["RedriveAllowPolicy"]);
5829
+ } catch {
5830
+ result["RedriveAllowPolicy"] = attributes["RedriveAllowPolicy"];
5831
+ }
5805
5832
  try {
5806
5833
  result["Tags"] = normalizeAwsTagsToCfn((await this.sqsClient.send(new ListQueueTagsCommand({ QueueUrl: physicalId }))).Tags);
5807
5834
  } catch (err) {
@@ -6590,7 +6617,13 @@ var SNSSubscriptionProvider = class {
6590
6617
  "TopicArn",
6591
6618
  "Protocol",
6592
6619
  "Endpoint",
6593
- "FilterPolicy"
6620
+ "FilterPolicy",
6621
+ "FilterPolicyScope",
6622
+ "RawMessageDelivery",
6623
+ "RedrivePolicy",
6624
+ "DeliveryPolicy",
6625
+ "ReplayPolicy",
6626
+ "SubscriptionRoleArn"
6594
6627
  ])]]);
6595
6628
  unhandledByDesign = new Map([["AWS::SNS::Subscription", new Map([["Region", "CFn-only cross-region subscription hint; cdkd uses the SDK client region directly and has no per-resource region override"]])]]);
6596
6629
  constructor() {
@@ -6612,6 +6645,18 @@ var SNSSubscriptionProvider = class {
6612
6645
  const attributes = {};
6613
6646
  const filterPolicy = properties["FilterPolicy"];
6614
6647
  if (filterPolicy !== void 0) attributes["FilterPolicy"] = typeof filterPolicy === "string" ? filterPolicy : JSON.stringify(filterPolicy);
6648
+ const filterPolicyScope = properties["FilterPolicyScope"];
6649
+ if (filterPolicyScope !== void 0) attributes["FilterPolicyScope"] = stringifyValue(filterPolicyScope);
6650
+ const rawMessageDelivery = properties["RawMessageDelivery"];
6651
+ if (rawMessageDelivery !== void 0) attributes["RawMessageDelivery"] = stringifyValue(rawMessageDelivery);
6652
+ const redrivePolicy = properties["RedrivePolicy"];
6653
+ if (redrivePolicy !== void 0) attributes["RedrivePolicy"] = typeof redrivePolicy === "string" ? redrivePolicy : JSON.stringify(redrivePolicy);
6654
+ const deliveryPolicy = properties["DeliveryPolicy"];
6655
+ if (deliveryPolicy !== void 0) attributes["DeliveryPolicy"] = typeof deliveryPolicy === "string" ? deliveryPolicy : JSON.stringify(deliveryPolicy);
6656
+ const replayPolicy = properties["ReplayPolicy"];
6657
+ if (replayPolicy !== void 0) attributes["ReplayPolicy"] = typeof replayPolicy === "string" ? replayPolicy : JSON.stringify(replayPolicy);
6658
+ const subscriptionRoleArn = properties["SubscriptionRoleArn"];
6659
+ if (subscriptionRoleArn !== void 0) attributes["SubscriptionRoleArn"] = stringifyValue(subscriptionRoleArn);
6615
6660
  const subscriptionArn = (await this.snsClient.send(new SubscribeCommand({
6616
6661
  TopicArn: topicArn,
6617
6662
  Protocol: protocol,
@@ -6699,6 +6744,20 @@ var SNSSubscriptionProvider = class {
6699
6744
  } catch {
6700
6745
  result["FilterPolicy"] = attributes["FilterPolicy"];
6701
6746
  }
6747
+ if (attributes["FilterPolicyScope"] !== void 0) result["FilterPolicyScope"] = attributes["FilterPolicyScope"];
6748
+ if (attributes["SubscriptionRoleArn"] !== void 0) result["SubscriptionRoleArn"] = attributes["SubscriptionRoleArn"];
6749
+ for (const key of [
6750
+ "RedrivePolicy",
6751
+ "DeliveryPolicy",
6752
+ "ReplayPolicy"
6753
+ ]) {
6754
+ const raw = attributes[key];
6755
+ if (raw) try {
6756
+ result[key] = JSON.parse(raw);
6757
+ } catch {
6758
+ result[key] = raw;
6759
+ }
6760
+ }
6702
6761
  return result;
6703
6762
  }
6704
6763
  /**
@@ -6992,7 +7051,8 @@ var LambdaFunctionProvider = class {
6992
7051
  "KmsKeyArn",
6993
7052
  "FileSystemConfigs",
6994
7053
  "ImageConfig",
6995
- "SnapStart"
7054
+ "SnapStart",
7055
+ "LoggingConfig"
6996
7056
  ])]]);
6997
7057
  eniWaitTimeoutMs = 600 * 1e3;
6998
7058
  eniWaitInitialDelayMs = 1e4;
@@ -7044,6 +7104,7 @@ var LambdaFunctionProvider = class {
7044
7104
  FileSystemConfigs: properties["FileSystemConfigs"],
7045
7105
  ImageConfig: properties["ImageConfig"],
7046
7106
  SnapStart: properties["SnapStart"],
7107
+ LoggingConfig: properties["LoggingConfig"],
7047
7108
  Tags: tags
7048
7109
  };
7049
7110
  const response = await this.lambdaClient.send(new CreateFunctionCommand(createParams));
@@ -7082,7 +7143,8 @@ var LambdaFunctionProvider = class {
7082
7143
  "KmsKeyArn",
7083
7144
  "FileSystemConfigs",
7084
7145
  "ImageConfig",
7085
- "SnapStart"
7146
+ "SnapStart",
7147
+ "LoggingConfig"
7086
7148
  ];
7087
7149
  let hasConfigChanges = false;
7088
7150
  for (const field of configFields) if (JSON.stringify(properties[field]) !== JSON.stringify(previousProperties[field])) {
@@ -7107,7 +7169,8 @@ var LambdaFunctionProvider = class {
7107
7169
  KMSKeyArn: this.clearOnUpdateRemoval(properties["KmsKeyArn"], previousProperties["KmsKeyArn"], ""),
7108
7170
  FileSystemConfigs: this.clearOnUpdateRemoval(properties["FileSystemConfigs"], previousProperties["FileSystemConfigs"], []),
7109
7171
  ImageConfig: this.clearOnUpdateRemoval(properties["ImageConfig"], previousProperties["ImageConfig"], {}),
7110
- SnapStart: this.clearOnUpdateRemoval(properties["SnapStart"], previousProperties["SnapStart"], { ApplyOn: "None" })
7172
+ SnapStart: this.clearOnUpdateRemoval(properties["SnapStart"], previousProperties["SnapStart"], { ApplyOn: "None" }),
7173
+ LoggingConfig: this.clearOnUpdateRemoval(properties["LoggingConfig"], previousProperties["LoggingConfig"], { LogFormat: "Text" })
7111
7174
  };
7112
7175
  await this.lambdaClient.send(new UpdateFunctionConfigurationCommand(configParams));
7113
7176
  this.logger.debug(`Updated configuration for Lambda function ${physicalId}`);
@@ -7573,8 +7636,9 @@ var LambdaFunctionProvider = class {
7573
7636
  * `create()` accepts (`Runtime`, `Handler`, `Role`, `Timeout`, `MemorySize`,
7574
7637
  * `Description`, `Environment`, `Layers`, `Architectures`, `PackageType`,
7575
7638
  * `TracingConfig`, `EphemeralStorage`, `VpcConfig`, `DeadLetterConfig`,
7576
- * `KmsKeyArn`, `FileSystemConfigs`, `ImageConfig`, `SnapStart`, plus the
7577
- * physical `FunctionName`). The drift comparator only descends into keys
7639
+ * `KmsKeyArn`, `FileSystemConfigs`, `ImageConfig`, `SnapStart`,
7640
+ * `LoggingConfig`, plus the physical `FunctionName`). The drift comparator
7641
+ * only descends into keys
7578
7642
  * present in
7579
7643
  * cdkd state, so AWS-managed fields (timestamps, FunctionArn, RevisionId,
7580
7644
  * etc.) are filtered at compare time — we still avoid serializing them on
@@ -7639,6 +7703,13 @@ var LambdaFunctionProvider = class {
7639
7703
  if (Object.keys(ic).length > 0) result["ImageConfig"] = ic;
7640
7704
  }
7641
7705
  if (cfg.SnapStart?.ApplyOn !== void 0) result["SnapStart"] = { ApplyOn: cfg.SnapStart.ApplyOn };
7706
+ if (cfg.LoggingConfig?.LogFormat !== void 0) {
7707
+ const lc = { LogFormat: cfg.LoggingConfig.LogFormat };
7708
+ if (cfg.LoggingConfig.ApplicationLogLevel !== void 0) lc["ApplicationLogLevel"] = cfg.LoggingConfig.ApplicationLogLevel;
7709
+ if (cfg.LoggingConfig.SystemLogLevel !== void 0) lc["SystemLogLevel"] = cfg.LoggingConfig.SystemLogLevel;
7710
+ if (cfg.LoggingConfig.LogGroup !== void 0) lc["LogGroup"] = cfg.LoggingConfig.LogGroup;
7711
+ result["LoggingConfig"] = lc;
7712
+ }
7642
7713
  result["Tags"] = normalizeAwsTagsToCfn(resp.Tags);
7643
7714
  return result;
7644
7715
  } catch (err) {
@@ -35270,7 +35341,7 @@ const EMPTY_ALLOW_SET = /* @__PURE__ */ new Set();
35270
35341
  *
35271
35342
  * - **Fresh hits**: a resource whose template uses one or more
35272
35343
  * silent-drop top-level CFn properties. Annotation value is the list
35273
- * of property names (e.g. `LoggingConfig`).
35344
+ * of property names (e.g. `RecursiveLoop`).
35274
35345
  * - **Sticky hits**: a resource whose deployed state records
35275
35346
  * `provisionedBy: 'cc-api'` (from a prior deploy) even when the
35276
35347
  * current template's silent-drop set is empty. Annotation value is
@@ -51250,7 +51321,7 @@ function reorderArgs(argv) {
51250
51321
  */
51251
51322
  async function main() {
51252
51323
  const program = new Command();
51253
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.172.0");
51324
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.174.0");
51254
51325
  program.addCommand(createBootstrapCommand());
51255
51326
  program.addCommand(createSynthCommand());
51256
51327
  program.addCommand(createListCommand());