@go-to-k/cdkd 0.282.2 → 0.282.4

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.
@@ -9418,6 +9418,118 @@ async function applyRoleArnIfSet(opts) {
9418
9418
  }
9419
9419
  }
9420
9420
 
9421
+ //#endregion
9422
+ //#region src/utils/s3-endpoints.ts
9423
+ /**
9424
+ * `AWS::S3::Bucket` `Fn::GetAtt` endpoint construction, shared across layers.
9425
+ *
9426
+ * cdkd answers the four host-shaped bucket attributes (`DomainName`,
9427
+ * `RegionalDomainName`, `DualStackDomainName`, `WebsiteURL`) WITHOUT an AWS
9428
+ * call, from the bucket name plus the region — and it does so in TWO places:
9429
+ * `S3BucketProvider.buildAttributes` (what lands in state) and
9430
+ * `IntrinsicFunctionResolver.constructAttribute` (what a cross-resource
9431
+ * `Fn::GetAtt` resolves to when the attribute is not cached). Those two used to
9432
+ * carry independent copies of the templates, which is the phantom-drift shape
9433
+ * `.claude/rules/providers.md` warns about: fix one and the resolver's answer
9434
+ * disagrees with what `readCurrentState` reports. They now both call THIS
9435
+ * module, so the two sides cannot diverge (issue
9436
+ * [#1745](https://github.com/go-to-k/cdkd/issues/1745)).
9437
+ *
9438
+ * Both copies also hardcoded the commercial `amazonaws.com` suffix, so outside
9439
+ * the commercial partition every one of the four emitted a hostname that does
9440
+ * not resolve — structurally valid, so nothing downstream could catch it. The
9441
+ * suffix now derives from the region through
9442
+ * {@link derivePartitionAndUrlSuffix}, the same closed table `${AWS::URLSuffix}`
9443
+ * resolves through.
9444
+ *
9445
+ * The shapes are taken from `aws-cdk-lib`'s own `Bucket.fromBucketAttributes`
9446
+ * (`aws-s3/lib/bucket.ts`), which constructs the identical four values for an
9447
+ * imported bucket, rather than from documentation prose:
9448
+ *
9449
+ * - `bucketDomainName` -> `<bucket>.s3.<urlSuffix>`
9450
+ * - `bucketRegionalDomainName` -> `<bucket>.s3.<region>.<urlSuffix>`
9451
+ * - `bucketDualStackDomainName` -> `<bucket>.s3.dualstack.<region>.<urlSuffix>`
9452
+ * - `bucketWebsiteUrl` -> `http://<bucket>.<staticWebsiteEndpoint>`
9453
+ */
9454
+ /**
9455
+ * The regions whose S3 static-website endpoint uses the LEGACY hyphen form
9456
+ * `s3-website-<region>` rather than the current dot form `s3-website.<region>`.
9457
+ *
9458
+ * This is NOT a mechanical suffix swap, which is why the issue asked for it to
9459
+ * be verified rather than spliced. The set is CLOSED and was read out of
9460
+ * `aws-cdk-lib`'s `region-info` fact table (`S3_STATIC_WEBSITE_ENDPOINT`, the
9461
+ * same data CDK itself resolves a bucket's website endpoint from), enumerated
9462
+ * at aws-cdk-lib 2.244.0: exactly these nine regions report the hyphen form and
9463
+ * every other region — commercial and non-commercial alike — reports the dot
9464
+ * form. `us-gov-west-1` is in the hyphen set while its `us-gov-east-1` sibling
9465
+ * is not, so the split is per REGION and cannot be derived from the partition.
9466
+ *
9467
+ * An UNKNOWN region resolves to the dot form, matching what CDK falls back to
9468
+ * when `region-info` has no fact for the region: the hyphen form is the legacy
9469
+ * spelling and no new region has been added to it.
9470
+ *
9471
+ * NOTE this corrects the answer for every non-legacy COMMERCIAL region too, not
9472
+ * only for other partitions — the previous hardcoded template emitted the
9473
+ * hyphen form everywhere, so e.g. an `eu-central-1` bucket's `WebsiteURL`
9474
+ * resolved to a host AWS does not serve.
9475
+ */
9476
+ const S3_WEBSITE_ENDPOINT_LEGACY_DASH_REGIONS = /* @__PURE__ */ new Set([
9477
+ "ap-northeast-1",
9478
+ "ap-southeast-1",
9479
+ "ap-southeast-2",
9480
+ "eu-west-1",
9481
+ "sa-east-1",
9482
+ "us-east-1",
9483
+ "us-gov-west-1",
9484
+ "us-west-1",
9485
+ "us-west-2"
9486
+ ]);
9487
+ /** `arn:<partition>:s3:::<bucket>` — the bucket ARN (no region / account field). */
9488
+ function s3BucketArn(bucketName, region) {
9489
+ return `arn:${derivePartitionAndUrlSuffix(region).partition}:s3:::${bucketName}`;
9490
+ }
9491
+ /**
9492
+ * `<bucket>.s3.<urlSuffix>` — the partition-global (non-regional) domain name.
9493
+ *
9494
+ * **This host does not RESOLVE outside the commercial partition, and that is
9495
+ * not something this module can fix.** S3's partition-global endpoint exists
9496
+ * only in `aws`: `s3.amazonaws.com.cn` is NXDOMAIN (probed 2026-08-13), and in
9497
+ * GovCloud the commercial `<bucket>.s3.amazonaws.com` resolves to COMMERCIAL S3,
9498
+ * which answers `NoSuchBucket`. Only the regional / dual-stack / website forms
9499
+ * have a real non-commercial spelling.
9500
+ *
9501
+ * The suffix is still derived rather than hardcoded, because the alternative —
9502
+ * inventing the REGIONAL form here — would make cdkd's `Fn::GetAtt DomainName`
9503
+ * disagree with what CloudFormation returns, which is the compatibility cdkd
9504
+ * exists to keep. This spelling matches `aws-cdk-lib`'s own
9505
+ * `Bucket.fromBucketAttributes` (`bucketDomainName: <bucket>.s3.<urlSuffix>`),
9506
+ * the only AWS-authored answer available without a non-commercial account.
9507
+ * Settling it against real CloudFormation is issue
9508
+ * [#1809](https://github.com/go-to-k/cdkd/issues/1809).
9509
+ */
9510
+ function s3BucketDomainName(bucketName, region) {
9511
+ return `${bucketName}.s3.${derivePartitionAndUrlSuffix(region).urlSuffix}`;
9512
+ }
9513
+ /** `<bucket>.s3.<region>.<urlSuffix>` — the regional domain name. */
9514
+ function s3BucketRegionalDomainName(bucketName, region) {
9515
+ return `${bucketName}.s3.${region}.${derivePartitionAndUrlSuffix(region).urlSuffix}`;
9516
+ }
9517
+ /** `<bucket>.s3.dualstack.<region>.<urlSuffix>` — the IPv6 dual-stack domain name. */
9518
+ function s3BucketDualStackDomainName(bucketName, region) {
9519
+ return `${bucketName}.s3.dualstack.${region}.${derivePartitionAndUrlSuffix(region).urlSuffix}`;
9520
+ }
9521
+ /**
9522
+ * `http://<bucket>.s3-website[-.]<region>.<urlSuffix>` — the static-website URL.
9523
+ *
9524
+ * The separator is picked per region from
9525
+ * {@link S3_WEBSITE_ENDPOINT_LEGACY_DASH_REGIONS}; see that constant for why it
9526
+ * cannot be derived from the partition.
9527
+ */
9528
+ function s3BucketWebsiteUrl(bucketName, region) {
9529
+ const { urlSuffix } = derivePartitionAndUrlSuffix(region);
9530
+ return `http://${bucketName}.s3-website${S3_WEBSITE_ENDPOINT_LEGACY_DASH_REGIONS.has(region) ? "-" : "."}${region}.${urlSuffix}`;
9531
+ }
9532
+
9421
9533
  //#endregion
