@go-to-k/cdkd 0.230.4 → 0.230.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/dist/cli.js CHANGED
@@ -54,7 +54,7 @@ import { CreatePrivateDnsNamespaceCommand, CreateServiceCommand as CreateService
54
54
  import { AppSyncClient, CreateApiKeyCommand, CreateDataSourceCommand, CreateGraphqlApiCommand, CreateResolverCommand, DeleteApiKeyCommand, DeleteDataSourceCommand, DeleteGraphqlApiCommand, DeleteResolverCommand, GetDataSourceCommand, GetGraphqlApiCommand, GetIntrospectionSchemaCommand, GetResolverCommand, ListApiKeysCommand, ListGraphqlApisCommand, NotFoundException as NotFoundException$4, StartSchemaCreationCommand, TagResourceCommand as TagResourceCommand$14, UntagResourceCommand as UntagResourceCommand$13, UpdateApiKeyCommand, UpdateDataSourceCommand, UpdateGraphqlApiCommand, UpdateResolverCommand } from "@aws-sdk/client-appsync";
55
55
  import { parse, print } from "graphql";
56
56
  import { CrawlerRunningException, CreateConnectionCommand, CreateCrawlerCommand, CreateDatabaseCommand, CreateJobCommand, CreateSecurityConfigurationCommand, CreateTableCommand as CreateTableCommand$1, CreateTriggerCommand, CreateWorkflowCommand, DeleteConnectionCommand, DeleteCrawlerCommand, DeleteDatabaseCommand, DeleteJobCommand, DeleteSecurityConfigurationCommand, DeleteTableCommand as DeleteTableCommand$1, DeleteTriggerCommand, DeleteWorkflowCommand, EntityNotFoundException, GetConnectionCommand, GetCrawlerCommand, GetDatabaseCommand, GetDatabasesCommand, GetJobCommand, GetSecurityConfigurationCommand, GetSecurityConfigurationsCommand, GetTableCommand, GetTablesCommand, GetTagsCommand, GetTriggerCommand, GetWorkflowCommand, GlueClient, ListWorkflowsCommand, StartCrawlerScheduleCommand, StartTriggerCommand, StopCrawlerCommand, StopCrawlerScheduleCommand, StopTriggerCommand, UpdateConnectionCommand, UpdateCrawlerCommand, UpdateDatabaseCommand, UpdateJobCommand, UpdateTableCommand as UpdateTableCommand$1, UpdateTriggerCommand, UpdateWorkflowCommand } from "@aws-sdk/client-glue";
57
- import { AddTagsToStreamCommand, CreateStreamCommand, DecreaseStreamRetentionPeriodCommand, DeleteStreamCommand, DeregisterStreamConsumerCommand, DescribeStreamCommand, DescribeStreamConsumerCommand, IncreaseStreamRetentionPeriodCommand, KinesisClient, ListStreamsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$17, ListTagsForStreamCommand, RegisterStreamConsumerCommand, RemoveTagsFromStreamCommand, ResourceNotFoundException as ResourceNotFoundException$8, StartStreamEncryptionCommand, StopStreamEncryptionCommand, TagResourceCommand as TagResourceCommand$15, UntagResourceCommand as UntagResourceCommand$14, UpdateShardCountCommand } from "@aws-sdk/client-kinesis";
57
+ import { AddTagsToStreamCommand, CreateStreamCommand, DecreaseStreamRetentionPeriodCommand, DeleteStreamCommand, DeregisterStreamConsumerCommand, DescribeStreamCommand, DescribeStreamConsumerCommand, DescribeStreamSummaryCommand, IncreaseStreamRetentionPeriodCommand, KinesisClient, ListStreamsCommand, ListTagsForResourceCommand as ListTagsForResourceCommand$17, ListTagsForStreamCommand, RegisterStreamConsumerCommand, RemoveTagsFromStreamCommand, ResourceNotFoundException as ResourceNotFoundException$8, StartStreamEncryptionCommand, StopStreamEncryptionCommand, TagResourceCommand as TagResourceCommand$15, UntagResourceCommand as UntagResourceCommand$14, UpdateShardCountCommand, UpdateStreamModeCommand } from "@aws-sdk/client-kinesis";
58
58
  import { AccessPointNotFound, CreateAccessPointCommand, CreateFileSystemCommand, CreateMountTargetCommand, DeleteAccessPointCommand, DeleteFileSystemCommand, DeleteMountTargetCommand, DescribeAccessPointsCommand, DescribeBackupPolicyCommand, DescribeFileSystemPolicyCommand, DescribeFileSystemsCommand, DescribeLifecycleConfigurationCommand, DescribeMountTargetSecurityGroupsCommand, DescribeMountTargetsCommand, EFSClient, FileSystemNotFound, ModifyMountTargetSecurityGroupsCommand, MountTargetNotFound, PutBackupPolicyCommand, PutFileSystemPolicyCommand, PutLifecycleConfigurationCommand, UpdateFileSystemCommand, UpdateFileSystemProtectionCommand } from "@aws-sdk/client-efs";
59
59
  import { CreateDeliveryStreamCommand, DeleteDeliveryStreamCommand, DescribeDeliveryStreamCommand, FirehoseClient, ListDeliveryStreamsCommand, ListTagsForDeliveryStreamCommand, ResourceNotFoundException as ResourceNotFoundException$9, TagDeliveryStreamCommand, UntagDeliveryStreamCommand, UpdateDestinationCommand } from "@aws-sdk/client-firehose";
60
60
  import { AddTagsCommand as AddTagsCommand$1, CloudTrailClient, CreateTrailCommand, DeleteTrailCommand, GetEventSelectorsCommand, GetInsightSelectorsCommand, GetTrailCommand, GetTrailStatusCommand, ListTagsCommand as ListTagsCommand$1, ListTrailsCommand, PutEventSelectorsCommand, PutInsightSelectorsCommand, RemoveTagsCommand as RemoveTagsCommand$1, StartLoggingCommand, StopLoggingCommand, TrailNotFoundException, UpdateTrailCommand } from "@aws-sdk/client-cloudtrail";
@@ -1445,7 +1445,7 @@ const FLUSH_INTERVAL_MS = 2e3;
1445
1445
  const FLUSH_EVENT_THRESHOLD = 50;
1446
1446
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
1447
1447
  function getCdkdVersion() {
1448
- return "0.230.4";
1448
+ return "0.230.5";
1449
1449
  }
1450
1450
  /**
1451
1451
  * Generate a time-sortable unique run id, e.g.
@@ -30918,15 +30918,29 @@ var KinesisStreamProvider = class {
30918
30918
  /**
30919
30919
  * Update a Kinesis stream
30920
30920
  *
30921
- * Supports updating ShardCount for PROVISIONED mode streams.
30922
- * StreamMode and Name changes require replacement (handled by deployment layer).
30921
+ * Supports switching StreamMode (PROVISIONED <-> ON_DEMAND, via
30922
+ * UpdateStreamMode), updating ShardCount for PROVISIONED mode streams,
30923
+ * RetentionPeriodHours, StreamEncryption, and Tags. Name changes require
30924
+ * replacement (handled by the deployment layer).
30923
30925
  */
30924
30926
  async update(logicalId, physicalId, resourceType, properties, previousProperties) {
30925
30927
  this.logger.debug(`Updating Kinesis stream ${logicalId}: ${physicalId}`);
30926
30928
  try {
30927
- if ((properties["StreamModeDetails"]?.["StreamMode"] || "PROVISIONED") === "PROVISIONED") {
30929
+ const streamMode = properties["StreamModeDetails"]?.["StreamMode"] || "PROVISIONED";
30930
+ const oldStreamMode = previousProperties["StreamModeDetails"]?.["StreamMode"] || "PROVISIONED";
30931
+ const modeChanged = oldStreamMode !== streamMode;
30932
+ if (modeChanged) {
30933
+ const streamArn = await this.resolveStreamArn(physicalId);
30934
+ this.logger.debug(`Switching stream mode for ${physicalId}: ${oldStreamMode} -> ${streamMode}`);
30935
+ await this.getClient().send(new UpdateStreamModeCommand({
30936
+ StreamARN: streamArn,
30937
+ StreamModeDetails: { StreamMode: streamMode }
30938
+ }));
30939
+ await this.waitForStreamActive(physicalId);
30940
+ }
30941
+ if (streamMode === "PROVISIONED") {
30928
30942
  const newShardCount = Number(properties["ShardCount"] ?? 1);
30929
- const oldShardCount = Number(previousProperties["ShardCount"] ?? 1);
30943
+ const oldShardCount = modeChanged ? await this.getOpenShardCount(physicalId) : Number(previousProperties["ShardCount"] ?? 1);
30930
30944
  if (newShardCount !== oldShardCount) {
30931
30945
  this.logger.debug(`Updating shard count for ${physicalId}: ${oldShardCount} -> ${newShardCount}`);
30932
30946
  await this.getClient().send(new UpdateShardCountCommand({
@@ -31146,6 +31160,26 @@ var KinesisStreamProvider = class {
31146
31160
  }
31147
31161
  throw new Error(`Stream ${streamName} did not reach ACTIVE status within ${maxAttempts * 2} seconds`);
31148
31162
  }
31163
+ /**
31164
+ * Resolve a stream's ARN from its name. UpdateStreamMode is one of the few
31165
+ * Kinesis APIs that takes a StreamARN rather than a StreamName, so an
31166
+ * update that switches StreamModeDetails needs the ARN.
31167
+ */
31168
+ async resolveStreamArn(streamName) {
31169
+ const arn = (await this.getClient().send(new DescribeStreamSummaryCommand({ StreamName: streamName }))).StreamDescriptionSummary?.StreamARN;
31170
+ if (!arn) throw new Error(`Unable to resolve StreamARN for stream ${streamName}`);
31171
+ return arn;
31172
+ }
31173
+ /**
31174
+ * Read the stream's current open shard count. Used after an
31175
+ * ON_DEMAND -> PROVISIONED mode switch, where previousProperties carries no
31176
+ * ShardCount and AWS has assigned its own count, so reconciling against the
31177
+ * live count (not the absent state value) is the only correct base.
31178
+ */
31179
+ async getOpenShardCount(streamName) {
31180
+ const response = await this.getClient().send(new DescribeStreamSummaryCommand({ StreamName: streamName }));
31181
+ return Number(response.StreamDescriptionSummary?.OpenShardCount ?? 1);
31182
+ }
31149
31183
  };
31150
31184
 
31151
31185
  //#endregion
@@ -55195,7 +55229,7 @@ function reorderArgs(argv) {
55195
55229
  async function main() {
55196
55230
  installPipeCloseHandler();
55197
55231
  const program = new Command();
55198
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.230.4");
55232
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.230.5");
55199
55233
  program.addCommand(createBootstrapCommand());
55200
55234
  program.addCommand(createSynthCommand());
55201
55235
  program.addCommand(createListCommand());