From 8e9e4e3c57c0c97200f7c92cb51d963d400901e4 Mon Sep 17 00:00:00 2001 From: Nick Cipollina Date: Tue, 24 Nov 2026 08:39:55 -0500 Subject: [PATCH 1/3] docs: add PrivateStaticAssetsConstruct to the 3.0 migration guide Refs #112 Co-Authored-By: Claude Opus 5.5 --- docs/migration/v3.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/migration/v3.md b/docs/migration/v3.md index 75656f5..c4f37f8 100644 --- a/docs/migration/v3.md +++ b/docs/migration/v3.md @@ -119,7 +119,26 @@ Custom implementations of the interface need those members. alias only), and `ShouldHaveCloudWatchLogsPermissions` asserts the scoped policy; its `region` and `account` parameters are kept for source compatibility and are ignored. -## 6. Consumer test projects +## 6. New `PrivateStaticAssetsConstruct` (additive) + +A new construct for **immutable, versioned web assets** in a private bucket behind CloudFront. It is +additive: nothing changes for existing constructs, and `StaticSiteConstruct` is unchanged. + +Use it instead of `StaticSiteConstruct` when the bucket must stay private: + +| | `StaticSiteConstruct` | `PrivateStaticAssetsConstruct` | +|---|---|---| +| Bucket access | Public-read website bucket, Block Public Access off | Block Public Access on; CloudFront origin access control only | +| Website endpoint | Yes | No | +| DNS and certificate | Required (Route53 lookup and ACM) | Optional; the CloudFront domain is used by default | +| SPA rewrites | Always on | Off by default | +| Deployment | Prunes, auto-deletes objects, bucket destroyed with the stack | Versioned prefix, no prune, objects and bucket retained by default | + +Moving an existing site from `StaticSiteConstruct` to the new construct creates a new bucket and +distribution (new CloudFront domain). Plan the DNS cutover and content copy; it is not an in-place +update. See [Private Static Assets](../constructs/private-static-assets.md). + +## 7. Consumer test projects No change is required. The library's own tests moved from AutoFixture/NSubstitute to Compono; that does not affect the shipped `Testing` helpers' dependencies. From c56b0612f2e2bdd7f6b838b796e5f4a2e44551cb Mon Sep 17 00:00:00 2001 From: Nick Cipollina Date: Tue, 24 Nov 2026 09:12:26 -0500 Subject: [PATCH 2/3] docs: clarify static-assets versioning, migration path and CDK pairing - Distinguish S3 object versioning from a caller-supplied immutable DestinationKeyPrefix (default is the bucket root). Codex P2. - Qualify the StaticSiteConstruct migration: with the same construct ID the distribution keeps its logical ID and updates in place; the bucket is still replaced (named bucket) and DNS records are recreated. Codex P2. - Note that 2.x is not compatible with Amazon.CDK.Lib 2.278.0 (MissingMethodException AddWarningV2), observed in #112 Sharedale validation; upgrade both packages together. Refs #112 (cdkc-2lh.5) Co-Authored-By: Claude Opus 5.5 --- docs/migration/v3.md | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/docs/migration/v3.md b/docs/migration/v3.md index c4f37f8..7869cee 100644 --- a/docs/migration/v3.md +++ b/docs/migration/v3.md @@ -11,8 +11,12 @@ to .NET 10 or 11. ## 2. `Amazon.CDK.Lib` 2.278.0 or later (upgrade-induced) -The minimum AWS CDK version is now 2.278.0. That release adds AWS's own Web Function L2 types to -`Amazon.CDK.AWS.Lambda`, and eight of their names match this library's: +The minimum AWS CDK version is now 2.278.0. Upgrade the two packages together: 2.x releases of this +library do not run against `Amazon.CDK.Lib` 2.278.0. For example, 2.6.0's `WebFunctionConstruct` +fails at synthesis with `MissingMethodException` (`Amazon.CDK.Annotations.AddWarningV2`). + +2.278.0 also adds AWS's own Web Function L2 types to `Amazon.CDK.AWS.Lambda`, and eight of their +names match this library's: - `IWebFunctionEndpoint` (namespace `LayeredCraft.Cdk.Constructs`); - `WebFunctionCode`, `WebFunctionRuntime`, `WebFunctionAuthType`, `WebFunctionEndpointType`, @@ -121,8 +125,13 @@ alias only), and `ShouldHaveCloudWatchLogsPermissions` asserts the scoped policy ## 6. New `PrivateStaticAssetsConstruct` (additive) -A new construct for **immutable, versioned web assets** in a private bucket behind CloudFront. It is -additive: nothing changes for existing constructs, and `StaticSiteConstruct` is unchanged. +A new construct for web assets in a private, versioned bucket behind CloudFront. It is additive: +nothing changes for existing constructs, and `StaticSiteConstruct` is unchanged. + +The bucket has S3 object versioning, but that does not make asset URLs immutable. Deployments go to +the bucket root unless you set `DestinationKeyPrefix`. For immutable paths, pass a prefix that is +unique per release (for example `game//`); with the default `Prune = false`, earlier +prefixes remain available. Use it instead of `StaticSiteConstruct` when the bucket must stay private: @@ -132,11 +141,19 @@ Use it instead of `StaticSiteConstruct` when the bucket must stay private: | Website endpoint | Yes | No | | DNS and certificate | Required (Route53 lookup and ACM) | Optional; the CloudFront domain is used by default | | SPA rewrites | Always on | Off by default | -| Deployment | Prunes, auto-deletes objects, bucket destroyed with the stack | Versioned prefix, no prune, objects and bucket retained by default | +| Deployment | Prunes, auto-deletes objects, bucket destroyed with the stack | Bucket root or a caller-supplied `DestinationKeyPrefix`; no prune; objects and bucket retained by default | + +Switching an existing site from `StaticSiteConstruct` to the new construct is not a drop-in change. +What happens depends on the construct ID: + +- **Same parent scope and construct ID:** the distribution (`{id}-cdn`) keeps its logical ID and is + updated in place, so the CloudFront domain is kept. The bucket (`{id}-bucket`) is still replaced: + `StaticSiteConstruct` names it after the site domain, and a bucket name cannot change in place. The + DNS alias records use different construct IDs and are recreated. +- **New construct ID:** every resource is new, including the distribution and its CloudFront domain. -Moving an existing site from `StaticSiteConstruct` to the new construct creates a new bucket and -distribution (new CloudFront domain). Plan the DNS cutover and content copy; it is not an in-place -update. See [Private Static Assets](../constructs/private-static-assets.md). +In both cases, copy the content to the new bucket and review `cdk diff` before deploying. See +[Private Static Assets](../constructs/private-static-assets.md). ## 7. Consumer test projects From 014682ecdfd4a3be7621d2dfd6b4bbb9ca537663 Mon Sep 17 00:00:00 2001 From: Nick Cipollina Date: Tue, 24 Nov 2026 09:19:27 -0500 Subject: [PATCH 3/3] docs: scope the 2.x CDK incompatibility note to Web Function usage The observed failure (2.6.0 WebFunctionConstruct, MissingMethodException AddWarningV2 against Amazon.CDK.Lib 2.278.0) does not establish that every 2.x release or construct fails. State the observed case, recommend upgrading both packages together, and tell 2.x consumers using the Web Function constructs to stay below CDK 2.278.0. Codex P2. Refs #112 (cdkc-2lh.5) Co-Authored-By: Claude Opus 5.5 --- docs/migration/v3.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/migration/v3.md b/docs/migration/v3.md index 7869cee..90e2f33 100644 --- a/docs/migration/v3.md +++ b/docs/migration/v3.md @@ -11,9 +11,11 @@ to .NET 10 or 11. ## 2. `Amazon.CDK.Lib` 2.278.0 or later (upgrade-induced) -The minimum AWS CDK version is now 2.278.0. Upgrade the two packages together: 2.x releases of this -library do not run against `Amazon.CDK.Lib` 2.278.0. For example, 2.6.0's `WebFunctionConstruct` -fails at synthesis with `MissingMethodException` (`Amazon.CDK.Annotations.AddWarningV2`). +The minimum AWS CDK version is now 2.278.0. Upgrade this library and `Amazon.CDK.Lib` together. +With 2.6.0, `WebFunctionConstruct` was observed to fail at synthesis against `Amazon.CDK.Lib` 2.278.0 +(`MissingMethodException`: `Amazon.CDK.Annotations.AddWarningV2`). If you stay on 2.x (for example on +.NET 8 or 9) and use the Web Function constructs, keep `Amazon.CDK.Lib` below 2.278.0 (2.6.0 was built +against 2.274.0 and was validated downstream with 2.275.0). 2.278.0 also adds AWS's own Web Function L2 types to `Amazon.CDK.AWS.Lambda`, and eight of their names match this library's: