@go-to-k/cdkd 0.173.0 → 0.175.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-BfRlYX17.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-D8JZ8p6A.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";
@@ -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
  /**
@@ -8703,6 +8762,7 @@ var DynamoDBTableProvider = class {
8703
8762
  "AttributeDefinitions",
8704
8763
  "BillingMode",
8705
8764
  "ProvisionedThroughput",
8765
+ "OnDemandThroughput",
8706
8766
  "StreamSpecification",
8707
8767
  "GlobalSecondaryIndexes",
8708
8768
  "LocalSecondaryIndexes",
@@ -8743,6 +8803,7 @@ var DynamoDBTableProvider = class {
8743
8803
  WriteCapacityUnits: Number(pt?.["WriteCapacityUnits"] ?? 5)
8744
8804
  };
8745
8805
  }
8806
+ if (properties["OnDemandThroughput"]) createParams.OnDemandThroughput = properties["OnDemandThroughput"];
8746
8807
  if (properties["StreamSpecification"]) createParams.StreamSpecification = {
8747
8808
  StreamEnabled: true,
8748
8809
  StreamViewType: properties["StreamSpecification"]["StreamViewType"]
@@ -8793,6 +8854,15 @@ var DynamoDBTableProvider = class {
8793
8854
  try {
8794
8855
  const table = (await this.dynamoDBClient.send(new DescribeTableCommand({ TableName: physicalId }))).Table;
8795
8856
  if (table?.TableArn) await this.applyTagDiff(table.TableArn, previousProperties["Tags"], properties["Tags"]);
8857
+ if (JSON.stringify(properties["OnDemandThroughput"]) !== JSON.stringify(previousProperties["OnDemandThroughput"])) {
8858
+ if (properties["OnDemandThroughput"]) {
8859
+ await this.dynamoDBClient.send(new UpdateTableCommand({
8860
+ TableName: physicalId,
8861
+ OnDemandThroughput: properties["OnDemandThroughput"]
8862
+ }));
8863
+ this.logger.debug(`Updated OnDemandThroughput on DynamoDB table ${physicalId}`);
8864
+ }
8865
+ }
8796
8866
  if (JSON.stringify(properties["PointInTimeRecoverySpecification"]) !== JSON.stringify(previousProperties["PointInTimeRecoverySpecification"])) await this.applyPointInTimeRecovery(physicalId, properties["PointInTimeRecoverySpecification"], previousProperties["PointInTimeRecoverySpecification"]);
8797
8867
  if (JSON.stringify(properties["TimeToLiveSpecification"]) !== JSON.stringify(previousProperties["TimeToLiveSpecification"])) await this.applyTimeToLive(physicalId, properties["TimeToLiveSpecification"], previousProperties["TimeToLiveSpecification"]);
8798
8868
  return {
@@ -9067,6 +9137,12 @@ var DynamoDBTableProvider = class {
9067
9137
  ReadCapacityUnits: table.ProvisionedThroughput.ReadCapacityUnits,
9068
9138
  WriteCapacityUnits: table.ProvisionedThroughput.WriteCapacityUnits
9069
9139
  };
9140
+ if (table.OnDemandThroughput) {
9141
+ const odt = {};
9142
+ if (table.OnDemandThroughput.MaxReadRequestUnits !== void 0) odt["MaxReadRequestUnits"] = table.OnDemandThroughput.MaxReadRequestUnits;
9143
+ if (table.OnDemandThroughput.MaxWriteRequestUnits !== void 0) odt["MaxWriteRequestUnits"] = table.OnDemandThroughput.MaxWriteRequestUnits;
9144
+ if (Object.keys(odt).length > 0) result["OnDemandThroughput"] = odt;
9145
+ }
9070
9146
  if (table.StreamSpecification?.StreamEnabled && table.StreamSpecification.StreamViewType) result["StreamSpecification"] = {
9071
9147
  StreamEnabled: true,
9072
9148
  StreamViewType: table.StreamSpecification.StreamViewType
@@ -51262,7 +51338,7 @@ function reorderArgs(argv) {
51262
51338
  */
51263
51339
  async function main() {
51264
51340
  const program = new Command();
51265
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.173.0");
51341
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.175.0");
51266
51342
  program.addCommand(createBootstrapCommand());
51267
51343
  program.addCommand(createSynthCommand());
51268
51344
  program.addCommand(createListCommand());