@go-to-k/cdkd 0.278.55 → 0.280.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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { $ as DiffCalculator, $t as resolveBucketRegion, A as red, At as getDockerImageBySourceHash, B as isTerminationProtectionPropagationError, Bt as resolveStateBucketWithDefaultAndSource, C as isStatefulRecreateTargetSync, Ct as validateContainerRepoName, D as cyan, Dt as runDockerForeground, E as bold, En as withErrorHandling, Et as getDockerCmd, F as ProviderRegistry, Ft as resolveApp, G as normalizeAwsTagsToCfn, Gt as CFN_TEMPLATE_URL_LIMIT, H as cfnRefValueFromPhysicalId, Ht as stateBucketExistenceConfirmed, I as findActionableSilentDrops, It as resolveAutoAssetStorage, J as readConfigString, Jt as uploadCfnTemplate, K as resolveExplicitPhysicalId, Kt as MIGRATE_TMP_PREFIX, L as CloudControlProvider, Lt as resolveCaptureObservedState, M as IAMRoleProvider, Mt as synthesisStatusMessage, N as collectInlinePolicyNamesManagedBySiblings, Nt as getDefaultStateBucketName, O as gray, Ot as runDockerStreaming, P as clearOnUpdateRemoval, Pt as getLegacyStateBucketName, Q as applyRoleArnIfSet, R as slowCcOperationTimeoutMs, Rt as resolveSkipPrefix, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, St as validateAssetBucketName, T as formatResourceLine, Tn as normalizeAwsError, Tt as formatDockerLoginError, U as refStateLookupFromResource, Ut as warnDeprecatedNoPrefixCliFlag, V as IntrinsicFunctionResolver, Vt as resolveUseCdkBootstrapAssets, W as WAFv2WebACLProvider, Wt as CFN_TEMPLATE_BODY_LIMIT, X as requireConfigArray, Xt as AssemblyReader, Y as replayWarn, Yt as expectedOwnerParam, Z as requireConfigString, Zt as processStackMessages, _ as createPreDeleteFinalSnapshot, _n as ResourceTimeoutError, _t as AssetModeResolver, a as DeploymentEventsStore, an as CdkdError, at as TemplateParser, b as unsupportedFinalSnapshotError, bn as StackTerminationProtectionError, bt as getBootstrapMarkerKey, c as replayFailedOperations, cn as DeployCancelledError, ct as rebuildClientForBucketRegion, d as IMPLICIT_DELETE_DEPENDENCIES, dn as LocalStartServiceError, dt as stringifyValue, en as AwsClients, et as describeTypeWithThrottleRetry, f as computeImplicitDeleteEdges, ft as WorkGraph, g as ccRoutedFinalSnapshotError, gn as ProvisioningError, gt as rewriteTemplateAssetReferences, h as buildFinalSnapshotIdentifier, hn as PartialFailureError, ht as loadPublishableAssetManifest, i as DeploymentEventsReader, it as DagBuilder, j as yellow, jt as Synthesizer, k as green, kt as AssetManifestLoader, l as replayRollback, ln as LocalInvokeBuildError$1, lt as shouldRetainResource, m as PRE_DELETE_SNAPSHOT_TYPES, mn as NestedStackChildDirectDestroyError, mt as createAssetRedirectResolver, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as resetAwsClients, nt as isRetryableTransientError, o as planFailedOps, ot as LockManager, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as MissingCdkCliError, pt as buildAssetRedirectMap, q as assertRegionMatch, qt as findLargeInlineResources, r as DeployEngine, rn as setAwsClients, rt as isThrottlingError, s as planRollback, st as S3StateBackend, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as getAwsClients, tt as withRetry, u as withResourceDeadline, un as LocalMigrateError, ut as AssetPublisher, v as isFinalSnapshotError, vn as ResourceUpdateNotSupportedError, vt as BOOTSTRAP_MARKER_PREFIX, w as renderStatefulReason, wt as buildDockerImage, x as extractDeploymentEventError, xt as parseBootstrapMarker, y as refusesFinalSnapshot, yn as StackHasActiveImportsError, yt as ensureAssetStorage, z as disableInstanceApiTermination, zt as resolveStateBucketWithDefault } from "./deploy-engine-CJkdO-cZ.js";
2
+ import { $ as DiffCalculator, $t as resolveBucketRegion, A as red, At as getDockerImageBySourceHash, B as isTerminationProtectionPropagationError, Bt as resolveStateBucketWithDefaultAndSource, C as isStatefulRecreateTargetSync, Ct as validateContainerRepoName, D as cyan, Dt as runDockerForeground, E as bold, En as withErrorHandling, Et as getDockerCmd, F as ProviderRegistry, Ft as resolveApp, G as normalizeAwsTagsToCfn, Gt as CFN_TEMPLATE_URL_LIMIT, H as cfnRefValueFromPhysicalId, Ht as stateBucketExistenceConfirmed, I as findActionableSilentDrops, It as resolveAutoAssetStorage, J as readConfigString, Jt as uploadCfnTemplate, K as resolveExplicitPhysicalId, Kt as MIGRATE_TMP_PREFIX, L as CloudControlProvider, Lt as resolveCaptureObservedState, M as IAMRoleProvider, Mt as synthesisStatusMessage, N as collectInlinePolicyNamesManagedBySiblings, Nt as getDefaultStateBucketName, O as gray, Ot as runDockerStreaming, P as clearOnUpdateRemoval, Pt as getLegacyStateBucketName, Q as applyRoleArnIfSet, R as slowCcOperationTimeoutMs, Rt as resolveSkipPrefix, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, St as validateAssetBucketName, T as formatResourceLine, Tn as normalizeAwsError, Tt as formatDockerLoginError, U as refStateLookupFromResource, Ut as warnDeprecatedNoPrefixCliFlag, V as IntrinsicFunctionResolver, Vt as resolveUseCdkBootstrapAssets, W as WAFv2WebACLProvider, Wt as CFN_TEMPLATE_BODY_LIMIT, X as requireConfigArray, Xt as AssemblyReader, Y as replayWarn, Yt as expectedOwnerParam, Z as requireConfigString, Zt as processStackMessages, _ as createPreDeleteFinalSnapshot, _n as ResourceTimeoutError, _t as AssetModeResolver, a as DeploymentEventsStore, an as CdkdError, at as TemplateParser, b as unsupportedFinalSnapshotError, bn as StackTerminationProtectionError, bt as getBootstrapMarkerKey, c as replayFailedOperations, cn as DeployCancelledError, ct as rebuildClientForBucketRegion, d as IMPLICIT_DELETE_DEPENDENCIES, dn as LocalStartServiceError, dt as stringifyValue, en as AwsClients, et as describeTypeWithThrottleRetry, f as computeImplicitDeleteEdges, ft as WorkGraph, g as ccRoutedFinalSnapshotError, gn as ProvisioningError, gt as rewriteTemplateAssetReferences, h as buildFinalSnapshotIdentifier, hn as PartialFailureError, ht as loadPublishableAssetManifest, i as DeploymentEventsReader, it as DagBuilder, j as yellow, jt as Synthesizer, k as green, kt as AssetManifestLoader, l as replayRollback, ln as LocalInvokeBuildError$1, lt as shouldRetainResource, m as PRE_DELETE_SNAPSHOT_TYPES, mn as NestedStackChildDirectDestroyError, mt as createAssetRedirectResolver, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as resetAwsClients, nt as isRetryableTransientError, o as planFailedOps, ot as LockManager, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as MissingCdkCliError, pt as buildAssetRedirectMap, q as assertRegionMatch, qt as findLargeInlineResources, r as DeployEngine, rn as setAwsClients, rt as isThrottlingError, s as planRollback, st as S3StateBackend, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as getAwsClients, tt as withRetry, u as withResourceDeadline, un as LocalMigrateError, ut as AssetPublisher, v as isFinalSnapshotError, vn as ResourceUpdateNotSupportedError, vt as BOOTSTRAP_MARKER_PREFIX, w as renderStatefulReason, wt as buildDockerImage, x as extractDeploymentEventError, xt as parseBootstrapMarker, y as refusesFinalSnapshot, yn as StackHasActiveImportsError, yt as ensureAssetStorage, z as disableInstanceApiTermination, zt as resolveStateBucketWithDefault } from "./deploy-engine-DRLo8PHT.js";
3
3
  import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, f as withSkipPrefix, i as runStackBuffered, n as getLogger, o as PATTERN_B_NAME_OPTIONS, p as withStackName, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-BYMEE-BS.js";
