Skip to content

docs: add PrivateStaticAssetsConstruct to the 3.0 migration guide - #118

Merged
ncipollina merged 3 commits into
mainfrom
docs/v3-migration-static-assets
Nov 24, 2026
Merged

ncipollina merged 3 commits into
mainfrom
docs/v3-migration-static-assets

Conversation

@ncipollina

Copy link
Copy Markdown
Contributor

Refs #112 (migration guide). Beads: cdkc-2lh.5.

Adds section 6 to docs/migration/v3.md: the new PrivateStaticAssetsConstruct (from #116), a comparison with StaticSiteConstruct (bucket access, website endpoint, DNS/certificate, SPA rewrites, deployment and retention), and a note that moving an existing site is a new bucket and distribution, not an in-place update. The former section 6 (consumer test projects) becomes section 7.

Documentation only (TDD exemption: no behavior). Validation: git diff --check clean; the relative link ../constructs/private-static-assets.md resolves. No local MkDocs build (not installed; the Docs workflow builds on main).

🤖 Generated with Claude Code

Refs #112

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ncipollina ncipollina added this to the v3.0.0 milestone Nov 24, 2026
@ncipollina ncipollina added the type: docs Documentation change label Nov 24, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T14:20:31.419066Z 014682e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ncipollina

Copy link
Copy Markdown
Contributor Author

@codex review — focus: accuracy of the StaticSiteConstruct vs PrivateStaticAssetsConstruct comparison against the source of both constructs.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8e9e4e3c57

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/migration/v3.md Outdated
| 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 |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Distinguish bucket versioning from a versioned deployment prefix

With the default props, PrivateStaticAssetsConstruct does not deploy under a versioned prefix: DestinationKeyPrefix defaults to null and is passed directly to BucketDeployment, so assets are written at the bucket root and subsequent deployments overwrite the same keys. The bucket enables S3 object versioning, but that does not provide versioned asset URLs. Describe the versioned bucket and optional caller-supplied prefix separately so consumers do not assume immutable deployment paths are supplied automatically.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid. Fixed in c56b061: the guide now separates S3 object versioning from immutable paths. Deployments go to the bucket root unless DestinationKeyPrefix is set, so pass a per-release prefix (for example game/<commit-sha>/). The comparison table row was corrected to match.

Comment thread docs/migration/v3.md Outdated
Comment on lines +137 to +139
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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify the claim that migration replaces the distribution

When a consumer switches construct classes while retaining the same parent scope and construct ID, both implementations create the distribution with the same ${id}-cdn child ID and resource type. Its CloudFormation logical ID therefore remains unchanged, allowing the origin and distribution settings to update in place rather than necessarily creating a new distribution or CloudFront domain. Distinguish this migration from deploying a separate construct under a new ID; the unconditional replacement claim gives consumers an inaccurate DNS cutover plan.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid. Both constructs use the {id}-cdn and {id}-bucket child IDs. Fixed in c56b061: with the same construct ID, the distribution keeps its logical ID and updates in place, so the CloudFront domain is kept. The bucket is still replaced, because StaticSiteConstruct sets BucketName (a replacement-only property), and the DNS alias records (different child IDs) are recreated. A new construct ID creates everything anew. The guide now asks for a content copy and a cdk diff review in both cases.

- 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 <noreply@anthropic.com>
@ncipollina

Copy link
Copy Markdown
Contributor Author

@codex review — focus: commit c56b061 only (docs/migration/v3.md). Check that the PrivateStaticAssetsConstruct versioning and StaticSiteConstruct migration wording now matches src/LayeredCraft.Cdk.Constructs/PrivateStaticAssetsConstruct.cs and StaticSiteConstruct.cs, and that the new §2 note (2.x does not run against Amazon.CDK.Lib 2.278.0) is accurately scoped.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c56b0612f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/migration/v3.md Outdated
Comment on lines +14 to +16
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`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope the CDK incompatibility warning to the validated usage

For consumers using other constructs or earlier 2.x releases, this states a package-wide incompatibility that the cited failure does not establish. In the pre-3.0 source (43f3ad8), AddWarningV2 is referenced only by WebFunctionConstruct and WebFunctionEndpointConstruct, not by constructs such as DynamoDbTableConstruct; a missing method in those Web Function paths does not prevent unrelated constructs from running. Describe the observed 2.6.0 Web Function failure and recommend upgrading both packages together without asserting that every 2.x release and usage fails, particularly since §1 directs .NET 8/9 consumers to remain on 2.x.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid. I had generalized one observed failure. At 43f3ad8, AddWarningV2 is referenced only by WebFunctionConstruct and WebFunctionEndpointConstruct. Fixed in the latest commit: the note now describes the observed 2.6.0 WebFunctionConstruct failure, recommends upgrading both packages together, and tells 2.x consumers (for example on .NET 8/9) who use the Web Function constructs to keep Amazon.CDK.Lib below 2.278.0. 2.6.0 was built against 2.274.0 and validated downstream with 2.275.0.

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 <noreply@anthropic.com>
@ncipollina

Copy link
Copy Markdown
Contributor Author

@codex review — focus: the latest commit only (docs/migration/v3.md §2 CDK pairing note). Check that it is now scoped to the observed Web Function failure and is consistent with §1.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 014682ecdf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ncipollina
ncipollina merged commit df30e75 into main Nov 24, 2026
11 checks passed
@ncipollina
ncipollina deleted the docs/v3-migration-static-assets branch November 24, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: docs Documentation change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant