@go-to-k/cdkd 0.268.2 → 0.268.3

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-BEjF-h_6.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-DEi5-8x-.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-gaXfXSH0.js";
4
+ import { t as ASGProvider } from "./asg-provider-bxS6B6Ja.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";
@@ -15619,11 +15619,12 @@ var EC2Provider = class {
15619
15619
  try {
15620
15620
  const ingressRules = properties["SecurityGroupIngress"];
15621
15621
  const egressRules = properties["SecurityGroupEgress"];
15622
- await Promise.all([
15622
+ const firstRejection = (await Promise.allSettled([
15623
15623
  this.applyTags(groupId, properties, logicalId),
15624
15624
  this.authorizeInlineIngress(groupId, ingressRules),
15625
15625
  this.applyInlineEgress(groupId, egressRules)
15626
- ]);
15626
+ ])).find((r) => r.status === "rejected");
15627
+ if (firstRejection) throw firstRejection.reason;
15627
15628
  } catch (innerError) {
15628
15629
  try {
15629
15630
  await this.ec2Client.send(new DeleteSecurityGroupCommand({ GroupId: groupId }));
@@ -20047,6 +20048,14 @@ var CloudFrontOACProvider = class {
20047
20048
  * `assertRegionMatch()` confirms the client is pointed at the region the
20048
20049
  * resource was created in (a region mismatch would otherwise silently
20049
20050
  * "succeed" while leaving the real resource behind).
20051
+ *
20052
+ * A `Get` that succeeds but carries no `ETag` is a hard error here for the
20053
+ * same reason it is in {@link update}: `IfMatch: undefined` reaches AWS as
20054
+ * a missing required parameter, and the resulting SDK/AWS rejection says
20055
+ * nothing about the `Get` being what came back short. On the DELETE path
20056
+ * that opacity is worse than on update — the failure surfaces during
20057
+ * `cdkd destroy`, where the user's next question is "is the OAC still
20058
+ * there?", so the message has to name the actual cause.
20050
20059
  */
20051
20060
  async delete(logicalId, physicalId, resourceType, _properties, context) {
20052
20061
  this.logger.debug(`Deleting CloudFront Origin Access Control ${logicalId}: ${physicalId}`);
@@ -20062,6 +20071,7 @@ var CloudFrontOACProvider = class {
20062
20071
  }
20063
20072
  throw error;
20064
20073
  }
20074
+ if (!etag) throw new Error("GetOriginAccessControl did not return ETag");
20065
20075
  await this.cloudFrontClient.send(new DeleteOriginAccessControlCommand({
20066
20076
  Id: physicalId,
20067
20077
  IfMatch: etag
@@ -20155,6 +20165,18 @@ var CloudFrontOACProvider = class {
20155
20165
  * copy that exists to (a) fail loudly when a required field is missing
20156
20166
  * rather than letting the SDK reject with an opaque serialization error,
20157
20167
  * and (b) keep unknown extra keys out of the request.
20168
+ *
20169
+ * All four required fields are checked for a NON-EMPTY string, not merely
20170
+ * for `typeof === 'string'`. `''` is the shape an unresolved intrinsic or a
20171
+ * `Fn::Sub` over a missing value most often collapses into, and CloudFront
20172
+ * rejects it just as surely as it rejects an absent field — so letting it
20173
+ * through would defeat the whole point of (a): the user would get AWS's
20174
+ * `InvalidArgument` instead of a message naming the field cdkd could see
20175
+ * was blank. The three type/behavior fields are additionally CFn enums
20176
+ * (`s3` / `mediastore` / `lambda` / `mediapackagev2`; `always` / `never` /
20177
+ * `no-override`; `sigv4`), for which the empty string is never a member.
20178
+ * `Description` is deliberately not in this set — it is genuinely optional
20179
+ * and `''` is a legitimate value that clears it.
20158
20180
  */
20159
20181
  toSdkConfig(value, logicalId, resourceType, physicalId) {
20160
20182
  const config = value ?? {};
@@ -20162,11 +20184,12 @@ var CloudFrontOACProvider = class {
20162
20184
  const originType = config["OriginAccessControlOriginType"];
20163
20185
  const signingBehavior = config["SigningBehavior"];
20164
20186
  const signingProtocol = config["SigningProtocol"];
20187
+ const nonEmpty = (value) => typeof value === "string" && value.length > 0;
20165
20188
  const missing = [
20166
- typeof name === "string" && name.length > 0 ? void 0 : "Name",
20167
- typeof originType === "string" ? void 0 : "OriginAccessControlOriginType",
20168
- typeof signingBehavior === "string" ? void 0 : "SigningBehavior",
20169
- typeof signingProtocol === "string" ? void 0 : "SigningProtocol"
20189
+ nonEmpty(name) ? void 0 : "Name",
20190
+ nonEmpty(originType) ? void 0 : "OriginAccessControlOriginType",
20191
+ nonEmpty(signingBehavior) ? void 0 : "SigningBehavior",
20192
+ nonEmpty(signingProtocol) ? void 0 : "SigningProtocol"
20170
20193
  ].filter((field) => field !== void 0);
20171
20194
  if (missing.length > 0) throw new ProvisioningError(`CloudFront Origin Access Control ${logicalId}: OriginAccessControlConfig is missing required field(s): ${missing.join(", ")}`, resourceType, logicalId, physicalId);
20172
20195
  const description = config["Description"];
@@ -22449,19 +22472,19 @@ var ECSProvider = class {
22449
22472
  try {
22450
22473
  await this.settleService(logicalId, service.serviceName ?? service.serviceArn, properties["Cluster"]);
22451
22474
  } catch (waitError) {
22475
+ const cleanupCluster = properties["Cluster"];
22476
+ const clusterArg = cleanupCluster ? ` --cluster ${cleanupCluster}` : "";
22452
22477
  try {
22453
22478
  await client.send(new DeleteServiceCommand({
22454
22479
  cluster: properties["Cluster"],
22455
22480
  service: service.serviceArn,
22456
22481
  force: true
22457
22482
  }));
22458
- this.logger.debug(`Cleaned up partially-created ECS service ${logicalId} (${service.serviceArn}) after the steady-state wait failed`);
22483
+ this.logger.warn(`Deleted partially-created ECS service ${logicalId} (${service.serviceArn}) after the steady-state wait failed, so the next deploy's CreateService does not collide on the name. Its stopped tasks remain inspectable for about an hour: aws ecs list-tasks${clusterArg} --desired-status STOPPED`);
22459
22484
  } catch (cleanupError) {
22460
- const cleanupCluster = properties["Cluster"];
22461
- const clusterArg = cleanupCluster ? ` --cluster ${cleanupCluster}` : "";
22462
22485
  this.logger.warn(`Failed to clean up partially-created ECS service ${logicalId} (${service.serviceArn}): ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}. Manual deletion may be required before the next deploy: aws ecs delete-service${clusterArg} --service ${service.serviceArn} --force`);
22463
22486
  }
22464
- throw waitError;
22487
+ throw new Error(`ECS service ${logicalId} did not reach steady state under --full-wait: ${waitError instanceof Error ? waitError.message : String(waitError)}. Inspect why its tasks stopped (stopped tasks stay visible for about an hour): aws ecs list-tasks${clusterArg} --desired-status STOPPED, then aws ecs describe-tasks${clusterArg} --tasks <task-arn> --query 'tasks[].[stoppedReason,containers[].reason]'`, { cause: waitError });
22465
22488
  }
22466
22489
  return {
22467
22490
  physicalId: service.serviceArn,
@@ -62702,7 +62725,7 @@ function createMigrateCommand() {
62702
62725
  */
62703
62726
  function buildProgram() {
62704
62727
  const program = new Command();
62705
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.268.2");
62728
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.268.3");
62706
62729
  program.hook("preAction", (_thisCommand, actionCommand) => {
62707
62730
  const { profile } = actionCommand.optsWithGlobals();
62708
62731
  if (profile !== void 0) process.env["AWS_PROFILE"] = profile;