4
- import { t as ASGProvider } from "./asg-provider-BSJ8OWXR.js";
4
+ import { t as ASGProvider } from "./asg-provider-XOMGgJrK.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";
@@ -17445,11 +17445,17 @@ var EC2Provider = class {
17445
17445
  "RouteTableId",
17446
17446
  "DestinationCidrBlock",
17447
17447
  "DestinationIpv6CidrBlock",
17448
+ "DestinationPrefixListId",
17449
+ "CarrierGatewayId",
17450
+ "CoreNetworkArn",
17448
17451
  "GatewayId",
17452
+ "LocalGatewayId",
17449
17453
  "NatGatewayId",
17450
17454
  "EgressOnlyInternetGatewayId",
17451
17455
  "InstanceId",
17452
17456
  "NetworkInterfaceId",
17457
+ "TransitGatewayId",
17458
+ "VpcEndpointId",
17453
17459
  "VpcPeeringConnectionId"
17454
17460
  ])],
17455
17461
  ["AWS::EC2::SubnetRouteTableAssociation", /* @__PURE__ */ new Set(["SubnetId", "RouteTableId"])],
@@ -18227,21 +18233,26 @@ var EC2Provider = class {
18227
18233
  const routeTableId = properties["RouteTableId"];
18228
18234
  const destinationCidrBlock = properties["DestinationCidrBlock"];
18229
18235
  const destinationIpv6CidrBlock = properties["DestinationIpv6CidrBlock"];
18230
- const cidr = destinationCidrBlock || destinationIpv6CidrBlock;
18231
- if (!routeTableId || !cidr) throw new ProvisioningError(`RouteTableId and DestinationCidrBlock/DestinationIpv6CidrBlock are required for Route ${logicalId}`, resourceType, logicalId);
18232
- const isIpv6 = !destinationCidrBlock && !!destinationIpv6CidrBlock;
18236
+ const destinationPrefixListId = properties["DestinationPrefixListId"];
18237
+ const destination = destinationCidrBlock || destinationIpv6CidrBlock || destinationPrefixListId;
18238
+ if (!routeTableId || !destination) throw new ProvisioningError(`RouteTableId and one of DestinationCidrBlock/DestinationIpv6CidrBlock/DestinationPrefixListId are required for Route ${logicalId}`, resourceType, logicalId);
18233
18239
  try {
18234
18240
  await this.ec2Client.send(new CreateRouteCommand({
18235
18241
  RouteTableId: routeTableId,
18236
- ...isIpv6 ? { DestinationIpv6CidrBlock: destinationIpv6CidrBlock } : { DestinationCidrBlock: destinationCidrBlock },
18242
+ ...destinationCidrBlock ? { DestinationCidrBlock: destinationCidrBlock } : destinationIpv6CidrBlock ? { DestinationIpv6CidrBlock: destinationIpv6CidrBlock } : { DestinationPrefixListId: destinationPrefixListId },
18243
+ CarrierGatewayId: properties["CarrierGatewayId"] ?? void 0,
18244
+ CoreNetworkArn: properties["CoreNetworkArn"] ?? void 0,
18237
18245
  GatewayId: properties["GatewayId"] ?? void 0,
18246
+ LocalGatewayId: properties["LocalGatewayId"] ?? void 0,
18238
18247
  NatGatewayId: properties["NatGatewayId"] ?? void 0,
18239
18248
  EgressOnlyInternetGatewayId: properties["EgressOnlyInternetGatewayId"] ?? void 0,
18240
18249
  InstanceId: properties["InstanceId"] ?? void 0,
18241
18250
  NetworkInterfaceId: properties["NetworkInterfaceId"] ?? void 0,
18251
+ TransitGatewayId: properties["TransitGatewayId"] ?? void 0,
18252
+ VpcEndpointId: properties["VpcEndpointId"] ?? void 0,
18242
18253
  VpcPeeringConnectionId: properties["VpcPeeringConnectionId"] ?? void 0
18243
18254
  }));
18244
- const physicalId = `${routeTableId}|${cidr}`;
18255
+ const physicalId = `${routeTableId}|${destination}`;
18245
18256
  this.logger.debug(`Successfully created Route ${logicalId}: ${physicalId}`);
18246
18257
  return {
18247
18258
  physicalId,
@@ -18275,13 +18286,13 @@ var EC2Provider = class {
18275
18286
  async deleteRoute(logicalId, physicalId, resourceType, context) {
18276
18287
  this.logger.debug(`Deleting Route ${logicalId}: ${physicalId}`);
18277
18288
  const parts = physicalId.split("|");
18278
- if (parts.length !== 2) throw new ProvisioningError(`Invalid physicalId format for Route ${logicalId}: expected "RouteTableId|DestinationCidrBlock", got "${physicalId}"`, resourceType, logicalId, physicalId);
18279
- const [routeTableId, destinationCidrBlock] = parts;
18289
+ if (parts.length !== 2) throw new ProvisioningError(`Invalid physicalId format for Route ${logicalId}: expected "RouteTableId|Destination", got "${physicalId}"`, resourceType, logicalId, physicalId);
18290
+ const [routeTableId, destination] = parts;
18280
18291
  try {
18281
- const isIpv6 = destinationCidrBlock?.includes(":");
18292
+ const destinationParam = destination?.includes(":") ? { DestinationIpv6CidrBlock: destination } : destination?.startsWith("pl-") ? { DestinationPrefixListId: destination } : { DestinationCidrBlock: destination };
18282
18293
  await this.ec2Client.send(new DeleteRouteCommand({
18283
18294
  RouteTableId: routeTableId,
18284
- ...isIpv6 ? { DestinationIpv6CidrBlock: destinationCidrBlock } : { DestinationCidrBlock: destinationCidrBlock }
18295
+ ...destinationParam
18285
18296
  }));
18286
18297
  this.logger.debug(`Successfully deleted Route ${logicalId}`);
18287
18298
  } catch (error) {
@@ -19856,28 +19867,31 @@ var EC2Provider = class {
19856
19867
  /**
19857
19868
  * AWS::EC2::Route readCurrentState.
19858
19869
  *
19859
- * physicalId format: `<routeTableId>|<cidr>` where cidr is either v4 or v6.
19870
+ * physicalId format: `<routeTableId>|<destination>` where destination is a
19871
+ * v4 CIDR, a v6 CIDR, or a managed prefix list id (`pl-...`).
19860
19872
  * AWS API: `DescribeRouteTables(routeTableId)` → walk `Routes[]` for the
19861
- * entry whose `DestinationCidrBlock` or `DestinationIpv6CidrBlock` matches
19862
- * the cidr. Returns `undefined` when the route table is gone or the route
19863
- * has been removed.
19873
+ * entry whose `DestinationCidrBlock`, `DestinationIpv6CidrBlock`, or
19874
+ * `DestinationPrefixListId` matches the destination. Returns `undefined`
19875
+ * when the route table is gone or the route has been removed.
19864
19876
  *
19865
19877
  * Surfaces the target field (`GatewayId` / `NatGatewayId` / `InstanceId` /
19866
19878
  * `NetworkInterfaceId` / `VpcPeeringConnectionId` / `EgressOnlyInternetGatewayId` /
19867
- * `TransitGatewayId` / `VpcEndpointId`) AWS reports for that route. Drift
19868
- * signal: route target changed.
19879
+ * `TransitGatewayId` / `LocalGatewayId` / `CarrierGatewayId` / `CoreNetworkArn` /
19880
+ * `VpcEndpointId`) AWS reports for that route. Drift signal: route target changed.
19869
19881
  */
19870
19882
  async readRouteCurrentState(physicalId) {
19871
- const [rtbId, cidr] = physicalId.split("|");
19872
- if (!rtbId || !cidr) return void 0;
19883
+ const [rtbId, destination] = physicalId.split("|");
19884
+ if (!rtbId || !destination) return void 0;
19873
19885
  const rtb = (await this.ec2Client.send(new DescribeRouteTablesCommand({ RouteTableIds: [rtbId] }))).RouteTables?.[0];
19874
19886
  if (!rtb) return void 0;
19875
- const route = rtb.Routes?.find((r) => r.DestinationCidrBlock === cidr || r.DestinationIpv6CidrBlock === cidr);
19887
+ const route = rtb.Routes?.find((r) => r.DestinationCidrBlock === destination || r.DestinationIpv6CidrBlock === destination || r.DestinationPrefixListId === destination);
19876
19888
  if (!route) return void 0;
19877
19889
  const result = { RouteTableId: rtbId };
19878
19890
  if (route.DestinationCidrBlock !== void 0) result["DestinationCidrBlock"] = route.DestinationCidrBlock;
19879
19891
  else if (route.DestinationIpv6CidrBlock !== void 0) result["DestinationIpv6CidrBlock"] = route.DestinationIpv6CidrBlock;
19880
- if (route.GatewayId !== void 0) result["GatewayId"] = route.GatewayId;
19892
+ else if (route.DestinationPrefixListId !== void 0) result["DestinationPrefixListId"] = route.DestinationPrefixListId;
19893
+ if (route.GatewayId !== void 0) if (route.GatewayId.startsWith("vpce-")) result["VpcEndpointId"] = route.GatewayId;
19894
+ else result["GatewayId"] = route.GatewayId;
19881
19895
  if (route.NatGatewayId !== void 0) result["NatGatewayId"] = route.NatGatewayId;
19882
19896
  if (route.InstanceId !== void 0) result["InstanceId"] = route.InstanceId;
19883
19897
  if (route.NetworkInterfaceId !== void 0) result["NetworkInterfaceId"] = route.NetworkInterfaceId;
@@ -20252,7 +20266,13 @@ var ApiGatewayProvider = class ApiGatewayProvider {
20252
20266
  "Tags",
20253
20267
  "TracingEnabled",
20254
20268
  "Variables",
20255
- "MethodSettings"
20269
+ "MethodSettings",
20270
+ "AccessLogSetting",
20271
+ "CacheClusterEnabled",
20272
+ "CacheClusterSize",
20273
+ "CanarySetting",
20274
+ "ClientCertificateId",
20275
+ "DocumentationVersion"
20256
20276
  ])],
20257
20277
  ["AWS::ApiGateway::Method", /* @__PURE__ */ new Set([
20258
20278
  "RestApiId",
@@ -20735,7 +20755,12 @@ var ApiGatewayProvider = class ApiGatewayProvider {
20735
20755
  const stageName = properties["StageName"];
20736
20756
  const deploymentId = properties["DeploymentId"];
20737
20757
  if (!restApiId || !stageName || !deploymentId) throw new ProvisioningError(`RestApiId, StageName, and DeploymentId are required for API Gateway Stage ${logicalId}`, resourceType, logicalId);
20758
+ for (const key of ["AccessLogSetting", "CanarySetting"]) {
20759
+ const block = properties[key];
20760
+ if (block != null && !isPlainObjectBlock(block)) throw new ProvisioningError(`AWS::ApiGateway::Stage ${key} for ${logicalId} must be an object block; got ${Array.isArray(block) ? "an array" : typeof block}. Fix the template value instead of letting cdkd drop the config.`, resourceType, logicalId);
20761
+ }
20738
20762
  try {
20763
+ const rawCacheClusterSize = properties["CacheClusterSize"];
20739
20764
  await this.apiGatewayClient.send(new CreateStageCommand({
20740
20765
  restApiId,
20741
20766
  stageName,
@@ -20743,15 +20768,38 @@ var ApiGatewayProvider = class ApiGatewayProvider {
20743
20768
  description: properties["Description"],
20744
20769
  tracingEnabled: properties["TracingEnabled"],
20745
20770
  variables: properties["Variables"],
20746
- tags: this.cfnTagsToRecord(properties["Tags"])
20771
+ tags: this.cfnTagsToRecord(properties["Tags"]),
20772
+ cacheClusterEnabled: properties["CacheClusterEnabled"],
20773
+ cacheClusterSize: rawCacheClusterSize != null ? String(rawCacheClusterSize) : void 0,
20774
+ documentationVersion: properties["DocumentationVersion"],
20775
+ canarySettings: toSdkCanarySettings(properties["CanarySetting"])
20747
20776
  }));
20748
20777
  const methodSettings = properties["MethodSettings"];
20749
- const methodSettingsOps = buildMethodSettingsPatchOps(void 0, methodSettings);
20750
- if (methodSettingsOps.length > 0) try {
20778
+ const postCreateOps = buildMethodSettingsPatchOps(void 0, methodSettings);
20779
+ const accessLogSetting = properties["AccessLogSetting"];
20780
+ if (accessLogSetting != null) {
20781
+ if (accessLogSetting.DestinationArn !== void 0) postCreateOps.push({
20782
+ op: "replace",
20783
+ path: "/accessLogSettings/destinationArn",
20784
+ value: normalizeAccessLogDestinationArn(String(accessLogSetting.DestinationArn))
20785
+ });
20786
+ if (accessLogSetting.Format !== void 0) postCreateOps.push({
20787
+ op: "replace",
20788
+ path: "/accessLogSettings/format",
20789
+ value: String(accessLogSetting.Format)
20790
+ });
20791
+ }
20792
+ const clientCertificateId = properties["ClientCertificateId"];
20793
+ if (clientCertificateId !== void 0) postCreateOps.push({
20794
+ op: "replace",
20795
+ path: "/clientCertificateId",
20796
+ value: clientCertificateId
20797
+ });
20798
+ if (postCreateOps.length > 0) try {
20751
20799
  await this.apiGatewayClient.send(new UpdateStageCommand({
20752
20800
  restApiId,
20753
20801
  stageName,
20754
- patchOperations: methodSettingsOps
20802
+ patchOperations: postCreateOps
20755
20803
  }));
20756
20804
  } catch (patchError) {
20757
20805
  try {
@@ -20760,7 +20808,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
20760
20808
  stageName
20761
20809
  }));
20762
20810
  } catch (cleanupError) {
20763
- this.logger.warn(`Failed to clean up stage ${stageName} after a MethodSettings patch failure: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`);
20811
+ this.logger.warn(`Failed to clean up stage ${stageName} after a post-create patch failure: ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}`);
20764
20812
  }
20765
20813
  throw patchError;
20766
20814
  }
@@ -20803,6 +20851,91 @@ var ApiGatewayProvider = class ApiGatewayProvider {
20803
20851
  path: "/tracingEnabled",
20804
20852
  value: String(tracingEnabled ?? false)
20805
20853
  });
20854
+ const cacheClusterEnabled = properties["CacheClusterEnabled"];
20855
+ if (cacheClusterEnabled !== previousProperties["CacheClusterEnabled"]) patchOperations.push({
20856
+ op: "replace",
20857
+ path: "/cacheClusterEnabled",
20858
+ value: String(cacheClusterEnabled ?? false)
20859
+ });
20860
+ const rawCacheClusterSize = properties["CacheClusterSize"];
20861
+ const prevRawCacheClusterSize = previousProperties["CacheClusterSize"];
20862
+ if (rawCacheClusterSize != null && (prevRawCacheClusterSize == null || String(rawCacheClusterSize) !== String(prevRawCacheClusterSize))) patchOperations.push({
20863
+ op: "replace",
20864
+ path: "/cacheClusterSize",
20865
+ value: String(rawCacheClusterSize)
20866
+ });
20867
+ const clientCertificateId = properties["ClientCertificateId"];
20868
+ if (clientCertificateId !== previousProperties["ClientCertificateId"]) patchOperations.push({
20869
+ op: "replace",
20870
+ path: "/clientCertificateId",
20871
+ value: clientCertificateId ?? ""
20872
+ });
20873
+ const documentationVersion = properties["DocumentationVersion"];
20874
+ if (documentationVersion !== previousProperties["DocumentationVersion"]) patchOperations.push({
20875
+ op: "replace",
20876
+ path: "/documentationVersion",
20877
+ value: documentationVersion ?? ""
20878
+ });
20879
+ const rawAccessLog = properties["AccessLogSetting"];
20880
+ const accessLogMalformed = rawAccessLog != null && !isPlainObjectBlock(rawAccessLog);
20881
+ if (accessLogMalformed) this.logger.warn(`AWS::ApiGateway::Stage AccessLogSetting for ${logicalId} is not an object block (got ${Array.isArray(rawAccessLog) ? "an array" : typeof rawAccessLog}); leaving the live access-log config untouched.`);
20882
+ const accessLog = accessLogMalformed ? void 0 : rawAccessLog;
20883
+ const prevAccessLog = previousProperties["AccessLogSetting"];
20884
+ if (accessLogMalformed) {} else if (accessLog == null) {
20885
+ if (prevAccessLog != null) patchOperations.push({
20886
+ op: "remove",
20887
+ path: "/accessLogSettings"
20888
+ });
20889
+ } else {
20890
+ if (accessLog.DestinationArn !== prevAccessLog?.DestinationArn) patchOperations.push({
20891
+ op: "replace",
20892
+ path: "/accessLogSettings/destinationArn",
20893
+ value: accessLog.DestinationArn !== void 0 ? normalizeAccessLogDestinationArn(String(accessLog.DestinationArn)) : ""
20894
+ });
20895
+ if (accessLog.Format !== prevAccessLog?.Format) patchOperations.push({
20896
+ op: "replace",
20897
+ path: "/accessLogSettings/format",
20898
+ value: accessLog.Format !== void 0 ? String(accessLog.Format) : ""
20899
+ });
20900
+ }
20901
+ const rawCanary = properties["CanarySetting"];
20902
+ const canaryMalformed = rawCanary != null && !isPlainObjectBlock(rawCanary);
20903
+ if (canaryMalformed) this.logger.warn(`AWS::ApiGateway::Stage CanarySetting for ${logicalId} is not an object block (got ${Array.isArray(rawCanary) ? "an array" : typeof rawCanary}); leaving the live canary config untouched.`);
20904
+ const canary = canaryMalformed ? void 0 : rawCanary;
20905
+ const prevCanary = previousProperties["CanarySetting"];
20906
+ if (canaryMalformed) {} else if (canary == null) {
20907
+ if (prevCanary != null) patchOperations.push({
20908
+ op: "remove",
20909
+ path: "/canarySettings"
20910
+ });
20911
+ } else {
20912
+ if (canary.PercentTraffic !== prevCanary?.PercentTraffic) patchOperations.push({
20913
+ op: "replace",
20914
+ path: "/canarySettings/percentTraffic",
20915
+ value: String(canary.PercentTraffic ?? 0)
20916
+ });
20917
+ if (canary.DeploymentId !== prevCanary?.DeploymentId) patchOperations.push({
20918
+ op: "replace",
20919
+ path: "/canarySettings/deploymentId",
20920
+ value: canary.DeploymentId ?? ""
20921
+ });
20922
+ if (canary.UseStageCache !== prevCanary?.UseStageCache) patchOperations.push({
20923
+ op: "replace",
20924
+ path: "/canarySettings/useStageCache",
20925
+ value: String(canary.UseStageCache ?? false)
20926
+ });
20927
+ const overrides = canary.StageVariableOverrides ?? {};
20928
+ const prevOverrides = prevCanary?.StageVariableOverrides ?? {};
20929
+ for (const [key, value] of Object.entries(overrides)) if (prevOverrides[key] !== value) patchOperations.push({
20930
+ op: "replace",
20931
+ path: `/canarySettings/stageVariableOverrides/${key}`,
20932
+ value
20933
+ });
20934
+ for (const key of Object.keys(prevOverrides)) if (!(key in overrides)) patchOperations.push({
20935
+ op: "remove",
20936
+ path: `/canarySettings/stageVariableOverrides/${key}`
20937
+ });
20938
+ }
20806
20939
  const variables = properties["Variables"] ?? {};
20807
20940
  const prevVariables = previousProperties["Variables"] ?? {};
20808
20941
  for (const [key, value] of Object.entries(variables)) if (prevVariables[key] !== value) patchOperations.push({
@@ -21319,6 +21452,24 @@ var ApiGatewayProvider = class ApiGatewayProvider {
21319
21452
  result["Description"] = resp.description ?? "";
21320
21453
  if (resp.tracingEnabled !== void 0) result["TracingEnabled"] = resp.tracingEnabled;
21321
21454
  if (resp.variables !== void 0) result["Variables"] = resp.variables;
21455
+ if (resp.cacheClusterEnabled !== void 0) result["CacheClusterEnabled"] = resp.cacheClusterEnabled;
21456
+ if (resp.cacheClusterSize !== void 0) result["CacheClusterSize"] = resp.cacheClusterSize;
21457
+ if (resp.clientCertificateId !== void 0) result["ClientCertificateId"] = resp.clientCertificateId;
21458
+ if (resp.documentationVersion !== void 0) result["DocumentationVersion"] = resp.documentationVersion;
21459
+ if (resp.accessLogSettings !== void 0) {
21460
+ const accessLog = {};
21461
+ if (resp.accessLogSettings.destinationArn !== void 0) accessLog["DestinationArn"] = resp.accessLogSettings.destinationArn;
21462
+ if (resp.accessLogSettings.format !== void 0) accessLog["Format"] = resp.accessLogSettings.format;
21463
+ result["AccessLogSetting"] = accessLog;
21464
+ }
21465
+ if (resp.canarySettings !== void 0) {
21466
+ const canary = {};
21467
+ if (resp.canarySettings.percentTraffic !== void 0) canary["PercentTraffic"] = resp.canarySettings.percentTraffic;
21468
+ if (resp.canarySettings.deploymentId !== void 0) canary["DeploymentId"] = resp.canarySettings.deploymentId;
21469
+ if (resp.canarySettings.stageVariableOverrides !== void 0) canary["StageVariableOverrides"] = resp.canarySettings.stageVariableOverrides;
21470
+ if (resp.canarySettings.useStageCache !== void 0) canary["UseStageCache"] = resp.canarySettings.useStageCache;
21471
+ result["CanarySetting"] = canary;
21472
+ }
21322
21473
  const stateMethodSettings = properties?.["MethodSettings"];
21323
21474
  if (stateMethodSettings && stateMethodSettings.length > 0) result["MethodSettings"] = stateMethodSettings.map((stateEntry) => {
21324
21475
  const awsEntry = (resp.methodSettings ?? {})[methodSettingKey(stateEntry)];
@@ -21398,6 +21549,43 @@ var ApiGatewayProvider = class ApiGatewayProvider {
21398
21549
  }
21399
21550
  };
21400
21551
  /**
21552
+ * A nested CFn config block must be a plain object; a string, array, or
21553
+ * unresolved intrinsic that leaks through resolution indexes every sub-field
21554
+ * to `undefined` (#1471/#1493 class). Create refuses such a block; update
21555
+ * warns and skips the property.
21556
+ */
21557
+ function isPlainObjectBlock(value) {
21558
+ return typeof value === "object" && value !== null && !Array.isArray(value);
21559
+ }
21560
+ /**
21561
+ * Strip the `:*` suffix off a CloudWatch Logs log-group ARN.
21562
+ *
21563
+ * CDK's canonical `LogGroupLogDestination` emits `Fn::GetAtt [LogGroup, Arn]`
21564
+ * for `AccessLogSetting.DestinationArn`, and a log group's Arn attribute ends
21565
+ * with `:*` — a shape API Gateway's UpdateStage REJECTS ("Access log
21566
+ * destination must only contain characters a-z, ..."). CloudFormation's Stage
21567
+ * handler normalizes the suffix and accepts the template (proven by the
21568
+ * apigw-stage-throttling fixture's CC-routed history), so the SDK provider
21569
+ * must match for parity or every CDK `deployOptions.accessLogDestination`
21570
+ * app fails on deploy (caught live by that integ, 2026-08-11).
21571
+ */
21572
+ function normalizeAccessLogDestinationArn(arn) {
21573
+ return arn.endsWith(":*") ? arn.slice(0, -2) : arn;
21574
+ }
21575
+ /**
21576
+ * Map the CFn `CanarySetting` block to the SDK `CreateStageCommand`
21577
+ * `canarySettings` shape (PascalCase -> camelCase member rename).
21578
+ */
21579
+ function toSdkCanarySettings(setting) {
21580
+ if (setting == null) return void 0;
21581
+ return {
21582
+ percentTraffic: setting.PercentTraffic,
21583
+ deploymentId: setting.DeploymentId,
21584
+ stageVariableOverrides: setting.StageVariableOverrides,
21585
+ useStageCache: setting.UseStageCache
21586
+ };
21587
+ }
21588
+ /**
21401
21589
  * CFn MethodSetting field → UpdateStage patch-path suffix under
21402
21590
  * `/{method_setting_key}/`. The get-stage response field for each is the
21403
21591
  * camelCase of the CFn name (used by the drift readback).
@@ -68100,7 +68288,7 @@ function createMigrateCommand() {
68100
68288
  */
68101
68289
  function buildProgram() {
68102
68290
  const program = new Command();
68103
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.278.55");
68291
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.280.0");
68104
68292
  program.hook("preAction", (_thisCommand, actionCommand) => {
68105
68293
  const { profile } = actionCommand.optsWithGlobals();
68106
68294
  if (profile !== void 0) process.env["AWS_PROFILE"] = profile;