9422
9534
  //#region src/provisioning/config-shape.ts
9423
9535
  /**
@@ -11608,10 +11720,11 @@ var IntrinsicFunctionResolver = class {
11608
11720
  default: return this.guardedPhysicalIdFallback(logicalId, attributeName, resourceType, physicalId);
11609
11721
  }
11610
11722
  if (resourceType === "AWS::S3::Bucket") switch (attributeName) {
11611
- case "Arn": return `arn:${partition}:s3:::${physicalId}`;
11612
- case "DomainName": return `${physicalId}.s3.amazonaws.com`;
11613
- case "RegionalDomainName": return `${physicalId}.s3.${region}.amazonaws.com`;
11614
- case "WebsiteURL": return `http://${physicalId}.s3-website-${region}.amazonaws.com`;
11723
+ case "Arn": return s3BucketArn(physicalId, region);
11724
+ case "DomainName": return s3BucketDomainName(physicalId, region);
11725
+ case "RegionalDomainName": return s3BucketRegionalDomainName(physicalId, region);
11726
+ case "DualStackDomainName": return s3BucketDualStackDomainName(physicalId, region);
11727
+ case "WebsiteURL": return s3BucketWebsiteUrl(physicalId, region);
11615
11728
  default: return this.guardedPhysicalIdFallback(logicalId, attributeName, resourceType, physicalId);
11616
11729
  }
11617
11730
  if (resourceType === "AWS::IAM::Role") switch (attributeName) {
@@ -13641,7 +13754,7 @@ var CloudControlProvider = class {
13641
13754
  if (context?.finalSnapshotIdentifier !== void 0) throw new ProvisioningError(`${logicalId} (${resourceType}) requires a final snapshot (DeletionPolicy: Snapshot), but the Cloud Control API delete route has no final-snapshot parameter. Re-run with --skip-final-snapshot after snapshotting manually, or retain the resource.`, resourceType, logicalId, physicalId);
13642
13755
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
13643
13756
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
13644
- const { ASGProvider } = await import("./asg-provider-B5EgvcoP.js").then((n) => n.n);
13757
+ const { ASGProvider } = await import("./asg-provider-D9VJTwn3.js").then((n) => n.n);
13645
13758
  await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
13646
13759
  return;
13647
13760
  }
@@ -20558,7 +20671,7 @@ const FLUSH_INTERVAL_MS = 2e3;
20558
20671
  const FLUSH_EVENT_THRESHOLD = 50;
20559
20672
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
20560
20673
  function getCdkdVersion() {
20561
- return "0.282.2";
20674
+ return "0.282.4";
20562
20675
  }
20563
20676
  /**
20564
20677
  * Generate a time-sortable unique run id, e.g.
@@ -22726,5 +22839,5 @@ var DeployEngine = class {
22726
22839
  };
22727
22840
 
22728
22841
  //#endregion
22729
- export { configStringRefusal as $, MIGRATE_TMP_PREFIX as $t, green as A, StateError as An, validateContainerRepoName as At, slowCcOperationTimeoutMs as B, getDefaultStateBucketName as Bt, MULTI_REGION_RECREATE_BLOCKED_TYPES as C, NestedStackChildDirectDestroyError as Cn, rewriteTemplateAssetReferences as Ct, bold as D, ResourceUpdateNotSupportedError as Dn, getBootstrapMarkerKey as Dt, formatResourceLine as E, ResourceTimeoutError as En, ensureAssetStorage as Et, clearOnUpdateRemoval as F, withErrorHandling as Fn, runDockerStreaming as Ft, getAccountInfo as G, resolveSkipPrefix as Gt, isTerminationProtectionPropagationError as H, resolveApp as Ht, ProviderRegistry as I, __exportAll as In, AssetManifestLoader as It, normalizeAwsTagsToCfn as J, resolveUseCdkBootstrapAssets as Jt, refStateLookupFromResource as K, resolveStateBucketWithDefault as Kt, findActionableSilentDrops as L, getDockerImageBySourceHash as Lt, yellow as M, formatError as Mn, formatDockerLoginError as Mt, IAMRoleProvider as N, isCdkdError as Nn, getDockerCmd as Nt, cyan as O, StackHasActiveImportsError as On, parseBootstrapMarker as Ot, collectInlinePolicyNamesManagedBySiblings as P, normalizeAwsError as Pn, runDockerForeground as Pt, configBooleanRefusal as Q, CFN_TEMPLATE_URL_LIMIT as Qt, findSilentDropProperties as R, Synthesizer as Rt, extractDeploymentEventError as S, MissingCdkCliError as Sn, loadPublishableAssetManifest as St, renderStatefulReason as T, ProvisioningError as Tn, BOOTSTRAP_MARKER_PREFIX as Tt, IntrinsicFunctionResolver as U, resolveAutoAssetStorage as Ut, disableInstanceApiTermination as V, getLegacyStateBucketName as Vt, cfnRefValueFromPhysicalId as W, resolveCaptureObservedState as Wt, assertRegionMatch as X, warnDeprecatedNoPrefixCliFlag as Xt, resolveExplicitPhysicalId as Y, stateBucketExistenceConfirmed as Yt, coerceCfnBoolean as Z, CFN_TEMPLATE_BODY_LIMIT as Zt, createPreDeleteFinalSnapshot as _, DeployCancelledError as _n, AssetPublisher as _t, DeploymentEventsStore as a, AssemblyReader as an, applyRoleArnIfSet as at, unsupportedFinalSnapshotError as b, LocalStartServiceError as bn, buildAssetRedirectMap as bt, replayFailedOperations as c, resolveBucketRegion as cn, withRetry as ct, IMPLICIT_DELETE_DEPENDENCIES as d, resetAwsClients as dn, DagBuilder as dt, findLargeInlineResources as en, readConfigString as et, computeImplicitDeleteEdges as f, setAwsClients as fn, TemplateParser as ft, ccRoutedFinalSnapshotError as g, DependencyError as gn, shouldRetainResource as gt, buildFinalSnapshotIdentifier as h, ConfigError as hn, rebuildClientForBucketRegion as ht, DeploymentEventsReader as i, derivePartitionAndUrlSuffix as in, requireConfigString as it, red as j, SynthesisError as jn, buildDockerImage as jt, gray as k, StackTerminationProtectionError as kn, validateAssetBucketName as kt, replayRollback as l, AwsClients as ln, isRetryableTransientError as lt, PRE_DELETE_SNAPSHOT_TYPES as m, CdkdError as mn, S3StateBackend as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, expectedOwnerParam as nn, requireConfigArray as nt, planFailedOps as o, processStackMessages as on, DiffCalculator as ot, ATOMIC_FINAL_SNAPSHOT_TYPES as p, AssetError as pn, LockManager as pt, WAFv2WebACLProvider as q, resolveStateBucketWithDefaultAndSource as qt, DeployEngine as r, PARTITION_TABLE as rn, requireConfigObject as rt, planRollback as s, clearBucketRegionCache as sn, describeTypeWithThrottleRetry as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, uploadCfnTemplate as tn, replayWarn as tt, withResourceDeadline as u, getAwsClients as un, isThrottlingError as ut, isFinalSnapshotError as v, LocalInvokeBuildError as vn, stringifyValue as vt, isStatefulRecreateTargetSync as w, PartialFailureError as wn, AssetModeResolver as wt, makeCanonicalizePropertiesFn as x, LockError as xn, createAssetRedirectResolver as xt, refusesFinalSnapshot as y, LocalMigrateError as yn, WorkGraph as yt, CloudControlProvider as z, synthesisStatusMessage as zt };
22730
- //# sourceMappingURL=deploy-engine-6sSRIhrN.js.map
22842
+ export { configStringRefusal as $, resolveUseCdkBootstrapAssets as $t, green as A, ProvisioningError as An, BOOTSTRAP_MARKER_PREFIX as At, slowCcOperationTimeoutMs as B, withErrorHandling as Bn, runDockerStreaming as Bt, MULTI_REGION_RECREATE_BLOCKED_TYPES as C, LocalInvokeBuildError as Cn, stringifyValue as Ct, bold as D, MissingCdkCliError as Dn, loadPublishableAssetManifest as Dt, formatResourceLine as E, LockError as En, createAssetRedirectResolver as Et, clearOnUpdateRemoval as F, StateError as Fn, validateContainerRepoName as Ft, getAccountInfo as G, getDefaultStateBucketName as Gt, isTerminationProtectionPropagationError as H, getDockerImageBySourceHash as Ht, ProviderRegistry as I, SynthesisError as In, buildDockerImage as It, normalizeAwsTagsToCfn as J, resolveAutoAssetStorage as Jt, refStateLookupFromResource as K, getLegacyStateBucketName as Kt, findActionableSilentDrops as L, formatError as Ln, formatDockerLoginError as Lt, yellow as M, ResourceUpdateNotSupportedError as Mn, getBootstrapMarkerKey as Mt, IAMRoleProvider as N, StackHasActiveImportsError as Nn, parseBootstrapMarker as Nt, cyan as O, NestedStackChildDirectDestroyError as On, rewriteTemplateAssetReferences as Ot, collectInlinePolicyNamesManagedBySiblings as P, StackTerminationProtectionError as Pn, validateAssetBucketName as Pt, configBooleanRefusal as Q, resolveStateBucketWithDefaultAndSource as Qt, findSilentDropProperties as R, isCdkdError as Rn, getDockerCmd as Rt, extractDeploymentEventError as S, DeployCancelledError as Sn, AssetPublisher as St, renderStatefulReason as T, LocalStartServiceError as Tn, buildAssetRedirectMap as Tt, IntrinsicFunctionResolver as U, Synthesizer as Ut, disableInstanceApiTermination as V, __exportAll as Vn, AssetManifestLoader as Vt, cfnRefValueFromPhysicalId as W, synthesisStatusMessage as Wt, assertRegionMatch as X, resolveSkipPrefix as Xt, resolveExplicitPhysicalId as Y, resolveCaptureObservedState as Yt, coerceCfnBoolean as Z, resolveStateBucketWithDefault as Zt, createPreDeleteFinalSnapshot as _, setAwsClients as _n, TemplateParser as _t, DeploymentEventsStore as a, findLargeInlineResources as an, s3BucketArn as at, unsupportedFinalSnapshotError as b, ConfigError as bn, rebuildClientForBucketRegion as bt, replayFailedOperations as c, PARTITION_TABLE as cn, s3BucketRegionalDomainName as ct, IMPLICIT_DELETE_DEPENDENCIES as d, processStackMessages as dn, DiffCalculator as dt, stateBucketExistenceConfirmed as en, readConfigString as et, computeImplicitDeleteEdges as f, clearBucketRegionCache as fn, describeTypeWithThrottleRetry as ft, ccRoutedFinalSnapshotError as g, resetAwsClients as gn, DagBuilder as gt, buildFinalSnapshotIdentifier as h, getAwsClients as hn, isThrottlingError as ht, DeploymentEventsReader as i, MIGRATE_TMP_PREFIX as in, requireConfigString as it, red as j, ResourceTimeoutError as jn, ensureAssetStorage as jt, gray as k, PartialFailureError as kn, AssetModeResolver as kt, replayRollback as l, derivePartitionAndUrlSuffix as ln, s3BucketWebsiteUrl as lt, PRE_DELETE_SNAPSHOT_TYPES as m, AwsClients as mn, isRetryableTransientError as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, CFN_TEMPLATE_BODY_LIMIT as nn, requireConfigArray as nt, planFailedOps as o, uploadCfnTemplate as on, s3BucketDomainName as ot, ATOMIC_FINAL_SNAPSHOT_TYPES as p, resolveBucketRegion as pn, withRetry as pt, WAFv2WebACLProvider as q, resolveApp as qt, DeployEngine as r, CFN_TEMPLATE_URL_LIMIT as rn, requireConfigObject as rt, planRollback as s, expectedOwnerParam as sn, s3BucketDualStackDomainName as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, warnDeprecatedNoPrefixCliFlag as tn, replayWarn as tt, withResourceDeadline as u, AssemblyReader as un, applyRoleArnIfSet as ut, isFinalSnapshotError as v, AssetError as vn, LockManager as vt, isStatefulRecreateTargetSync as w, LocalMigrateError as wn, WorkGraph as wt, makeCanonicalizePropertiesFn as x, DependencyError as xn, shouldRetainResource as xt, refusesFinalSnapshot as y, CdkdError as yn, S3StateBackend as yt, CloudControlProvider as z, normalizeAwsError as zn, runDockerForeground as zt };
22843
+ //# sourceMappingURL=deploy-engine-CnxJLy3Y.js.map