@go-to-k/cdkd 0.268.4 → 0.269.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 WorkGraph, A as slowCcOperationTimeoutMs, At as warnDeprecatedNoPrefixCliFlag, B as applyRoleArnIfSet, Bt as resolveBucketRegion, C as yellow, Ct as resolveAutoAssetStorage, D as ProviderRegistry, Dt as resolveStateBucketWithDefaultAndSource, E as clearOnUpdateRemoval, Et as resolveStateBucketWithDefault, F as refStateLookupFromResource, Ft as uploadCfnTemplate, G as DagBuilder, H as describeTypeWithThrottleRetry, Ht as getAwsClients, I as WAFv2WebACLProvider, It as expectedOwnerParam, J as S3StateBackend, K as TemplateParser, Kt as CdkdError, L as normalizeAwsTagsToCfn, Lt as AssemblyReader, M as isTerminationProtectionPropagationError, Mt as CFN_TEMPLATE_URL_LIMIT, N as IntrinsicFunctionResolver, Nt as MIGRATE_TMP_PREFIX, O as findActionableSilentDrops, Ot as resolveUseCdkBootstrapAssets, P as cfnRefValueFromPhysicalId, Pt as findLargeInlineResources, Q as stringifyValue, Qt as LocalStartServiceError, R as resolveExplicitPhysicalId, Rt as processStackMessages, S as red, St as resolveApp, T as collectInlinePolicyNamesManagedBySiblings, Tt as resolveSkipPrefix, U as withRetry, Ut as resetAwsClients, V as DiffCalculator, Vt as AwsClients, W as isRetryableTransientError, Wt as setAwsClients, X as shouldRetainResource, Xt as LocalInvokeBuildError$1, Y as rebuildClientForBucketRegion, Yt as DeployCancelledError, Z as AssetPublisher, Zt as LocalMigrateError, _ as formatResourceLine, _t as getDockerImageBySourceHash, a as DeploymentEventsStore, an as ResourceUpdateNotSupportedError, at as BOOTSTRAP_MARKER_PREFIX, b as gray, bt as getDefaultStateBucketName, c as replayFailedOperations, ct as parseBootstrapMarker, d as IMPLICIT_DELETE_DEPENDENCIES, dt as buildDockerImage, en as MissingCdkCliError, et as buildAssetRedirectMap, f as computeImplicitDeleteEdges, fn as normalizeAwsError, ft as formatDockerLoginError, g as renderStatefulReason, gt as AssetManifestLoader, h as isStatefulRecreateTargetSync, ht as runDockerStreaming, i as DeploymentEventsReader, in as ResourceTimeoutError, it as AssetModeResolver, j as disableInstanceApiTermination, jt as CFN_TEMPLATE_BODY_LIMIT, k as CloudControlProvider, kt as stateBucketExistenceConfirmed, l as replayRollback, lt as validateAssetBucketName, m as MULTI_REGION_RECREATE_BLOCKED_TYPES, mt as runDockerForeground, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as PartialFailureError, nt as loadPublishableAssetManifest, o as planFailedOps, on as StackHasActiveImportsError, ot as ensureAssetStorage, p as extractDeploymentEventError, pn as withErrorHandling, pt as getDockerCmd, q as LockManager, r as DeployEngine, rn as ProvisioningError, rt as rewriteTemplateAssetReferences, s as planRollback, sn as StackTerminationProtectionError, st as getBootstrapMarkerKey, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as NestedStackChildDirectDestroyError, tt as createAssetRedirectResolver, u as withResourceDeadline, ut as validateContainerRepoName, v as bold, vt as Synthesizer, w as IAMRoleProvider, wt as resolveCaptureObservedState, x as green, xt as getLegacyStateBucketName, y as cyan, yt as synthesisStatusMessage, z as assertRegionMatch } from "./deploy-engine--qUEKkTR.js";
2
+ import { $ as WorkGraph, A as slowCcOperationTimeoutMs, At as warnDeprecatedNoPrefixCliFlag, B as applyRoleArnIfSet, Bt as resolveBucketRegion, C as yellow, Ct as resolveAutoAssetStorage, D as ProviderRegistry, Dt as resolveStateBucketWithDefaultAndSource, E as clearOnUpdateRemoval, Et as resolveStateBucketWithDefault, F as refStateLookupFromResource, Ft as uploadCfnTemplate, G as DagBuilder, H as describeTypeWithThrottleRetry, Ht as getAwsClients, I as WAFv2WebACLProvider, It as expectedOwnerParam, J as S3StateBackend, K as TemplateParser, Kt as CdkdError, L as normalizeAwsTagsToCfn, Lt as AssemblyReader, M as isTerminationProtectionPropagationError, Mt as CFN_TEMPLATE_URL_LIMIT, N as IntrinsicFunctionResolver, Nt as MIGRATE_TMP_PREFIX, O as findActionableSilentDrops, Ot as resolveUseCdkBootstrapAssets, P as cfnRefValueFromPhysicalId, Pt as findLargeInlineResources, Q as stringifyValue, Qt as LocalStartServiceError, R as resolveExplicitPhysicalId, Rt as processStackMessages, S as red, St as resolveApp, T as collectInlinePolicyNamesManagedBySiblings, Tt as resolveSkipPrefix, U as withRetry, Ut as resetAwsClients, V as DiffCalculator, Vt as AwsClients, W as isRetryableTransientError, Wt as setAwsClients, X as shouldRetainResource, Xt as LocalInvokeBuildError$1, Y as rebuildClientForBucketRegion, Yt as DeployCancelledError, Z as AssetPublisher, Zt as LocalMigrateError, _ as formatResourceLine, _t as getDockerImageBySourceHash, a as DeploymentEventsStore, an as ResourceUpdateNotSupportedError, at as BOOTSTRAP_MARKER_PREFIX, b as gray, bt as getDefaultStateBucketName, c as replayFailedOperations, ct as parseBootstrapMarker, d as IMPLICIT_DELETE_DEPENDENCIES, dt as buildDockerImage, en as MissingCdkCliError, et as buildAssetRedirectMap, f as computeImplicitDeleteEdges, fn as normalizeAwsError, ft as formatDockerLoginError, g as renderStatefulReason, gt as AssetManifestLoader, h as isStatefulRecreateTargetSync, ht as runDockerStreaming, i as DeploymentEventsReader, in as ResourceTimeoutError, it as AssetModeResolver, j as disableInstanceApiTermination, jt as CFN_TEMPLATE_BODY_LIMIT, k as CloudControlProvider, kt as stateBucketExistenceConfirmed, l as replayRollback, lt as validateAssetBucketName, m as MULTI_REGION_RECREATE_BLOCKED_TYPES, mt as runDockerForeground, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as PartialFailureError, nt as loadPublishableAssetManifest, o as planFailedOps, on as StackHasActiveImportsError, ot as ensureAssetStorage, p as extractDeploymentEventError, pn as withErrorHandling, pt as getDockerCmd, q as LockManager, r as DeployEngine, rn as ProvisioningError, rt as rewriteTemplateAssetReferences, s as planRollback, sn as StackTerminationProtectionError, st as getBootstrapMarkerKey, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as NestedStackChildDirectDestroyError, tt as createAssetRedirectResolver, u as withResourceDeadline, ut as validateContainerRepoName, v as bold, vt as Synthesizer, w as IAMRoleProvider, wt as resolveCaptureObservedState, x as green, xt as getLegacyStateBucketName, y as cyan, yt as synthesisStatusMessage, z as assertRegionMatch } from "./deploy-engine-BdvgoV-R.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-iWNOeyib.js";
4
+ import { t as ASGProvider } from "./asg-provider-ew8lVaY6.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, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, 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";
@@ -14845,6 +14845,7 @@ var EC2Provider = class {
14845
14845
  "BlockDeviceMappings",
14846
14846
  "Tags",
14847
14847
  "AvailabilityZone",
14848
+ "NetworkInterfaces",
14848
14849
  "DisableApiTermination",
14849
14850
  "MetadataOptions",
14850
14851
  "Monitoring",
@@ -15917,10 +15918,12 @@ var EC2Provider = class {
15917
15918
  const securityGroupIds = properties["SecurityGroupIds"];
15918
15919
  const securityGroups = properties["SecurityGroups"];
15919
15920
  const iamInstanceProfile = this.normalizeIamInstanceProfile(properties["IamInstanceProfile"]);
15921
+ const networkInterfaces = this.buildNetworkInterfaces(properties);
15920
15922
  const instance = (await this.ec2Client.send(new RunInstancesCommand({
15921
15923
  ImageId: imageId,
15922
15924
  InstanceType: instanceType,
15923
15925
  KeyName: properties["KeyName"] ?? void 0,
15926
+ NetworkInterfaces: networkInterfaces,
15924
15927
  SecurityGroupIds: securityGroupIds ?? void 0,
15925
15928
  SecurityGroups: securityGroups ?? void 0,
15926
15929
  SubnetId: properties["SubnetId"] ?? void 0,
@@ -16317,6 +16320,48 @@ var EC2Provider = class {
16317
16320
  return { AvailabilityZone: az };
16318
16321
  }
16319
16322
  /**
16323
+ * Map the CFn `AWS::EC2::Instance.NetworkInterfaces` list onto
16324
+ * RunInstances' `NetworkInterfaces` input (issue #1281). Every CFn
16325
+ * sub-field is mapped (dropping a sub-field silently would be the #1225
16326
+ * bug class one level down): the two casing/shape divergences are
16327
+ * `GroupSet` -> `Groups` and CFn's stringly-typed numerics
16328
+ * (`DeviceIndex`, `Ipv6AddressCount`, `SecondaryPrivateIpAddressCount`
16329
+ * arrive as strings from CDK) -> numbers.
16330
+ */
16331
+ buildNetworkInterfaces(properties) {
16332
+ const raw = properties["NetworkInterfaces"];
16333
+ if (!Array.isArray(raw) || raw.length === 0) return void 0;
16334
+ return raw.map((entry) => {
16335
+ const ni = entry ?? {};
16336
+ return {
16337
+ DeviceIndex: this.coerceNumber(ni["DeviceIndex"]),
16338
+ SubnetId: ni["SubnetId"] ?? void 0,
16339
+ Groups: ni["GroupSet"] ?? void 0,
16340
+ AssociatePublicIpAddress: this.coerceBool(ni["AssociatePublicIpAddress"]),
16341
+ AssociateCarrierIpAddress: this.coerceBool(ni["AssociateCarrierIpAddress"]),
16342
+ DeleteOnTermination: this.coerceBool(ni["DeleteOnTermination"]),
16343
+ Description: ni["Description"] ?? void 0,
16344
+ NetworkInterfaceId: ni["NetworkInterfaceId"] ?? void 0,
16345
+ PrivateIpAddress: ni["PrivateIpAddress"] ?? void 0,
16346
+ Ipv6AddressCount: this.coerceNumber(ni["Ipv6AddressCount"]),
16347
+ Ipv6Addresses: Array.isArray(ni["Ipv6Addresses"]) ? ni["Ipv6Addresses"].map((a) => ({ Ipv6Address: a?.["Ipv6Address"] ?? void 0 })) : void 0,
16348
+ PrivateIpAddresses: Array.isArray(ni["PrivateIpAddresses"]) ? ni["PrivateIpAddresses"].map((a) => ({
16349
+ Primary: this.coerceBool(a?.["Primary"]),
16350
+ PrivateIpAddress: a?.["PrivateIpAddress"] ?? void 0
16351
+ })) : void 0,
16352
+ SecondaryPrivateIpAddressCount: this.coerceNumber(ni["SecondaryPrivateIpAddressCount"])
16353
+ };
16354
+ });
16355
+ }
16356
+ /**
16357
+ * CFn numerics are stringly typed on the wire ("0", not 0); RunInstances
16358
+ * wants numbers. Tolerate both, return undefined for anything else.
16359
+ */
16360
+ coerceNumber(value) {
16361
+ if (typeof value === "number" && Number.isFinite(value)) return value;
16362
+ if (typeof value === "string" && value.trim() !== "" && Number.isFinite(Number(value))) return Number(value);
16363
+ }
16364
+ /**
16320
16365
  * Build the RunInstances `CreditSpecification` shape from the CFn
16321
16366
  * `CreditSpecification` object. CFn uses `CPUCredits` (capital CPU, the
16322
16367
  * canonical CDK `CfnInstance` emission); accept the SDK-style `CpuCredits`
@@ -16894,6 +16939,7 @@ var EC2Provider = class {
16894
16939
  */
16895
16940
  getDriftUnknownPaths(resourceType) {
16896
16941
  switch (resourceType) {
16942
+ case "AWS::EC2::Instance": return ["NetworkInterfaces"];
16897
16943
  case "AWS::EC2::Route":
16898
16944
  case "AWS::EC2::VPCGatewayAttachment":
16899
16945
  case "AWS::EC2::SubnetRouteTableAssociation":
@@ -22171,6 +22217,32 @@ function wasMeaningfullyConfigured(value, discriminatorKey) {
22171
22217
  return value[discriminatorKey] !== void 0;
22172
22218
  }
22173
22219
 
22220
+ //#endregion
22221
+ //#region src/provisioning/resource-timeout-registry.ts
22222
+ let resolved;
22223
+ /**
22224
+ * Seed the registry with the validated `--resource-timeout` input. Call once
22225
+ * per CLI invocation, right after `validateResourceTimeouts`. Passing
22226
+ * `undefined` (flag not supplied) clears the registry, so consumers fall back
22227
+ * to their own compile-time floors.
22228
+ */
22229
+ function setResolvedResourceTimeouts(opt) {
22230
+ resolved = opt;
22231
+ }
22232
+ /**
22233
+ * The user's resolved timeout for `resourceType` in milliseconds, or
22234
+ * `undefined` when the user supplied nothing applicable. Resolution matches
22235
+ * the outer-deadline sites: per-type override wins, else the explicit global
22236
+ * value. The compile-time default (`DEFAULT_RESOURCE_TIMEOUT_MS`) is
22237
+ * deliberately NOT applied here — an inner waiter's own floor (e.g. ECS 600s)
22238
+ * must only be raised by an EXPLICIT user value, never by the generic 30m
22239
+ * default silently multiplying every `--full-wait` failure by 3x.
22240
+ */
22241
+ function resolvedResourceTimeoutMs(resourceType) {
22242
+ if (!resolved) return void 0;
22243
+ return resolved.perTypeMs?.[resourceType] ?? resolved.globalMs;
22244
+ }
22245
+
22174
22246
  //#endregion
22175
22247
  //#region src/provisioning/providers/ecs-provider.ts
22176
22248
  /**
@@ -22553,9 +22625,10 @@ var ECSProvider = class {
22553
22625
  async settleService(logicalId, serviceRef, cluster) {
22554
22626
  if (process.env["CDKD_FULL_WAIT"] === "true") {
22555
22627
  this.logger.debug(`Waiting for ECS service ${logicalId} to reach steady state...`);
22628
+ const maxWaitTime = Math.max(600, (resolvedResourceTimeoutMs("AWS::ECS::Service") ?? 0) / 1e3);
22556
22629
  await waitUntilServicesStable({
22557
22630
  client: this.getClient(),
22558
- maxWaitTime: 600,
22631
+ maxWaitTime,
22559
22632
  minDelay: 5,
22560
22633
  maxDelay: 10
22561
22634
  }, {
@@ -43113,6 +43186,7 @@ async function deployCommand(stacks, options) {
43113
43186
  }
43114
43187
  warnIfDeprecatedRegion(options);
43115
43188
  validateResourceTimeouts(options);
43189
+ setResolvedResourceTimeouts(options.resourceTimeout);
43116
43190
  applyWaitFlagEnv(options);
43117
43191
  await applyRoleArnIfSet({
43118
43192
  roleArn: options.roleArn,
@@ -46095,6 +46169,7 @@ async function destroyCommand(stackArgs, options) {
46095
46169
  }
46096
46170
  warnIfDeprecatedRegion(options);
46097
46171
  validateResourceTimeouts(options);
46172
+ setResolvedResourceTimeouts(options.resourceTimeout);
46098
46173
  await applyRoleArnIfSet({
46099
46174
  roleArn: options.roleArn,
46100
46175
  region: options.region
@@ -49672,6 +49747,7 @@ async function stateDestroyCommand(stackArgs, options) {
49672
49747
  process.env["CDKD_NO_LIVE"] = "1";
49673
49748
  }
49674
49749
  validateResourceTimeouts(options);
49750
+ setResolvedResourceTimeouts(options.resourceTimeout);
49675
49751
  if (!options.all && stackArgs.length === 0) throw new Error("Stack name is required. Usage: cdkd state destroy <stack> [<stack>...] | --all");
49676
49752
  const setup = await setupStateBackend(options);
49677
49753
  const providerRegistry = new ProviderRegistry();
@@ -62771,7 +62847,7 @@ function createMigrateCommand() {
62771
62847
  */
62772
62848
  function buildProgram() {
62773
62849
  const program = new Command();
62774
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.268.4");
62850
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.269.0");
62775
62851
  program.hook("preAction", (_thisCommand, actionCommand) => {
62776
62852
  const { profile } = actionCommand.optsWithGlobals();
62777
62853
  if (profile !== void 0) process.env["AWS_PROFILE"] = profile;