diff --git a/.beads/issues.jsonl b/.beads/issues.jsonl index 4ab482f..6365b52 100644 --- a/.beads/issues.jsonl +++ b/.beads/issues.jsonl @@ -15,6 +15,21 @@ {"_type":"issue","id":"cdkc-18e.2","title":"T1: Add Web Function public models, options, and value validation","description":"Purpose: introduce the public model/value types every later bead consumes, with value validation. Design §8.1, §8.2, §8.3 (props + WebFunctionLogs), §8.4 (options/attributes), §8.5 (origin props), §8.7, §10.2 (WebFunctionCallerPolicy, WebFunctionInvokeGrantOptions), §14.\n\nDeliverables (namespace LayeredCraft.Cdk.Constructs.Models unless noted; follow the newest Cognito style: get-only interfaces + init-only sealed records, XML docs):\n- Enums: WebFunctionAuthType {IamAuth, ApplicationManaged}; WebFunctionEndpointType {HomeRegion, MultiRegion, PerRegion};\n WebFunctionCodeBucketPolicy {Automatic, ExternallyManaged}; WebFunctionOriginPermissions {Automatic, ExternallyManaged};\n WebFunctionCallerPolicy {Automatic, ExternallyManaged}.\n- WebFunctionRuntime (sealed; NodeJs24X = \"nodejs24.x\"; Of(string)).\n- WebFunctionCode (abstract, private protected ctor, closed hierarchy) with static FromBucket(IBucket, string key, WebFunctionCodeFromBucketOptions?)\n and WebFunctionCodeFromBucketOptions {ObjectVersion, BucketPolicy = Automatic}. The internal Bind contract to the construct is\n declared but bucket-policy wiring is implemented in the core-construct bead; keep the binding surface internal so FromAsset can be added later.\n- WebFunctionLogs (abstract, closed): Create(RetentionDays? retention = null [→ TWO_WEEKS], RemovalPolicy? [→ DESTROY]), Use(ILogGroup), ServiceDefault().\n- IWebFunctionConstructProps / WebFunctionConstructProps exactly per §8.3 (FunctionName, Code, Endpoint required; Runtime, EntryPoint,\n EnvironmentVariables, Timeout=30s, MaxConcurrencyPerEnvironment, Description, Role, Logs=Create(), ApplicationLogLevel, SystemLogLevel\n reusing Amazon.CDK.AWS.Lambda enums). NO EncryptionKey property.\n- IWebFunctionEndpointOptions / WebFunctionEndpointOptions (EndpointName=\"default\", required AuthType, EndpointType=HomeRegion, Regions, MaxEnvironments, RateLimit, Description).\n- WebFunctionEndpointAttributes (EndpointArn, DomainName, AuthType required; EndpointType=HomeRegion).\n- WebFunctionInvokeGrantOptions {CallerPolicy = Automatic}.\n- WebFunctionOriginProps (explicit members only: OriginId, OriginPath, CustomHeaders, ConnectionAttempts, ConnectionTimeout, ReadTimeout,\n KeepaliveTimeout, ResponseCompletionTimeout, OriginShieldEnabled, OriginShieldRegion) and sealed WebFunctionOriginWithOacProps : WebFunctionOriginProps\n {OriginAccessControl, Permissions = Automatic}. Must NOT expose ProtocolPolicy or OriginAccessControlId.\n- Internal validation helpers (local to new types; do not refactor shared code or existing constructs) for §14 value rules: FunctionName\n regex 1–64; EndpointName 1–64 [A-Za-z0-9_-]; Timeout 3–900 whole seconds; MaxConcurrencyPerEnvironment 1–128; MaxEnvironments 2–10000;\n RateLimit grid {0} ∪ 100..1000 step 100 ∪ 2000..10000 step 1000; Regions rules; env var key regex; EntryPoint relative/no \"..\";\n reserved AWS_LAMBDA_HTTP_ENDPOINT; EntryPoint vs AWS_LAMBDA_NODEJS_ENTRYPOINT conflict. Unresolved tokens (Token.IsUnresolved) are skipped, never rejected.\n Exception types per §14 (ArgumentException / ArgumentOutOfRangeException / InvalidOperationException).\n\nExpected files: src/LayeredCraft.Cdk.Constructs/Models/WebFunction*.cs (one type per file or small cohesive groups); test/.../WebFunctionModelsTests.cs (+ validation tests).\nExclusions: no constructs, no CloudFormation resources, no IBucket policy mutation yet, no testing-namespace helpers, no docs.\nEdge cases: FunctionName must allow tokens; nullable reference types enabled; records must be init-only (no Action\u003c\u003e mutation APIs anywhere).\n","acceptance_criteria":"- All listed public types exist with the exact names, members, and defaults in design §8.1–§8.5, §8.7 (no EncryptionKey), §10.2.\n- WebFunctionConstructProps cannot be constructed without FunctionName, Code, and Endpoint; WebFunctionEndpointOptions cannot be constructed without AuthType (compile-time `required`).\n- Every §14 value rule has a positive and negative unit test; tokens bypass literal validation (tested).\n- WebFunctionLogs.Create() defaults are TWO_WEEKS and DESTROY (tested).\n- No existing source file outside new WebFunction* files changed; existing golden templates still pass.\n- Validation gates pass.","notes":"T1 IMPLEMENTED (public WebFunction model/value types + §14 value validation). Not committed per task restriction.\n\nDELIVERABLES (src/LayeredCraft.Cdk.Constructs/Models/):\n- Enums: WebFunctionAuthType (IamAuth, ApplicationManaged), WebFunctionEndpointType (HomeRegion, MultiRegion, PerRegion), WebFunctionCodeBucketPolicy (Automatic, ExternallyManaged), WebFunctionOriginPermissions (Automatic, ExternallyManaged), WebFunctionCallerPolicy (Automatic, ExternallyManaged).\n- WebFunctionRuntime: sealed; NodeJs24X='nodejs24.x'; Of(string) escape hatch.\n- WebFunctionCode: abstract closed hierarchy (private protected ctor); static FromBucket(IBucket,string,WebFunctionCodeFromBucketOptions?); internal sealed WebFunctionCodeFromBucket. Options: WebFunctionCodeFromBucketOptions { ObjectVersion; BucketPolicy=Automatic }.\n- WebFunctionLogs: abstract closed; Create(RetentionDays?=TWO_WEEKS, RemovalPolicy?=DESTROY) / Use(ILogGroup) / ServiceDefault(); internal concrete subtypes.\n- IWebFunctionConstructProps + WebFunctionConstructProps: FunctionName/Code/Endpoint required; Runtime=NodeJs24X; EntryPoint; EnvironmentVariables; Timeout=30s; MaxConcurrencyPerEnvironment; Description; Role; Logs=Create(); ApplicationLogLevel; SystemLogLevel. NO EncryptionKey (deferred KMS, §8.7).\n- IWebFunctionEndpointOptions + WebFunctionEndpointOptions: EndpointName='default'; required AuthType (explicit selection, no default); EndpointType=HomeRegion; Regions=[]; MaxEnvironments; RateLimit; Description.\n- WebFunctionEndpointAttributes: required EndpointArn/DomainName/AuthType; EndpointType=HomeRegion.\n- WebFunctionInvokeGrantOptions: CallerPolicy=Automatic (explicit ownership contract).\n- WebFunctionOriginProps + sealed WebFunctionOriginWithOacProps (no ProtocolPolicy/OriginAccessControlId).\n- WebFunctionValidation (internal static): §14 helpers (FunctionName, EndpointName, Timeout, MaxConcurrencyPerEnvironment, MaxEnvironments, RateLimit grid, Regions, env var keys, env var map, EntryPoint incl reserved AWS_LAMBDA_HTTP_ENDPOINT and AWS_LAMBDA_NODEJS_ENTRYPOINT conflict). Token-aware: unresolved tokens (Token.IsUnresolved / Fn.Ref) bypass literal validation. Exceptions per §14 (ArgumentException / ArgumentOutOfRangeException).\n- [assembly: InternalsVisibleTo(\"LayeredCraft.Cdk.Constructs.Tests\")] added (new file) so validation is unit-testable.\n\nTESTS (test/LayeredCraft.Cdk.Constructs.Tests/): WebFunctionModelsTests.cs (defaults, required values, immutability, factory arg validation, crypto/logs/endpoint/origin surface) + WebFunctionValidationTests.cs (positive+negative per §14 rule, boundary values, token bypass). +110 tests/TFM ([Collection(\"CDK Tests\")], xUnit v3, AwesomeAssertions).\n\nCOMMANDS/RESULTS (JSII_SILENCE_WARNING_UNTESTED_NODE_VERSION=1):\n- dotnet build LayeredCraft.Cdk.Constructs.slnx -c Release -\u003e 0 warnings, 0 errors.\n- dotnet test --solution LayeredCraft.Cdk.Constructs.slnx -c Release -\u003e 1184 passed / 0 failed / 0 skipped (296 x net8.0/net9.0/net10.0/net11.0). Baseline was 744 (186x4).\n- 17 golden templates UNCHANGED; ExistingConstructsGoldenTemplateTests passed (zero diff). Goldens NOT regenerated.\n\nSCOPE: no constructs, no CFN resources, no IBucket policy mutation, no Testing helpers, no docs. No existing (pre-T1) source file modified; only new WebFunction*.cs files added. No new dependencies.\n\nINTENTIONAL DEVIATION (must be reported): design §8.2 declares internal 'abstract WebFunctionCodeConfig Bind(WebFunctionConstruct function)'. WebFunctionConstruct is created in T2 (cdkc-18e.3), so this internal seam cannot be declared in T1 without the type. Deferred Bind to T2 (which already owns the construct + bucket-policy wiring). Public contract unchanged. Recommendation: T2 declares the abstract Bind on WebFunctionCode and overrides it in WebFunctionCodeFromBucket. No other deviation from the approved design.","spec_id":"docs/designs/lambda-web-functions-integration.md","status":"closed","priority":1,"issue_type":"task","assignee":"Nick Cipollina","owner":"ncipollina@gmail.com","created_at":"2026-10-23T01:14:47Z","created_by":"Nick Cipollina","updated_at":"2026-10-23T01:53:01Z","started_at":"2026-10-23T01:38:29Z","closed_at":"2026-10-23T01:53:01Z","close_reason":"Implemented T1: public WebFunction model/value types (auth/endpoint-type/bucket-policy/origin-permissions/caller-policy enums, WebFunctionRuntime, closed WebFunctionCode+FromBucket, closed WebFunctionLogs with Create/Use/ServiceDefault, IWebFunctionConstructProps+record, IWebFunctionEndpointOptions+record, EndpointAttributes, InvokeGrantOptions, OriginProps+WithOacProps) and internal token-aware WebFunctionValidation for all §14 value rules. Added 2 test files (WebFunctionModelsTests, WebFunctionValidationTests) = +110 tests/TFM. Build 0 warnings/0 errors; full suite 1184/1184 passed across net8.0/9.0/10.0/11.0; all 17 existing golden templates unchanged (goldens not regenerated). No existing source modified, no constructs/CFN resources/IBucket mutation/Testing helpers/docs added. Internal Bind(WebFunctionConstruct) seam intentionally deferred to T2 (cdkc-18e.3) because the construct type does not exist in T1; public contract unaffected.","external_ref":"gh-98","labels":["lambda-web-functions","models","t1"],"dependencies":[{"issue_id":"cdkc-18e.2","depends_on_id":"cdkc-18e","type":"parent-child","created_at":"2026-10-23T01:14:47Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-18e.2","depends_on_id":"cdkc-18e.1","type":"blocks","created_at":"2026-10-23T01:15:09Z","created_by":"Nick Cipollina","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"cdkc-18e.1","title":"T0: Upgrade Amazon.CDK.Lib to 2.274.0 and add golden-template baseline for existing constructs","description":"Purpose: separate review checkpoint that raises the CDK floor and proves existing constructs are unchanged. Design §5.5, §12.4 (Enforcement), §13, §19 T0.\n\nREQUIRED ORDER (do not reorder):\n a. Confirm Directory.Packages.props still pins Amazon.CDK.Lib 2.273.0 (`dotnet list test/LayeredCraft.Cdk.Constructs.Tests package --include-transitive | grep Amazon.CDK.Lib`). If it is already 2.274.0, STOP and record a blocker: the baseline can no longer be produced from the original version.\n b. Generate the golden baseline ON 2.273.0, run the tests once to prove the baseline passes on 2.273.0, and record the 2.273.0 SHA-256 of every golden file in the bead notes.\n c. Only then change Amazon.CDK.Lib to 2.274.0, restore, and run the golden tests in COMPARE mode (regeneration env var unset) against the unchanged 2.273.0 baseline.\n d. If any template differs: do NOT regenerate, accept, or edit golden files; do NOT adjust normalization to hide the diff. Record the full diff (construct, resource, property, old → new) on this bead with `bd update \u003cid\u003e --append-notes`, set the bead to blocked (`bd update \u003cid\u003e --status blocked`), and report to the maintainer. Leave 2.274.0 in place only together with the failing tests and the recorded diff.\n\nScope:\n1. BEFORE changing the CDK version, add a test-only golden-template harness and capture golden templates on the current\n Amazon.CDK.Lib 2.273.0 for the four existing constructs (LambdaFunctionConstruct, StaticSiteConstruct, DynamoDbTableConstruct,\n CognitoUserPoolConstruct) in default and representative configurations (e.g. Lambda: OTEL on/off, URL on/off, permissions;\n StaticSite: with/without ApiDomain and alternate domains; DynamoDB: GSI/stream/TTL; Cognito: domain prefix vs custom domain with\n explicit IHostedZone/ICertificate, groups, resource servers). Avoid configurations that require HostedZone.FromLookup unless the\n test supplies context; prefer deterministic inputs (no random AutoFixture values in golden stacks).\n2. Bump Amazon.CDK.Lib to 2.274.0 in Directory.Packages.props (the only dependency change).\n3. Re-run: golden templates must be identical (zero diff).\n\nHarness requirements (reused by later beads):\n- Lives in the test project (e.g. test/LayeredCraft.Cdk.Constructs.Tests/TestKit/Golden/GoldenTemplate.cs) with golden files under\n test/LayeredCraft.Cdk.Constructs.Tests/GoldenTemplates/*.json (copied to output).\n- Compares the COMPLETE synthesized template (Template.FromStack(...).ToJSON()), normalized only for asset hashes / asset\n S3 keys and CDK metadata (aws:cdk:path, CDKMetadata resource, BootstrapVersion parameter/rule). Document normalization in code.\n- Regeneration only when an env var (e.g. UPDATE_GOLDEN_TEMPLATES=1) is set; default mode fails on any diff with a readable diff message.\n- Stable across all target frameworks (net8.0–net11.0).\n\nExpected files: Directory.Packages.props; test/.../TestKit/Golden/*; test/.../GoldenTemplates/*.json; test/.../ExistingConstructsGoldenTemplateTests.cs; test csproj (copy golden files).\n\nExclusions: no changes to src/ production code; no new constructs; no other package bumps.\nEdge cases: CDK 2.274 may change synthesized output of existing constructs (e.g. new defaults/feature flags). If any golden diff\nappears after the bump, STOP and record the diff on this bead as a blocker for maintainer review; do not \"fix\" by editing goldens.\nAlso record whether CDK default-rule validation still warns \"Unknown resource type AWS::Lambda::WebFunction\" on 2.274 (design §5.5).\n","acceptance_criteria":"- Golden templates for all four existing constructs were generated on Amazon.CDK.Lib 2.273.0 BEFORE the upgrade, passed on 2.273.0, and their SHA-256 hashes are recorded in notes.\n- After upgrading to 2.274.0 the comparison ran against that ORIGINAL baseline; golden-file hashes are unchanged (no regeneration or acceptance of snapshots).\n- If the upgrade changed any synthesized template, the bead is blocked with the recorded diff instead of closed.\n- Directory.Packages.props uses Amazon.CDK.Lib 2.274.0; no other dependency changed.\n- After the bump all golden tests pass with zero diff on every target framework.\n- Harness supports regeneration via env var and fails readably on diff by default.\n- Full validation gates (restore/build/test) pass; coverage threshold not reduced.\n- Notes record commands run, the golden file list, and the 2.274 CloudFormation-Validate warning observation.","notes":"T0 (cdkc-18e.1) implementation evidence\n\nFILES CHANGED / ADDED\n- Directory.Packages.props: Amazon.CDK.Lib 2.273.0 -\u003e 2.274.0 (ONLY dependency change; diff is a single line).\n- test/LayeredCraft.Cdk.Constructs.Tests/LayeredCraft.Cdk.Constructs.Tests.csproj: added \u003cNone Update=\"GoldenTemplates\\**\\*.json\"\u003e\u003cCopyToOutputDirectory\u003ePreserveNewest\u003c/CopyToOutputDirectory\u003e.\n- test/LayeredCraft.Cdk.Constructs.Tests/TestKit/Golden/GoldenTemplate.cs (new): golden harness.\n- test/LayeredCraft.Cdk.Constructs.Tests/ExistingConstructsGoldenTemplateTests.cs (new): 17 golden cases across the 4 existing constructs.\n- test/LayeredCraft.Cdk.Constructs.Tests/GoldenTemplates/*.json (new): 17 baseline golden templates.\nNo changes to src/ production code.\n\nGOLDEN COVERAGE ADDED (17 templates)\n- LambdaFunctionConstruct: lambda-default, lambda-otel-amd64, lambda-otel-arm64, lambda-permissions, lambda-url, lambda-otel-url-permissions.\n- StaticSiteConstruct: static-site-default, static-site-api, static-site-alternates, static-site-full.\n- DynamoDbTableConstruct: dynamodb-default, dynamodb-sort-key, dynamodb-gsi, dynamodb-stream-ttl.\n- CognitoUserPoolConstruct: cognito-prefix-domain, cognito-custom-domain, cognito-no-domain.\n\nNORMALIZATION (documented in GoldenTemplate.cs)\nCompares the COMPLETE Template.FromStack(...).ToJSON(). Only: BootstrapVersion parameter + CheckBootstrapVersion rule removed; AWS::CDK::Metadata resource removed; per-resource Metadata removed (aws:cdk:path / aws:asset:path); 64-hex asset content hashes / S3 keys replaced with \u003cASSET-HASH\u003e. No other keys altered. Regeneration only when UPDATE_GOLDEN_TEMPLATES is truthy; default mode fails with a readable -/+ line diff and never overwrites the golden. Golden files resolve from the source tree (walk-up to project dir) with an output-dir fallback.\n\nCOMMANDS + RESULTS\n- Baseline restore on 2.273.0: `dotnet restore LayeredCraft.Cdk.Constructs.slnx` OK.\n- Baseline test on 2.273.0: `dotnet test --solution LayeredCraft.Cdk.Constructs.slnx -c Release` -\u003e PASSED, 186 x net8.0/net9.0/net10.0/net11.0 (744 total), 0 failed, 0 skipped.\n- Golden files SHA-256 recorded, then upgrade to 2.274.0: `dotnet restore` OK; `dotnet list ... package` shows Amazon.CDK.Lib 2.274.0.\n- Post-upgrade test on 2.274.0 (against the ORIGINAL unchanged baseline): `dotnet test --solution LayeredCraft.Cdk.Constructs.slnx -c Release` -\u003e PASSED, 186 x4 TFMs (744 total), 0 failed, 0 skipped, ZERO golden diff on every TFM.\n- `shasum -a 256` before vs after: HASHES IDENTICAL (git tracked files unmodified by the run).\n\nBASELINE SHA-256 (identical before and after upgrade)\n66398f765a746fbe76268e666d0b492ddb8aadec9f2c4c76d17a25b6981cc769 cognito-custom-domain.json\n3396b3ceeedbd15de26119076158e3f1d0c8bc638f1a2be556e8d87fa8dce30b cognito-no-domain.json\nd18cc32d82a07f45534584a59f5431540883baf24d4bf7311a8ebe14c0ac5447 cognito-prefix-domain.json\n0d5397ab86db3dd0194fd4a6463ebd9461005c65f7964be0b617dfab9ade384e dynamodb-default.json\n07a9509cad0feb734c4c48eec96b4271a9e7c80acb7bdcf39a4bfb6de300e80d dynamodb-gsi.json\n1517371079a842ed38ac411b64e1c4093c80e6b896a77b0ca766762ef9e8412b dynamodb-sort-key.json\n5a500b2d5d2073d0747b355aa19aae5092d8754ad8e529776bebb91997679ab8 dynamodb-stream-ttl.json\nd1038f5889457882b0a50736446376b8a05d9430db99429b39bec989bcd3073b lambda-default.json\n796c2acdaca4bb90df681ddfcd05c5867ed3d0e8e05b0ec417d4cac067fed881 lambda-otel-amd64.json\n26f601e11cb042ed163cc595fb9131bbb1fddbaa0d6993ff6d3a1dfcf094c543 lambda-otel-arm64.json\n8aadb2159cc9febd6a73a7aa888ce470b3ef81eabc8c857174615166efd3b1ff lambda-otel-url-permissions.json\n648cd4745abb61979544466c171b72f7cc70b1e239ca43ec4a58c0e50151a9f6 lambda-permissions.json\nf9b86ad9c94ad499e373df8b97536e0525b4d0565c34539a75df0bd720308362 lambda-url.json\nb1bc13271470ae7136b8f085de3f584e51409acb69788764957079df1c3dd639 static-site-alternates.json\nb5e4a36010f31a7666cc0b9fb0ce94754ed046bb1a6cf3a993bf57d7b0970973 static-site-api.json\n1eb6acb8bd3579c9157ee82fe94e24727c35dafa91828dd7f5d9cc3359cc8f38 static-site-default.json\n63bfa34136f47b16bd7829efa91c8b66b1d000bb2096beeccf961e8ff5a09a04 static-site-full.json\n\n2.274 CLOUDFORMATION DEFAULT-RULE VALIDATION OBSERVATION\nStill warn-only (feature flag @aws-cdk/core:validateAgainstDefaultRules remains OFF by default). A temporary probe that synthesized a raw CfnResource of type AWS::Lambda::WebFunction emitted:\n WARNING Unknown resource type 'AWS::Lambda::WebFunction' (CloudFormation Validate) [CloudFormation-Validate::F3006]\n Set feature flag \"@aws-cdk/core:validateAgainstDefaultRules\" to true to turn these into errors.\nSo the unknown AWS::Lambda::WebFunction type is still only a warning (not an error) on 2.274. Note: the 2.274 assembly does now ship CfnWebFunction / CfnWebFunctionEndpoint / CfnWebFunctionRevision L1 types. The temporary probe file was removed and is not part of the deliverable.\n\nCOVERAGE\nsrc/ production code is unchanged, so the CI 80% coverage gate is unaffected.\n\nRESTRICTIONS HONORED\nNo src/ changes, no new constructs, no other dependency bumps, goldens not regenerated/adjusted, normalization not weakened, no commit/push/PR/deploy/publish.","spec_id":"docs/designs/lambda-web-functions-integration.md","status":"closed","priority":1,"issue_type":"task","assignee":"Nick Cipollina","owner":"ncipollina@gmail.com","created_at":"2026-10-23T01:14:46Z","created_by":"Nick Cipollina","updated_at":"2026-10-23T01:32:51Z","started_at":"2026-10-23T01:23:53Z","closed_at":"2026-10-23T01:32:51Z","close_reason":"T0 complete: golden baseline (17 templates, 4 constructs) captured and verified on 2.273.0; Amazon.CDK.Lib bumped to 2.274.0 (only dependency change); goldens re-verified against unchanged baseline with zero diff and identical SHA-256 on all 4 TFMs; 186x4 tests pass. 2.274 default-rule validation still warns (not errors) on unknown AWS::Lambda::WebFunction.","external_ref":"gh-98","labels":["baseline","lambda-web-functions","t0"],"dependencies":[{"issue_id":"cdkc-18e.1","depends_on_id":"cdkc-18e","type":"parent-child","created_at":"2026-10-23T01:14:46Z","created_by":"Nick Cipollina","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"cdkc-18e","title":"AWS Lambda Web Functions support — LayeredCraft.Cdk.Constructs","description":"Implement AWS Lambda Web Functions support in LayeredCraft.Cdk.Constructs per the APPROVED design (revision 3):\ndocs/designs/lambda-web-functions-integration.md (authoritative; GitHub issue #98).\n\nScope: new additive constructs WebFunctionConstruct, WebFunctionEndpointConstruct/IWebFunctionEndpoint, WebFunctionOrigin,\nWebFunctionCode.FromBucket, WebFunctionLogs, supporting models, Testing helpers, docs, and a mandatory AWS sandbox release gate.\n\nNon-negotiable constraints (design §2, §6, §8, §10.2, §12.4):\n- Hybrid composition; L3 over CDK L1 (CfnWebFunction/Revision/Endpoint, CfnResourcePolicy); no upstream alpha/L2 dependency;\n upstream L2 types never appear in the public API.\n- Existing constructs (LambdaFunctionConstruct, StaticSiteConstruct, DynamoDbTableConstruct, CognitoUserPoolConstruct) are\n NOT modified; their synthesized templates must not change (golden templates from cdkc T0).\n- Explicit AuthType on every endpoint (no default). Single-owner resource policy per function. Same-stack automatic OAC\n permissions only. Limited endpoint imports (no whole-function import). Existing S3 artifacts only (no FromAsset).\n Default log retention TWO_WEEKS. No customer-managed revision KMS key. Workload-neutral (Next.js, ASP.NET Core shim,\n Blazor Static SSR) with no workload-specific constructs.\n- GrantInvoke follows the revision-3 algorithm in §10.2 (account establishment E1/E2, Automatic vs ExternallyManaged).\n Never use Grant.AddToPrincipalOrResource or trust Grant.Success/AssertSuccess.\n- Amazon.CDK.Lib floor 2.274.0.\n\nRules for every implementation agent:\n- Implement only the claimed bead's scope. If the design is ambiguous or seems wrong, stop and record a blocker note on\n the bead (bd update \u003cid\u003e --append-notes ...) instead of changing the design.\n- Do not commit, push, open PRs, publish NuGet packages, or close GitHub issue #98 unless separately authorized by the maintainer.\n- Do not deploy to AWS except in the sandbox bead, and only with maintainer-provided non-production credentials.\n- Do not modify the Sharedale repository.\n- Validation gates (run from repo root): `dotnet restore LayeredCraft.Cdk.Constructs.slnx`, `dotnet build LayeredCraft.Cdk.Constructs.slnx -c Release`,\n `dotnet test --solution LayeredCraft.Cdk.Constructs.slnx -c Release` (Microsoft.Testing.Platform, see global.json); CI requires\n 80% coverage across net8.0–net11.0. Docs: `uv run mkdocs build --clean`. If Node \u003e24 prints jsii warnings, set\n JSII_SILENCE_WARNING_UNTESTED_NODE_VERSION=1.\n- Test conventions: xUnit v3, AwesomeAssertions, AutoFixture TestKit customizations, `[Collection(\"CDK Tests\")]`, Template.FromStack\n after constructs are added (see CLAUDE.md \"Testing Patterns\").\n- Close a bead only when its acceptance criteria are met; record validation evidence (commands run + results) in notes.\n\nFeature completion is gated by the \"Verify release acceptance criteria\" bead, which depends on the sandbox deployment bead.\nOptional bead T4a never blocks completion.\n","acceptance_criteria":"All required child beads closed, including the AWS sandbox release gate and the release acceptance verification bead; optional spike may be open or closed.","notes":"Agent workflow: find work with 'bd ready --parent cdkc-18e --exclude-type epic'; read 'bd show \u003cid\u003e' (description, acceptance, deps); claim with 'bd update \u003cid\u003e --claim' (or --status in_progress); record evidence with 'bd update \u003cid\u003e --append-notes \"...\"'; close with 'bd close \u003cid\u003e --reason \"...\"' only when acceptance criteria are met; then re-run bd ready. Never claim or close this epic directly: when all children are closed, the maintainer runs 'bd epic close-eligible'. Optional spike cdkc-18e.7 never blocks required work; close it with outcome A or B before epic closure. The feature is complete only after cdkc-18e.14 (which depends on the mandatory AWS sandbox gate cdkc-18e.13).","spec_id":"docs/designs/lambda-web-functions-integration.md","status":"closed","priority":1,"issue_type":"epic","owner":"ncipollina@gmail.com","created_at":"2026-10-23T01:14:45Z","created_by":"Nick Cipollina","updated_at":"2026-10-27T20:08:16Z","closed_at":"2026-10-27T20:08:16Z","close_reason":"All children completed","external_ref":"gh-98","labels":["lambda-web-functions"],"dependency_count":0,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.2.7","title":"#109 HUMAN GATE: owner merges PR for #109","status":"open","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-11-24T02:33:29Z","created_by":"claude","updated_at":"2026-11-24T02:33:29Z","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.2.7","depends_on_id":"cdkc-2lh.2","type":"parent-child","created_at":"2026-11-24T02:33:29Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.2.7","depends_on_id":"cdkc-2lh.2.6","type":"blocks","created_at":"2026-11-24T02:33:44Z","created_by":"claude","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.2.6","title":"#109 P: PR review (targeted Codex)","status":"open","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-11-24T02:33:28Z","created_by":"claude","updated_at":"2026-11-24T02:33:28Z","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.2.6","depends_on_id":"cdkc-2lh.2","type":"parent-child","created_at":"2026-11-24T02:33:28Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.2.6","depends_on_id":"cdkc-2lh.2.5","type":"blocks","created_at":"2026-11-24T02:33:42Z","created_by":"claude","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.2.5","title":"#109 R: local review and final validation","notes":"Integration 77ac802 (central AutoFixture/NSubstitute/VSTest removal, CLAUDE.md test sections). Final validation on 77ac802 parents (clean tree, git clean -fdx): build Release 0 warn/0 err; dotnet test --solution -- --coverage: net10.0 +595, net11.0 +595, 1190 passed 0 failed; line coverage 94.5%, branch 86.3%; goldens byte-identical; no AutoFixture/NSubstitute/net8/net9 refs in src/test/.github/props. actionlint exit 0 (W1 tree). Release Drafter check: since v2.6.0 only #106 (type: chore) merged; breaking-change label exists -\u003e major -\u003e 3.0.0.","status":"closed","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-11-24T02:33:27Z","created_by":"claude","updated_at":"2026-11-24T03:39:12Z","closed_at":"2026-11-24T03:39:12Z","close_reason":"All local gates pass on final commit","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.2.5","depends_on_id":"cdkc-2lh.2","type":"parent-child","created_at":"2026-11-24T02:33:27Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.2.5","depends_on_id":"cdkc-2lh.2.1","type":"blocks","created_at":"2026-11-24T02:33:35Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.2.5","depends_on_id":"cdkc-2lh.2.2","type":"blocks","created_at":"2026-11-24T02:33:37Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.2.5","depends_on_id":"cdkc-2lh.2.3","type":"blocks","created_at":"2026-11-24T02:33:39Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.2.5","depends_on_id":"cdkc-2lh.2.4","type":"blocks","created_at":"2026-11-24T02:33:41Z","created_by":"claude","metadata":"{}"}],"dependency_count":4,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.2.4","title":"#109 T: 3.0.0 design doc incl. WebFunctionConstruct vs CDK L2 decision record (Claude)","notes":"Design doc committed 32cef89 (docs/designs/v3-modernization.md, rev 1 Proposed): policy, upgrade-induced changes, versioning, U1-U4/U7, U6, WebFunctionConstruct vs CDK L2 decision record with synthesis spike evidence; recommends A for 3.0.0, proposes separate gated spike issue for C (needs owner approval). Owner approval of the design is a #109 acceptance item (open).","status":"closed","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-11-24T02:33:26Z","created_by":"claude","updated_at":"2026-11-24T03:39:10Z","closed_at":"2026-11-24T03:39:10Z","close_reason":"Design drafted and committed 32cef89; owner approval tracked on #109","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.2.4","depends_on_id":"cdkc-2lh.2","type":"parent-child","created_at":"2026-11-24T02:33:26Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.2.4","depends_on_id":"cdkc-2lh.2.1","type":"blocks","created_at":"2026-11-24T02:33:40Z","created_by":"claude","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.2.3","title":"#109 T: Compono test-stack migration replacing AutoFixture/NSubstitute (OpenCode W2)","notes":"OWNERSHIP: may change test/LayeredCraft.Cdk.Constructs.Tests/** except GoldenTemplates/**, TestAssets/**, TestKit/Golden/**. Must not: src/**, Directory.*.props (Claude), global.json, .github, docs, README, CLAUDE.md. Worktree ../worktrees/cdk-constructs-w2-compono branch test/v3-compono baseline ab2483b; brief /private/tmp/claude-501/-Users-ncipollina-source-repos-ncipollina-jedi-duel/ff5c8c05-e7c5-46dd-80db-44e46f5c7f53/scratchpad/v3/brief-w2-compono.md; log /private/tmp/claude-501/-Users-ncipollina-source-repos-ncipollina-jedi-duel/ff5c8c05-e7c5-46dd-80db-44e46f5c7f53/scratchpad/v3/w2.log\nW2 session ses_df496565affeRbmllFcBWcbts3. Observed reads: all required (AGENTS, SKILL, implement, testing, cross-repository, compono SKILL + xunit-v3/registrations/composition-model/patterns/diagnostics, CLAUDE.md). Round 1: f6f6ce2..0ab6d0b (profiles, per-construct migration, package removal), 595/TFM. Claude finding C1 (incidental values no longer generated) -\u003e correction-1: d90be14, 3e12fcc (MemorySize/Timeout/log levels generated via CompositionContext.DeriveSeed within valid ranges; documented 'Compono does not provide this because' optional members). Worker: 3x full suite 595/TFM. Merged 2526588.","status":"closed","priority":2,"issue_type":"task","assignee":"claude","owner":"ncipollina@gmail.com","created_at":"2026-11-24T02:33:24Z","created_by":"claude","updated_at":"2026-11-24T03:39:08Z","started_at":"2026-11-24T02:36:37Z","closed_at":"2026-11-24T03:39:08Z","close_reason":"Reviewed; merged 2526588; 595/TFM","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.2.3","depends_on_id":"cdkc-2lh.2","type":"parent-child","created_at":"2026-11-24T02:33:24Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.2.3","depends_on_id":"cdkc-2lh.2.1","type":"blocks","created_at":"2026-11-24T02:33:38Z","created_by":"claude","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.2.2","title":"#109 T: workflows (devops-templates v11.2, action pins) + docs/CLAUDE.md/README (OpenCode W1)","notes":"OWNERSHIP: may change .github/workflows/*, README.md, CLAUDE.md (excluding testing sections), docs/** except docs/designs/**. Must not: src, test, props, global.json, release-drafter.yml, dependabot.yml. Worktree ../worktrees/cdk-constructs-w1-workflows branch ci/v3-workflows-docs baseline ab2483b; brief /private/tmp/claude-501/-Users-ncipollina-source-repos-ncipollina-jedi-duel/ff5c8c05-e7c5-46dd-80db-44e46f5c7f53/scratchpad/v3/brief-w1-workflows.md; log /private/tmp/claude-501/-Users-ncipollina-source-repos-ncipollina-jedi-duel/ff5c8c05-e7c5-46dd-80db-44e46f5c7f53/scratchpad/v3/w1.log\nW1 session ses_df49637d7ffeeHlCYvnfVE26JR; OpenCode 1.19.3 / openrouter/deepseek/deepseek-v4.1-flash. Round 1 commits dd63def ci v11.2, 8fd2dd0 docs. Observed reads: all required paths. Worker validation: YAML parse (ruby), actionlint exit 0, greps clean. Review findings -\u003e correction-1 (same session): C1 blocking false 'L1-only' claims (CDK 2.278 ships L2) + add consumer type-name collision note; C2 blocking unverified F3006@2.278 claim, restore 2.274 wording; C3 SDK pin is contributor not consumer requirement; C4 publish-release comment consistency.\nCorrection-1 commits bb7c44d, 4164270 address C1-C4; Claude re-ran actionlint (exit 0); sample check confirmed. Integration follow-up (Claude): add IWebFunctionEndpoint (root namespace) to the collision note. Merged into chore/v3-modernization.","status":"closed","priority":2,"issue_type":"task","assignee":"claude","owner":"ncipollina@gmail.com","created_at":"2026-11-24T02:33:23Z","created_by":"claude","updated_at":"2026-11-24T02:40:44Z","started_at":"2026-11-24T02:36:37Z","closed_at":"2026-11-24T02:40:44Z","close_reason":"W1 reviewed, no blocking findings after correction-1; merged","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.2.2","depends_on_id":"cdkc-2lh.2","type":"parent-child","created_at":"2026-11-24T02:33:23Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.2.2","depends_on_id":"cdkc-2lh.2.1","type":"blocks","created_at":"2026-11-24T02:33:36Z","created_by":"claude","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.2.1","title":"#109 T: foundation — SDK pin, net10/net11, dependency bumps, CDK 2.278 compile/jsii fixes (Claude)","notes":"Claude foundation on chore/v3-modernization (worktree ../worktrees/cdk-constructs-v3-modernization): ab2a58b fix FunctionUrlOptions/AddBehaviorOptions (jsii 2.278 required-member validation); ab2483b build! net10/net11, SDK 11.0.100, CDK 2.278.0 (+ file-local aliases for CDK's new same-named Web Function types), SourceLink 11.0.100, xunit.v3.mtp-v2 4.0.3, MS.NET.Test.Sdk 18.12.0, runner.visualstudio 4.0.1, Compono 1.4.0 central, VersionPrefix 3.0.0. Validation: build 0 warn/0 err; dotnet test --solution 595 passed per TFM (net10.0, net11.0); goldens byte-identical; baseline before: 595x4 TFMs.","status":"closed","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-11-24T02:33:22Z","created_by":"claude","updated_at":"2026-11-24T02:36:35Z","closed_at":"2026-11-24T02:36:35Z","close_reason":"Foundation committed ab2483b; green; goldens unchanged","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.2.1","depends_on_id":"cdkc-2lh.2","type":"parent-child","created_at":"2026-11-24T02:33:22Z","created_by":"claude","metadata":"{}"}],"dependency_count":0,"dependent_count":4,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.7","title":"HUMAN GATE: owner authorizes #110/#111 implementation (after #109 design review)","description":"Owner 2026-11-24: #110-#112 may not start until the #109 design and implementation are reviewed and the next phase is authorized.","status":"open","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-11-24T02:33:18Z","created_by":"claude","updated_at":"2026-11-24T02:33:18Z","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.7","depends_on_id":"cdkc-2lh","type":"parent-child","created_at":"2026-11-24T02:33:18Z","created_by":"claude","metadata":"{}"},{"issue_id":"cdkc-2lh.7","depends_on_id":"cdkc-2lh.2","type":"blocks","created_at":"2026-11-24T02:33:20Z","created_by":"claude","metadata":"{}"}],"dependency_count":1,"dependent_count":2,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.6","title":"HUMAN GATE: owner publishes the v3.0.0 stable release","description":"After #112 downstream validation evidence. Publishing the GitHub release triggers publish-release.yaml (NuGet push).","acceptance_criteria":"Owner publishes; release URL + NuGet version recorded.","status":"open","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-11-24T01:27:25Z","created_by":"Nick Cipollina","updated_at":"2026-11-24T01:27:25Z","labels":["human-gate","release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.6","depends_on_id":"cdkc-2lh","type":"parent-child","created_at":"2026-11-24T01:27:25Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-2lh.6","depends_on_id":"cdkc-2lh.5","type":"blocks","created_at":"2026-11-24T01:27:31Z","created_by":"Nick Cipollina","metadata":"{}"}],"dependency_count":1,"dependent_count":0,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.5","title":"#112 3.0.0: downstream validation (Jedi Duel, Sharedale) and stable release","description":"https://github.com/LayeredCraft/cdk-constructs/issues/112 (authoritative). Throwaway-branch validation against the same 3.0.0-preview in both consumers; nothing merged downstream here.","acceptance_criteria":"See #112.","status":"open","priority":2,"issue_type":"feature","owner":"ncipollina@gmail.com","created_at":"2026-11-24T01:27:24Z","created_by":"Nick Cipollina","updated_at":"2026-11-24T01:27:24Z","external_ref":"gh-112","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.5","depends_on_id":"cdkc-2lh","type":"parent-child","created_at":"2026-11-24T01:27:24Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-2lh.5","depends_on_id":"cdkc-2lh.3","type":"blocks","created_at":"2026-11-24T01:27:29Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-2lh.5","depends_on_id":"cdkc-2lh.4","type":"blocks","created_at":"2026-11-24T01:27:30Z","created_by":"Nick Cipollina","metadata":"{}"}],"dependency_count":2,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.4","title":"#111 3.0.0: private static-assets construct (BPA, OAC, optional DNS, immutable deployment)","description":"https://github.com/LayeredCraft/cdk-constructs/issues/111 (authoritative).","acceptance_criteria":"See #111.","status":"open","priority":2,"issue_type":"feature","owner":"ncipollina@gmail.com","created_at":"2026-11-24T01:27:22Z","created_by":"Nick Cipollina","updated_at":"2026-11-24T01:27:22Z","external_ref":"gh-111","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.4","depends_on_id":"cdkc-2lh","type":"parent-child","created_at":"2026-11-24T01:27:22Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-2lh.4","depends_on_id":"cdkc-2lh.2","type":"blocks","created_at":"2026-11-24T01:27:28Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-2lh.4","depends_on_id":"cdkc-2lh.7","type":"blocks","created_at":"2026-11-24T02:33:19Z","created_by":"claude","metadata":"{}"}],"dependency_count":2,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.3","title":"#110 3.0.0: LambdaFunctionConstruct U1 alias name, U2 alias-only default, U3 public alias, U4 scoped log policy, U7 S3 artifacts","description":"https://github.com/LayeredCraft/cdk-constructs/issues/110 (authoritative).","acceptance_criteria":"See #110.","status":"open","priority":2,"issue_type":"feature","owner":"ncipollina@gmail.com","created_at":"2026-11-24T01:27:21Z","created_by":"Nick Cipollina","updated_at":"2026-11-24T01:27:21Z","external_ref":"gh-110","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.3","depends_on_id":"cdkc-2lh","type":"parent-child","created_at":"2026-11-24T01:27:21Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-2lh.3","depends_on_id":"cdkc-2lh.2","type":"blocks","created_at":"2026-11-24T01:27:27Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-2lh.3","depends_on_id":"cdkc-2lh.7","type":"blocks","created_at":"2026-11-24T02:33:19Z","created_by":"claude","metadata":"{}"}],"dependency_count":2,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.2","title":"#109 3.0.0: drop net8/net9, update all dependencies, SDK and workflows, Compono-first tests (+ design doc)","description":"https://github.com/LayeredCraft/cdk-constructs/issues/109 (authoritative). Golden templates byte-identical; breaking-change label; supersedes Dependabot #101; first merge publishes 3.0.0-preview.N.","acceptance_criteria":"See #109.","status":"in_progress","priority":2,"issue_type":"feature","assignee":"claude","owner":"ncipollina@gmail.com","created_at":"2026-11-24T01:27:20Z","created_by":"Nick Cipollina","updated_at":"2026-11-24T02:33:21Z","started_at":"2026-11-24T02:33:21Z","lease_expires_at":"2026-11-24T02:38:21Z","heartbeat_at":"2026-11-24T02:33:21Z","external_ref":"gh-109","labels":["release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.2","depends_on_id":"cdkc-2lh","type":"parent-child","created_at":"2026-11-24T01:27:20Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-2lh.2","depends_on_id":"cdkc-2lh.1","type":"blocks","created_at":"2026-11-24T01:27:26Z","created_by":"Nick Cipollina","metadata":"{}"}],"dependency_count":1,"dependent_count":3,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh.1","title":"HUMAN GATE: owner authorizes 3.0.0 implementation","description":"Planning authorized 2026-11-24 (issues/Beads only). Implementation needs the owner's separate explicit authorization.","acceptance_criteria":"Owner authorization quoted in a note.","notes":"Owner statement 2026-11-24: 'Authorize upstream Phase 1a — #109. Proceed with the modernization of LayeredCraft.Cdk.Constructs ... Create the PR for my review. I retain merge and publication authority.' and 'Do not begin #110, #111 or #112 implementation until the #109 design and implementation have been reviewed and the next phase is authorized.' Gate covers #109 only.","status":"closed","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-11-24T01:27:19Z","created_by":"Nick Cipollina","updated_at":"2026-11-24T02:33:17Z","closed_at":"2026-11-24T02:33:17Z","close_reason":"Owner authorized Phase 1a (#109 only) 2026-11-24; #110-#112 need a new gate","labels":["human-gate","release:v3.0.0"],"dependencies":[{"issue_id":"cdkc-2lh.1","depends_on_id":"cdkc-2lh","type":"parent-child","created_at":"2026-11-24T01:27:19Z","created_by":"Nick Cipollina","metadata":"{}"}],"dependency_count":0,"dependent_count":1,"comment_count":0} +{"_type":"issue","id":"cdkc-2lh","title":"LayeredCraft.Cdk.Constructs 3.0.0 — .NET 10/11 modernization, LambdaFunctionConstruct options, private static assets","description":"GitHub milestone v3.0.0 https://github.com/LayeredCraft/cdk-constructs/milestone/1 ; epic issue https://github.com/LayeredCraft/cdk-constructs/issues/108 (authoritative scope; Beads = execution state). Owner decisions 2026-11-24: dogfooding is an architectural requirement; fix gaps upstream; don't compromise APIs to avoid breaking changes; drop net8/net9; update all deps/SDK/workflows to current stable; Compono-first tests; U2 default alias-only; include U7 S3 artifacts. Preview strategy: first code PR (#109) labeled breaking-change so all previews are 3.0.0-preview.N; fold Dependabot #101 into #109; stable publish only on owner authorization. Downstream consumers: ncipollina/jedi-duel #292 (tracking bead jedi-duel-aub.16), sharedale/sharedale #266.","acceptance_criteria":"All child issues closed with evidence; net10/net11 green; golden diffs only intentional; migration guide; downstream validation; owner publishes v3.0.0.","status":"open","priority":2,"issue_type":"epic","owner":"ncipollina@gmail.com","created_at":"2026-11-24T01:27:17Z","created_by":"Nick Cipollina","updated_at":"2026-11-24T01:27:17Z","external_ref":"gh-108","labels":["release:v3.0.0"],"dependency_count":0,"dependent_count":0,"comment_count":0} {"_type":"issue","id":"cdkc-18e.18.3","title":"#104 O: Document companion log groups, ownership, regional limits, and AlreadyExists remedies","description":"Objective: consumer documentation and operational guidance for LayeredCraft/cdk-constructs#104, written against design\nrevision 5 (cdkc-18e.18.1). May run in parallel with cdkc-18e.18.2 once revision 5 is approved; reconcile with the final\ncode before the PR. (Design doc itself: cdkc-18e.18.1. XML docs: cdkc-18e.18.2.)\n\nFiles: docs/constructs/web-function.md (\"Execution Role and Logging\" ~L132-139, props table ~L95, reserved IDs ~L151,\ntesting helpers ~L369, limitations ~L387-388); docs/testing/index.md (Web Function assertions, if listed);\nCHANGELOG.md [Unreleased]; CLAUDE.md (WebFunctionConstructAssertions list + WebFunctionLogs notes).\n\nMust cover:\n1. Why two groups exist (in-Region staging -\u003e home-Region centralization) and why events look duplicated (same\n timestamps/messages; centralized stream name adds -{account}-{region}); storage billed for both.\n2. Retention: centralized default TWO_WEEKS, companion default THREE_DAYS, why the companion is short; how to set\n both (Create(retention, removalPolicy, companionRetention)); companion inherits the removal policy.\n3. Which group to query: centralized for normal querying/alarms; `.local` in the serving Region for lowest-latency Live Tail.\n4. Ownership table for Create / Use(logGroup) / Use(logGroup, companion) / ServiceDefault: who creates, owns,\n deletes each group; ServiceDefault = both service-created, unlimited retention, outlive the stack.\n5. Execution-role permissions: the verified resource types (CreateLogGroup -\u003e log-group ARN; CreateLogStream/\n PutLogEvents -\u003e log-stream ARN), the per-role matrix, and the exact caller-provided permissions from design rev 5\n §8.3 (stream write on {c}:log-stream:* in the home Region and {c}.local:log-stream:* in {R}; CreateLogGroup on\n {c}.local only where Lambda creates it, and on {c} for ServiceDefault). Without .local write, logs from that Region\n are not delivered. Immutable roles are caller-managed.\n6. Ordering: managed groups precede the revision; supplied same-stack groups too; imported/cross-stack groups must\n exist before deployment.\n7. Regional limits: PerRegion/MultiRegion companions in other Regions are service-created with no expiry and not\n managed; set retention there separately; W2 id and how to acknowledge (Annotations acknowledgeWarning /\n `cdk synth --strict` impact). W1 id for Use without companion.\n8. AlreadyExists when adopting a managed companion where Lambda already created `{name}.local` (e.g. preview.27 stacks\n that served traffic, ServiceDefault -\u003e Create, redeploy after stack deletion): remedies = delete the\n service-created group(s) before deploying, or move to a new centralized group name; no adoption support.\n9. Teardown: DESTROY removes both managed groups after the revision; RETAIN keeps both; remote-Region companions\n always remain.\n10. CHANGELOG: Added (companion group, companionRetention, Use companion, LocalLogGroup, assertions, warnings);\n Fixed (missing .local write grant for Use custom groups; missing ordering for same-stack supplied groups);\n Notes (two groups per Create, AlreadyExists, binary break vs 2.6.0-preview.27 requiring recompilation). Reference #104;\n claim no released version.\n","acceptance_criteria":"- Topics 1–10 covered, with code examples for Create(custom retentions) and Use(logGroup, companion).\n- Ownership table and permissions matrix present in docs/constructs/web-function.md.\n- W1/W2 ids documented verbatim.\n- CHANGELOG [Unreleased] entry references #104 and claims no released version.\n- Docs match the final implemented API names/defaults (cross-checked with cdkc-18e.18.2 before the PR).\n- `uv run mkdocs build --clean` passes.","notes":"Documentation complete per design revision 5. Updated docs/constructs/web-function.md (two-group behavior, duplicate events/storage, query guidance, Create/Use/ServiceDefault, ownership+retention table, ordering/teardown, execution-role and caller-provided permissions incl. log-group vs log-stream ARNs and minimizePolicies, Multi-Region/W2, verbatim W1/W2 IDs and acknowledgement, AlreadyExists remedies, public API, testing helpers). Updated docs/testing/index.md (ShouldHaveWebFunctionLogGroup, ShouldHaveCompanionLogGroup, ShouldHaveRevisionDependingOnLogGroups), CLAUDE.md, and CHANGELOG [Unreleased] Added/Fixed/Notes for #104 with no released version claimed. Validation: uv run mkdocs build --strict --clean passed with no errors/warnings (built in 1.20s); AWS logging/permissions docs and GitHub #104 links return 200; internal anchors verified in built HTML; examples cross-checked against WebFunctionLogs.cs/WebFunctionConstruct.cs; W1/W2 IDs exact; design revision 5 unchanged; no src/test/GoldenTemplates changes; git diff --check clean.","spec_id":"docs/designs/lambda-web-functions-integration.md","status":"closed","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-10-26T15:32:53Z","created_by":"Nick Cipollina","updated_at":"2026-10-26T22:57:33Z","started_at":"2026-10-26T22:52:52Z","closed_at":"2026-10-26T22:57:33Z","close_reason":"Documentation for #104 completed against design revision 5: two-group logging behavior, all three modes, ownership/retention and execution-role permission matrices, Multi-Region limits, verbatim W1/W2 warnings with acknowledgement, AlreadyExists remedies, public API/testing helpers, and CHANGELOG [Unreleased] entries. uv run mkdocs build --strict --clean passes; links, anchors, API examples, and warning IDs verified; no src/test/golden changes.","external_ref":"gh-104","labels":["docs","gh-104","lambda-web-functions","logging"],"dependencies":[{"issue_id":"cdkc-18e.18.3","depends_on_id":"cdkc-18e.18","type":"parent-child","created_at":"2026-10-26T15:32:53Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-18e.18.3","depends_on_id":"cdkc-18e.18.1","type":"blocks","created_at":"2026-10-26T15:32:53Z","created_by":"Nick Cipollina","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"cdkc-18e.16","title":"T2 follow-up: Harden owned code-bucket inspection (tokens, unrecognized values, DSSE classification)","description":"Purpose: align WebFunctionCodeFromBucket.ValidateOwnedBucketConfiguration (src/LayeredCraft.Cdk.Constructs/Models/WebFunctionCode.cs) with design §14 and the revision-4 clarification under the §14 table. Source: independent review findings P4 and DSSE.\n\nDefects:\n(1) Tokens are rejected instead of skipped: a VersioningConfiguration.Status token resolves to {Ref:...}, its ToString() is compared to 'Enabled', and the bucket is rejected.\n(2) A Stack.Resolve result whose structure is not recognized should be treated as unknown and skipped, not rejected.\n(3) UsesAwsManagedKey rejects every aws:kms:dsse bucket, including DSSE with a customer-managed key. Per §8.7/§14, reject only DSSE_MANAGED (no key) and KMS_MANAGED/aws/s3, and make each message name the actual problem.\n(4) Versioning enabled only through an escape-hatch property override is a documented limitation, not a fix target. T6a documents the workaround (Bucket.FromBucketName + ExternallyManaged).\n\nKeep the current rule that owned buckets are inspected even under ExternallyManaged; the design does not change that.\n\nTests: token Status skipped; DSSE with a customer key accepted; DSSE_MANAGED rejected with an accurate message; KMS_MANAGED still rejected; customer-key SSE-KMS accepted; unversioned still rejected.\n\nExclusions: IAM/grant code (T3c), docs (T6a). No golden changes expected; verify. No commits or pushes unless authorized.","acceptance_criteria":"• Unresolved bucket configuration values are handled conservatively: a token or unrecognized versioning Status, encryption algorithm, encryption structure, or KMS key id is SKIPPED and never rejected (each case has a test). Unresolved values are never treated as proof of a violation.\n• Literal violations are still rejected: unversioned, KMS_MANAGED/aws/s3, DSSE_MANAGED (no key).\n• DSSE with a customer-managed key is accepted. Messages name the actual problem.\n• Escape-hatch-only versioning remains a documented limitation (T6a); it is not handled in code.\n• New tests pass; all goldens unchanged.\n• Release build has 0 warnings and the full suite passes on net8.0–net11.0; evidence is recorded in notes.","notes":"Maintainer decision (2026-10-23): keep escape-hatch S3 versioning as a documented limitation. Handle unresolved values conservatively: never reject tokenized values.\nIMPLEMENTATION (2026-10-23): Rewrote WebFunctionCodeFromBucket.ValidateOwnedBucketConfiguration in src/LayeredCraft.Cdk.Constructs/Models/WebFunctionCode.cs into ValidateVersioning + ValidateEncryption + ValidateKmsKey, classifying every value as literal-valid, literal-invalid, or unresolved/unrecognized.\n\nStorage/versioning/encryption handling:\n- Versioning: missing VersioningConfiguration or literal Status \"Suspended\" -\u003e reject (VersioningMessage). Literal Status \"Enabled\" -\u003e accept. A token Status, a missing status key, a non-dictionary resolved structure, or any other literal status -\u003e skipped (never rejected).\n- Encryption: missing BucketEncryption -\u003e no violation. Unrecognized structure (not a map, no rules, no ServerSideEncryptionByDefault) -\u003e skipped. Algorithm literal \"aws:kms\": key literal aws/s3 or empty/absent -\u003e reject (KmsManagedMessage names aws/s3); literal customer key -\u003e accept; token/absent-as-token key -\u003e skipped (never treated as AWS-managed). Algorithm literal \"aws:kms:dsse\": no key / aws/s3 -\u003e reject (DsseManagedMessage names customer-managed key); literal customer key -\u003e accept; token key -\u003e skipped. AES256 and any other literal algorithm -\u003e accepted.\n- LiteralString helper returns null for a non-string value or a string containing `${Token[`, so resolved tokens are never misread as literals.\n\nSecurity-policy behavior: ExternallyManaged still inspects owned buckets (versioning/encryption) exactly as before - design §14 row unchanged. The Automatic-only cross-stack account/Region guard and AddToResourcePolicy remain bypassed under ExternallyManaged (no bucket-policy statement is generated). No other semantics changed.\n\nRegression tests added to test/LayeredCraft.Cdk.Constructs.Tests/WebFunctionConstructTests.cs (13 new): enabled+S3-managed accepted (asserts synthesized S3::BucketPolicy); disabled (Versioned=false) rejected with versioning message; suspended rejected; tokenized versioning Status skipped (asserts synthesized policy); unrecognized literal versioning Status skipped; AWS-managed KMS (aws/s3) rejected naming aws/s3; customer-managed KMS accepted; tokenized KMS key skipped; DSSE with customer-managed key accepted; DSSE_MANAGED rejected naming customer-managed; DSSE + aws/s3 rejected; unrecognized encryption structure skipped; ExternallyManaged cross-stack owned bucket with unresolved function env does not throw (Automatic-only guard not applied). Existing fixtures retained (owned-bucket policy statements + revision DependsOn on bucket policy, imported-bucket Automatic error, ExternallyManaged no-policy, unversioned, KMS_MANAGED, cross-stack Automatic error). These exercise the real L1 property structs (CfnBucket.VersioningConfigurationProperty / BucketEncryptionProperty) so validation runs against synthesized configuration.\n\nEvidence: dotnet build -c Release -\u003e Build succeeded, 0 Warning(s), 0 Error(s). Full suite per TFM (dotnet run --project test/LayeredCraft.Cdk.Constructs.Tests/ -c Release --no-build): net8.0/net9.0/net10.0/net11.0 each Total 450, Errors 0, Failed 0, Skipped 0 (was 437 before; +13). All 24 golden templates byte-identical (git reports no GoldenTemplates changes); no golden updates required. dotnet format --verify-no-changes reports no issues in the two changed files. Only two files modified. No commit or push performed (per task restrictions).\n\nUnresolved behavior (documented, not code): versioning enabled solely via an escape-hatch property override is not detected (limitation, T6a workaround); imported buckets remain uninspected.","spec_id":"docs/designs/lambda-web-functions-integration.md","status":"closed","priority":2,"issue_type":"task","assignee":"Nick Cipollina","owner":"ncipollina@gmail.com","created_at":"2026-10-23T12:49:20Z","created_by":"Nick Cipollina","updated_at":"2026-10-23T14:43:43Z","started_at":"2026-10-23T14:34:44Z","closed_at":"2026-10-23T14:43:43Z","close_reason":"Owned-bucket inspection hardened per design §14 rev4. Unresolved values (token/unrecognized versioning Status, encryption algorithm, KMS key id, encryption structure) are skipped and never rejected; literal violations still rejected (unversioned/Suspended, KMS_MANAGED aws/s3, DSSE_MANAGED); DSSE with a customer-managed key accepted; messages name the actual problem. ExternallyManaged still inspects owned buckets but emits no policy and keeps the Automatic-only cross-stack guard. 13 new regression tests; Release build 0 warnings; full suite 450/450 on net8.0-net11.0; all 24 goldens unchanged. Not committed (per task).","external_ref":"gh-98","labels":["core","lambda-web-functions","t2"],"dependencies":[{"issue_id":"cdkc-18e.16","depends_on_id":"cdkc-18e","type":"parent-child","created_at":"2026-10-23T12:49:20Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-18e.16","depends_on_id":"cdkc-18e.3","type":"blocks","created_at":"2026-10-23T12:49:20Z","created_by":"Nick Cipollina","metadata":"{}"}],"dependency_count":1,"dependent_count":1,"comment_count":0} {"_type":"issue","id":"cdkc-18e.12","title":"T7b: Create sandbox CDK app and deploy/smoke/destroy scripts (no deployment)","description":"Purpose: sandbox CDK app and smoke-test tooling that exercises the implemented constructs exactly as a consumer would. No deployment in this bead. Design §19.1 item 3 (all sub-items), §9, §12.\n\nDeliverables under samples/web-functions/sandbox/ (not in the library slnx/CI):\n- A CDK app (C#) referencing the library project, with explicit Env (account/region from context or env vars; never hard-coded production values):\n * ArtifactsStack: owned versioned SSE-S3 Bucket used with WebFunctionCodeBucketPolicy.Automatic (bucket stack deployed and artifacts uploaded BEFORE the app stack, because the\n object must exist before the revision is created and Automatic adds the statement to the bucket's own stack).\n * A pre-provisioned \"external\" bucket (created by the script or a separate stack with its own lambda.amazonaws.com read policy) imported via Bucket.FromBucketName and used with ExternallyManaged.\n * AppStack: Next.js Web Function (IamAuth) behind a Distribution via WebFunctionOrigin.WithOriginAccessControl (default uncached + ALL_VIEWER_EXCEPT_HOST_HEADER, /_next/static/* cached);\n ASP.NET Core Web Function (IamAuth) with a second endpoint (for the endpoint-specific denial test) and GrantInvoke to a dedicated \"caller\" IAM role assumable by the operator;\n Blazor Web Function (IamAuth) behind OAC (fingerprinted/static assets cached); context flags to (a) switch artifacts to the v2 build (revision update), (b) add/remove a second\n distribution on the Next.js endpoint (resource-policy lifecycle), (c) optionally add an ExternallyManaged cross-account grant for a second sandbox account.\n * Outputs needed by the smoke script (endpoint URLs/ARNs, distribution domains/ids, caller role ARN). Use the library's naming; prefix all names with a sandbox prefix.\n- smoke.sh (bash, AWS CLI v2 + curl with --aws-sigv4 \"aws:amz:\u003cregion\u003e:lambda\" and header x-amz-content-sha256: UNSIGNED-PAYLOAD) implementing every §19.1 3.x check with expected status codes,\n `aws lambda-web get-resource-policy` inspection, revision/endpoint state checks, and a machine-readable summary; deploy.sh (ordered: artifacts stack → upload zips → app stack) and destroy.sh\n (destroys stacks, empties/deletes buckets incl. all object versions, deletes log groups).\n- README.md: prerequisites, required IAM permissions, non-production account requirement, cost notes, step-by-step run, cleanup, and how to record evidence.\n\nValidation in this bead: `cdk synth` of the sandbox app succeeds locally without deploying (use dummy account/region context); scripts pass shellcheck if available. No AWS deployment.\nExclusions: running against AWS (next bead); changes to library production code (record blockers instead).\n","acceptance_criteria":"- Sandbox CDK app synthesizes using only the public library API and covers every §19.1 item 3 scenario via stacks/context flags.\n- deploy/smoke/destroy scripts and README exist; smoke script checks every §19.1 3.1–3.8 item with explicit expected results; cleanup removes all created resources.\n- No deployment performed; library validation gates still pass.","notes":"## T7b implementation + correction record (no AWS deployment performed)\n\n### Sandbox CDK app (samples/web-functions/sandbox/, 20 files, untracked)\nC# CDK app (net10.0) referencing the real LayeredCraft.Cdk.Constructs project and exercising only the public Web Function API (WebFunctionConstruct, AddEndpoint, WebFunctionOrigin OAC, GrantInvoke, GrantCloudFrontInvoke). Stacks: lccdk-wf-sandbox-{id}-artifacts (versioned SSE-S3 bucket, Automatic), -external (versioned bucket + scoped read policy + 2 imported-caller roles), -app (Next.js/ASP.NET Core/Blazor Web Functions, 4 endpoints, 3 resource policies, 2 CloudFront distributions + OACs, caller/denied/imported roles, 28 outputs). Scripts: common.sh, validate-env.sh, synth.sh, upload-artifacts.sh, deploy.sh, update-to-v2.sh, destroy.sh, smoke.sh, run-workflow.sh + README.md.\n\n### Corrections applied (independent review)\n- B1 repeat-deploy: deploy.sh always synthesizes the COMPLETE app (SANDBOX_COMPONENTS=all) so support-stack cross-stack exports survive; support stacks deployed first with guarded placeholder versions, then upload, then app stack with real versions.\n- B2 destroy: destroy.sh synthesizes with SANDBOX_ALLOW_PLACEHOLDER_VERSIONS=1 so teardown works without a manifest / after partial failure; destroys app-\u003eexternal-\u003eartifacts, verifies each stack is gone before removing the manifest.\n- H1 ownership: fixed namespace lccdk-wf-sandbox in stack names; stack tags lc-webfunction-sandbox-id / lc-webfunction-sandbox-owner on every stack; shell stack_ownership (absent|owned|foreign|error) + assert_stack_owned_or_absent (deploy) / require_stack_owned (destroy); fail-closed on foreign or ambiguous results; every aws call pinned to --region and ambient-region mismatch aborts; mutations require SANDBOX_ALLOW_AWS=1 AND SANDBOX_ACKNOWLEDGE_NON_PRODUCTION=1.\n- M1: stack_exists replaced by stack_ownership (distinguishes not-found from AccessDenied/throttling/expired creds).\n- M2: empty_bucket deletes only object versions + delete markers (never delete-bucket); --expected-bucket-owner on head/list/delete; CloudFormation deletes the buckets; only stack-owned buckets are emptied.\n- M3: artifacts prefix consistent (SandboxConfiguration default key now uses the configured SANDBOX_ARTIFACTS_PREFIX; manifest/upload/CDK agree).\n- M4: CDK CLI pinned to 2.1145.0 (common.sh CDK_CLI_VERSION); SANDBOX_CDK override documented.\n- M5: external bucket policy scoped per function (arn:aws:lambda:{region}:{account}:web-function/{wfsbx-aspnetcore|wfsbx-blazor}/revision/*), no broad web-function/*/revision/*.\n- M6: app stack declares explicit CDK dependencies on artifacts + external (AddStackDependency).\n- SM1-SM7: smoke.sh rewritten - errexit disabled during tests + always writes build/smoke-summary.json + non-zero exit on fail/blocked; live resource-policy validation (BLOCKED, never PASS, when lambda-web API unavailable) checking Principal/Action/Effect/Resource/aws:SourceArn; revision/endpoint state via lambda-web get-web-function; Next.js build-id parser strips the 'Build id: ' label; Blazor sample now exposes id=\"build-id\"; real warm-request and Blazor assertions; denial classification (signature vs access-denied) requiring the matching positive to pass; imported immutable/mutable roles verified to have NO caller-side identity policy; cross-account distinguishes not-configured/missing-setup/negative/positive; SigV4 creds passed via a 600-perm curl -K config (never argv); bounded retry with validated numeric input.\n- Phase 7 misc: missing-flag-value guards, explicit SANDBOX_SECOND_DISTRIBUTION=0 reset, manifest target (sandboxId/account/region/prefix) validated before reuse, README documents CDK bootstrap + AWS CLI + missing lambda-web subcommands + prefix + pinned CLI + non-prod ack.\n\n### Offline validation (no AWS mutations)\n- Offline lifecycle harness with stubbed aws/cdk: 61/61 checks across 16 scenarios (fresh prep, support provisioning, upload+manifest, app deploy, repeat deploy, v1-\u003ev2, second-distribution enable/disable, normal/partial/repeated destroy, account mismatch, foreign-stack refusal, credential/API failure, S3 cleanup failure, manifest missing/foreign, nondefault prefix). Proves destroy never calls s3api delete-bucket.\n- Real cdk synth (npx aws-cdk@2.1145.0): verified stack ownership tags on all three stacks, per-function scoped external bucket policy, app-\u003eartifacts/external dependencies, cloudfront SourceArn resource policies, ASP.NET Core 2 imported-role statements, 28 app outputs. Expected F3006 warnings for the new resource types.\n- bash -n clean on all scripts. shellcheck not installed locally.\n- Library tests: 2140 passed / 0 failed (net8/9/10/11); no golden-template regressions.\n- Generated outputs (cdk.out/bin/obj/build) remain gitignored; git add -n lists exactly the 20 intended files.\n- Read-only identity check used a disposable test account (id withheld); NO deploy/destroy/upload performed.\nSecond independent review (Claude) returned CHANGES REQUIRED. Deploy/update/destroy lifecycle, placeholder mechanism, stack ownership, cross-stack deps, and synthesized IAM policies are independently validated and must NOT be redesigned. Correcting: S1 smoke.sh $4 under set -u; S2 CURL_AUTH omitted on CallerRole/imported-role positives; S3 CloudFront ARN empty region; S4 fail-closed live resource-policy verification (parser crash/omission must FAIL/BLOCKED); S5 imported-role identity-policy checks (list-role-policies failure != no policy; inline+attached; IAM sim); S6 Next.js build-ID extraction (HTML comments); S7 per-function revision/update verification; L1 remove unsafe log-group deletion; L2 prevalidate manifest on --skip-upload before any mutation; L3 first-run workflow without manifest; L4 preserve shell command failures; L5 bound --attempts + cross-account negative authorization. No real AWS mutations; do not start T7c.\n## T7b second-round corrections (independent review) — complete\n\n### S1-S7 (smoke execution correctness)\n- S1: smoke.sh settle() and fetch_until() optional positional args now use ${4:-}; regression scenario 1 proves the first passing check no longer aborts the suite.\n- S2: every IAM-signed positive invocation passes ${CURL_AUTH[@]} (curl -K config file, 0600); credentials are never on the curl argv. Scenario 2 asserts the signed requests reached the endpoint.\n- S3: CloudFront ARNs now use the empty region component arn:aws:cloudfront::\u003caccount\u003e:distribution/\u003cid\u003e; scenario 3 validates the policy checks against that ARN.\n- S4 (fail-closed): policy_report catches parse/schema errors and emits FAIL; unreadable/missing live policies emit FAIL/BLOCKED; a completeness check requires all 3 policy-check records (fewer =\u003e FAIL). Validates Effect=Allow, principal, action lambda:InvokeWebFunctionEndpoint, endpoint Resource ARN, aws:SourceArn; detects duplicate statements and unexpected distribution grants. Scenarios 4-8 cover malformed JSON, parser exception, missing policy, duplicate, extra, and second-distribution-removed.\n- S5: role_invoke_state inspects inline AND attached policies; any lookup failure returns error =\u003e BLOCKED (never PASS); scenario 9 (IAM AccessDenied) asserts BLOCKED.\n- S6: Next.js and Blazor samples render a stable data-build-id attribute; smoke extracts it (immune to SSR HTML comments); scenario 10 rejects a wrong build id.\n- S7: per-function revision tracking (each function queried separately; BLOCKED when the API is unavailable); --revision-baseline compares per-function revision identities before/after an update; run-workflow.sh derives --expect-build-id from the local artifact zip build-id.txt; scenarios 11-12 cover distinct per-function revisions and the v1-\u003ev2 transition (advanced vs unchanged).\n\n### L1-L5\n- L1: destroy.sh no longer deletes log groups by predictable name; CloudFormation deletes the CFN-owned log groups with their stacks. Scenario 13 asserts no log-group deletion API call and no delete-bucket.\n- L2: deploy.sh validates the artifact manifest (existence, sandbox id, account, region, prefix, required keys+versions) BEFORE any support-stack mutation when --skip-upload; a mismatched manifest performs zero AWS mutations. Scenario 14.\n- L3: run-workflow.sh no longer synthesizes before deploy (deploy.sh synthesizes), so a fresh checkout works without an existing manifest; placeholder-version protection is unchanged. Scenario 15.\n- L4: common.sh export_artifact_env assigns then exports (no export VAR=$(cmd) masking of failures under errexit).\n- L5: --attempts is bounded 1..60; cross-account adds the negative half (cross-account role on the alt endpoint =\u003e denied) and never PASSes when unconfigured.\n\n### Files changed (all uncommitted)\nsamples/web-functions/sandbox/: smoke.sh, common.sh, deploy.sh, destroy.sh, run-workflow.sh, synth.sh, upload-artifacts.sh, validate-env.sh, README.md, SandboxConfiguration.cs, SandboxNaming.cs, ArtifactsStack.cs, ExternalStack.cs, AppStack.cs, Program.cs; NEW tests/run-scenarios.sh, tests/run-smoke-scenarios.sh, tests/stubs/{aws,cdk,curl}. Also apps/nextjs/app/page.js, apps/blazor/Components/Pages/Home.razor, apps/blazor/Program.cs (S6 data-build-id). Plus .beads/issues.jsonl.\n\n### Regression test results (stubbed AWS/CDK/curl; no real AWS)\n- tests/run-scenarios.sh: 61 passed / 0 failed (lifecycle: stacks-only, upload, deploy, repeat, v1-\u003ev2, second-dist enable/disable, destroy, partial/repeated destroy, account mismatch, foreign stack, credential/API fail, S3 cleanup fail, manifest missing/mismatch, nondefault prefix).\n- tests/run-smoke-scenarios.sh: 38 passed / 0 failed (S1-S7/L1-L5 smoke correctness, fail-closed policy verification, per-function revisions, v1-\u003ev2, L1/L2/L3).\n\n### Other validation\n- bash -n OK for all 11 sandbox+test scripts; shellcheck not installed (noted).\n- Library tests: 2140 passed / 0 failed (net8.0/9.0/10.0/11.0); no golden-template changes.\n- Offline cdk synth OK (stacks lccdk-wf-sandbox-wfsbx-{artifacts,external,app}); H1 ownership tags on all stacks, M5 external bucket policy scoped per function revision ARN, M6 app-\u003esupport dependencies, resource policies 1/2/1 statements.\n\n### Remaining AWS-only uncertainties (deferred to T7c)\nReal deploy/smoke/destroy not performed. lambda-web CLI subcommands are unavailable in the local CLI, so live revision/policy checks report BLOCKED there. Cross-account requires a second sandbox account. IAM identity-policy propagation timing is only observable against real AWS.","spec_id":"docs/designs/lambda-web-functions-integration.md","status":"closed","priority":2,"issue_type":"task","owner":"ncipollina@gmail.com","created_at":"2026-10-23T01:14:57Z","created_by":"Nick Cipollina","updated_at":"2026-10-24T21:05:54Z","started_at":"2026-10-24T01:31:48Z","closed_at":"2026-10-24T21:05:54Z","close_reason":"T7b second-round corrections complete: S1-S7 and L1-L5 resolved; added stub-driven regression harness (tests/run-scenarios.sh 61/61, tests/run-smoke-scenarios.sh 38/38); bash -n clean; library tests 2140/0; offline synth verified (H1/M5/M6). No AWS mutations; T7c still pending.","external_ref":"gh-98","labels":["lambda-web-functions","samples","sandbox","t7"],"dependencies":[{"issue_id":"cdkc-18e.12","depends_on_id":"cdkc-18e","type":"parent-child","created_at":"2026-10-23T01:14:57Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-18e.12","depends_on_id":"cdkc-18e.11","type":"blocks","created_at":"2026-10-23T01:15:19Z","created_by":"Nick Cipollina","metadata":"{}"},{"issue_id":"cdkc-18e.12","depends_on_id":"cdkc-18e.6","type":"blocks","created_at":"2026-10-23T01:15:18Z","created_by":"Nick Cipollina","metadata":"{}"}],"dependency_count":2,"dependent_count":1,"comment_count":0} diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 1966370..81fe20f 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -15,14 +15,14 @@ jobs: steps: - name: Dependabot metadata id: metadata - uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3 + uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0 with: github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Generate app token id: app-token if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor' - uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0 with: app-id: ${{ secrets.DEPENDABOT_AUTOMERGE_APP_ID }} private-key: ${{ secrets.DEPENDABOT_AUTOMERGE_PRIVATE_KEY }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7c2c57a..1c638a7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,12 +37,12 @@ jobs: fetch-depth: 0 - name: Setup Python - uses: actions/setup-python@v7.0.0 + uses: actions/setup-python@v7.1.0 with: python-version-file: pyproject.toml - name: Install uv - uses: astral-sh/setup-uv@v10.2.0 + uses: astral-sh/setup-uv@v10.4.0 with: enable-cache: true diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml index f029f08..6aefb79 100644 --- a/.github/workflows/pr-build.yaml +++ b/.github/workflows/pr-build.yaml @@ -4,10 +4,11 @@ on: pull_request: branches: - main -permissions: write-all +permissions: + contents: read jobs: build: - uses: LayeredCraft/devops-templates/.github/workflows/pr-build.yaml@v10.8 + uses: LayeredCraft/devops-templates/.github/workflows/pr-build.yaml@v11.2 with: solution: LayeredCraft.Cdk.Constructs.slnx hasTests: true @@ -15,9 +16,6 @@ jobs: enableCodeCoverage: true coverageThreshold: 80 dotnetVersion: | - 8.0.x - 9.0.x 10.0.x 11.0.x - runCdk: false - secrets: inherit \ No newline at end of file + globalJsonFile: global.json diff --git a/.github/workflows/pr-title-check.yaml b/.github/workflows/pr-title-check.yaml index 62d2d2b..8d99fd5 100644 --- a/.github/workflows/pr-title-check.yaml +++ b/.github/workflows/pr-title-check.yaml @@ -10,4 +10,4 @@ permissions: jobs: validate: - uses: LayeredCraft/devops-templates/.github/workflows/pr-title-check.yml@v10.8 \ No newline at end of file + uses: LayeredCraft/devops-templates/.github/workflows/pr-title-check.yml@v11.2 \ No newline at end of file diff --git a/.github/workflows/publish-preview.yaml b/.github/workflows/publish-preview.yaml index c82bb2a..a4803f1 100644 --- a/.github/workflows/publish-preview.yaml +++ b/.github/workflows/publish-preview.yaml @@ -17,16 +17,14 @@ permissions: pull-requests: write jobs: - # To add support for additional .NET versions (e.g. net9, net11), add release branches - # (e.g. release/net9) and wire up separate caller workflows targeting those branches. + # To add support for additional .NET versions (e.g. net11), add release branches + # (e.g. release/net11) and wire up separate caller workflows targeting those branches. build: - uses: LayeredCraft/devops-templates/.github/workflows/publish-preview.yml@v10.8 + uses: LayeredCraft/devops-templates/.github/workflows/publish-preview.yml@v11.2 with: solution: LayeredCraft.Cdk.Constructs.slnx dotnetVersion: | - 8.0.x - 9.0.x 10.0.x 11.0.x hasTests: true @@ -39,6 +37,6 @@ jobs: id-token: write contents: read steps: - - uses: LayeredCraft/devops-templates/.github/actions/nuget-push@v10.8 + - uses: LayeredCraft/devops-templates/.github/actions/nuget-push@v11.2 with: nuget_user: ${{ secrets.NUGET_USER }} diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml index 0e54358..f09902f 100644 --- a/.github/workflows/publish-release.yaml +++ b/.github/workflows/publish-release.yaml @@ -8,16 +8,14 @@ permissions: contents: write jobs: - # To add support for additional .NET versions (e.g. net9, net11), add release branches - # (e.g. release/net9) and wire up separate caller workflows targeting those branches. + # To add support for additional .NET versions (e.g. net11), add release branches + # (e.g. release/net11) and wire up separate caller workflows targeting those branches. build: - uses: LayeredCraft/devops-templates/.github/workflows/publish-release.yml@v10.8 + uses: LayeredCraft/devops-templates/.github/workflows/publish-release.yml@v11.2 with: solution: LayeredCraft.Cdk.Constructs.slnx dotnetVersion: | - 8.0.x - 9.0.x 10.0.x 11.0.x hasTests: true @@ -30,6 +28,6 @@ jobs: id-token: write contents: read steps: - - uses: LayeredCraft/devops-templates/.github/actions/nuget-push@v10.8 + - uses: LayeredCraft/devops-templates/.github/actions/nuget-push@v11.2 with: nuget_user: ${{ secrets.NUGET_USER }} diff --git a/.github/workflows/release-drafter.yaml b/.github/workflows/release-drafter.yaml index 2562b73..5b5b437 100644 --- a/.github/workflows/release-drafter.yaml +++ b/.github/workflows/release-drafter.yaml @@ -14,7 +14,7 @@ permissions: jobs: draft: - uses: LayeredCraft/devops-templates/.github/workflows/release-drafter.yml@v10.8 + uses: LayeredCraft/devops-templates/.github/workflows/release-drafter.yml@v11.2 with: event_name: ${{ github.event_name }} pr_draft: ${{ github.event.pull_request.draft == true }} \ No newline at end of file diff --git a/CLAUDE.md b/CLAUDE.md index ab142a5..5352a9f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -18,7 +18,7 @@ This is a .NET library that provides reusable AWS CDK constructs for serverless dotnet build # Run all tests (preferred method for xUnit v3) -dotnet run --project test/LayeredCraft.Cdk.Constructs.Tests/ --framework net8.0 +dotnet run --project test/LayeredCraft.Cdk.Constructs.Tests/ --framework net10.0 # Run tests for a specific project dotnet test test/LayeredCraft.Cdk.Constructs.Tests/ @@ -58,7 +58,7 @@ dotnet add test/LayeredCraft.Cdk.Constructs.Tests/ package PackageName - `WebFunctionEndpointConstruct` (`IWebFunctionEndpoint`) represents each endpoint; `AddEndpoint` adds more; `GrantInvoke` (identity- or resource-policy based) and `GrantCloudFrontInvoke` are endpoint-scoped - `WebFunctionOrigin` returns a CloudFront `IOrigin` that configures origin access control (OAC) and the required resource-policy statement for `IamAuth` endpoints - Workload-neutral: Next.js, ASP.NET Core, and Blazor Static SSR deploy through the same public API; the differences live in the artifacts and configuration only -- Requires `Amazon.CDK.Lib` 2.274.0+ (Lambda Web Functions have L1-only support in CDK) +- Requires `Amazon.CDK.Lib` 2.278.0+; built directly on the CloudFormation L1 resources (`CfnWebFunction`, `CfnWebFunctionRevision`, `CfnWebFunctionEndpoint`, `CfnResourcePolicy`). `Amazon.CDK.Lib` 2.278.0 also ships its own L2 Web Function constructs in `Amazon.CDK.AWS.Lambda`; how this construct relates to them is being evaluated in the 3.0.0 design **StaticSiteConstruct** (`src/LayeredCraft.Cdk.Constructs/StaticSiteConstruct.cs`) - Comprehensive CDK construct for static website hosting @@ -98,8 +98,9 @@ dotnet add test/LayeredCraft.Cdk.Constructs.Tests/ package PackageName 5. **Versioning Strategy**: Creates new versions on every deployment with "live" alias ### Target Frameworks -- .NET 8.0 and .NET 9.0 -- Uses AWS CDK v2 (Amazon.CDK.Lib 2.274.0 minimum; the Web Function constructs require the 2.274.0 enum values) +- .NET 10 and .NET 11 +- Uses AWS CDK v2 (Amazon.CDK.Lib 2.278.0 minimum; the Web Function constructs require the OAC signing enum values) +- SDK pinned by `global.json` (11.0.100, `rollForward: latestFeature`) ### OpenTelemetry Configuration (v2.0.0+) Starting with version 2.0.0, the OpenTelemetry layer configuration has been updated: @@ -123,28 +124,30 @@ var props = new LambdaFunctionConstructProps ## Testing Framework ### Test Structure -- Uses xUnit v3 with AutoFixture for data generation +- xUnit v3 on Microsoft.Testing.Platform (`xunit.v3.mtp-v2`; `global.json` selects the MTP runner). There is no VSTest adapter (`Microsoft.NET.Test.Sdk` and `xunit.runner.visualstudio` were removed in 3.0.0). +- Compono (`Compono`, `Compono.XunitV3`) for test composition; no AutoFixture and no NSubstitute - AwesomeAssertions for fluent assertions -- NSubstitute for mocking (though not heavily used in current tests) - AWS CDK Template assertions for infrastructure testing ### Test Architecture -**Custom Attributes**: -- `LambdaFunctionConstructAutoDataAttribute`: AutoFixture attribute with customizable parameters -- `WebFunctionConstructAutoDataAttribute`: AutoFixture attribute supplying deterministic Web Function props (imported, externally managed artifact bucket) -- `BaseFixtureFactory`: Factory for creating configured AutoFixture instances +**Composition profiles** (`TestKit/Profiles/`), one `ICompositionProfile` per construct's props, used with `[Compose]` or `[Compose]`: +- `LambdaFunctionConstructPropsProfile` + `LambdaFunctionConstructPropsConfig(LambdaFunctionConstructPropsOptions)` (`[Flags]`: `OtelLayer`, `Permissions`, `FunctionUrl`) +- `StaticSiteConstructPropsProfile` + `StaticSiteConstructPropsConfig(StaticSiteConstructPropsOptions)` (`ApiDomain`, `AlternateDomains`) +- `CognitoUserPoolConstructPropsProfile` + its config (branding on/off) +- `DynamoDbTableConstructPropsProfile`, `WebFunctionConstructPropsProfile` (no per-test configuration) -**Test Customizations**: -- `LambdaFunctionConstructCustomization`: Configures realistic test data for Lambda constructs -- `WebFunctionConstructCustomization`: Configures realistic test data for Web Function constructs -- `StaticSiteConstructCustomization`: Configures realistic test data for static site constructs -- Supports parameterized test scenarios for Lambda (OTEL layer on/off, permissions included/excluded) and static sites (API domain on/off, alternate domains included/excluded) +Example: +```csharp +[Theory] +[Compose(LambdaFunctionConstructPropsOptions.Permissions)] +public void Construct_ShouldCreateLambdaFunction(LambdaFunctionConstructProps props) { ... } +``` ### Test Data Strategy -- Uses AutoFixture with custom configurations for realistic AWS resource names +- Behavior-defining values (resource names, domains, asset paths) are visible literals in the profiles. Incidental values (for example Lambda memory and timeout, Web Function log levels) are generated deterministically from the composition context, within valid AWS ranges. +- The props members are optional (non-`required`), which Compono's generated plans do not populate, so each profile registers a factory; the reason is documented in each profile. +- Load the Compono consumer skill before changing these tests; never reintroduce AutoFixture or reflection-based workarounds. - Test assets include `test-lambda.zip` for Lambda deployment packages and `static-site/` folder for static site assets -- Tests verify both resource creation and property configuration -- Supports parameterized scenarios for both Lambda (OTEL layer on/off, permissions included/excluded) and static sites (API domain on/off, alternate domains included/excluded) ### Testing Helpers (`src/LayeredCraft.Cdk.Constructs/Testing/`) The library includes comprehensive testing helpers for consumers: @@ -214,7 +217,7 @@ The library includes comprehensive testing helpers for consumers: ## Development Practices ### Code Style -- C# 12+ features enabled (records, required properties, collection expressions) +- `LangVersion` default: the C# version the SDK selects for each target framework (records, required properties, collection expressions) - Nullable reference types enabled - Implicit usings enabled - Uses `required` properties for mandatory configuration diff --git a/Directory.Build.props b/Directory.Build.props index ac5eda0..2c68843 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 2.4.0 + 3.0.0 MIT diff --git a/Directory.Packages.props b/Directory.Packages.props index bf4fe73..da1dd31 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,20 +3,16 @@ true - + - + - - - + + - - - - + \ No newline at end of file diff --git a/README.md b/README.md index 8bb6606..077414c 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,7 @@ public class MyStack : Stack } ``` -> **Compatibility:** Lambda Web Functions require **`Amazon.CDK.Lib` 2.274.0 or later** and a Region where the feature is available. `IamAuth` endpoints are invoked by signed (SigV4) callers; `ApplicationManaged` endpoints are publicly reachable, including behind CloudFront. +> **Compatibility:** Lambda Web Functions require **`Amazon.CDK.Lib` 2.278.0 or later** and a Region where the feature is available. `IamAuth` endpoints are invoked by signed (SigV4) callers; `ApplicationManaged` endpoints are publicly reachable, including behind CloudFront. `Amazon.CDK.Lib` 2.278.0 declares types with the same names as this library's `IWebFunctionEndpoint` (namespace `LayeredCraft.Cdk.Constructs`) and its `WebFunctionCode`, `WebFunctionRuntime`, `WebFunctionAuthType`, `WebFunctionEndpointType`, `WebFunctionEndpointOptions`, `IWebFunctionEndpointOptions` and `WebFunctionEndpointAttributes`; a file that imports `Amazon.CDK.AWS.Lambda` together with `LayeredCraft.Cdk.Constructs` or `LayeredCraft.Cdk.Constructs.Models` must disambiguate, for example `using WebFunctionCode = LayeredCraft.Cdk.Constructs.Models.WebFunctionCode;`. ## Documentation @@ -139,8 +139,8 @@ public class MyStack : Stack ## Requirements -- **.NET 8.0** or **.NET 9.0** -- **AWS CDK v2** (Amazon.CDK.Lib 2.274.0+) +- **.NET 10** or **.NET 11** +- **AWS CDK v2** (Amazon.CDK.Lib 2.278.0+) - **AWS CLI** configured with appropriate permissions - **Node.js** (for CDK deployment) @@ -162,9 +162,11 @@ dotnet restore dotnet build # Run tests -dotnet run --project test/LayeredCraft.Cdk.Constructs.Tests/ --framework net8.0 +dotnet run --project test/LayeredCraft.Cdk.Constructs.Tests/ --framework net10.0 ``` +The repository pins the .NET SDK to `11.0.100` (with `rollForward: latestFeature`) in `global.json`. + ### Code Style - Follow C# coding conventions diff --git a/docs/constructs/web-function.md b/docs/constructs/web-function.md index 287ae33..212fec3 100644 --- a/docs/constructs/web-function.md +++ b/docs/constructs/web-function.md @@ -6,8 +6,10 @@ It is intentionally workload-neutral: Next.js, ASP.NET Core, and Blazor Static S !!! info "Lambda Web Functions are a new AWS feature" CloudFormation exposes them as `AWS::Lambda::WebFunction`, `WebFunctionRevision`, `WebFunctionEndpoint`, and - `AWS::Lambda::ResourcePolicy`. AWS CDK 2.274.0 has only L1 support; this construct wraps the L1s with secure - wiring, synthesis-time validation of invalid combinations, and CDK-idiomatic grants. + `AWS::Lambda::ResourcePolicy`. This construct is built directly on those CloudFormation L1 resources, wrapping + them with secure wiring, synthesis-time validation of invalid combinations, and CDK-idiomatic grants. + `Amazon.CDK.Lib` 2.278.0 also ships its own L2 Web Function constructs in `Amazon.CDK.AWS.Lambda`; how this + construct relates to them is being evaluated in the 3.0.0 design. ## :rocket: Features @@ -35,7 +37,8 @@ It is intentionally workload-neutral: Next.js, ASP.NET Core, and Blazor Static S ## Prerequisites -- **AWS CDK for .NET 2.274.0 or later** (`Amazon.CDK.Lib`). This release adds the enum values the construct needs for OAC signing. +- **AWS CDK for .NET 2.278.0 or later** (`Amazon.CDK.Lib`). This release provides the enum values the construct needs for OAC signing. +- **Name disambiguation.** `Amazon.CDK.Lib` 2.278.0 declares types with the same names as this library's `IWebFunctionEndpoint` (namespace `LayeredCraft.Cdk.Constructs`) and its `WebFunctionCode`, `WebFunctionRuntime`, `WebFunctionAuthType`, `WebFunctionEndpointType`, `WebFunctionEndpointOptions`, `IWebFunctionEndpointOptions` and `WebFunctionEndpointAttributes`. A file that imports `Amazon.CDK.AWS.Lambda` together with `LayeredCraft.Cdk.Constructs` or `LayeredCraft.Cdk.Constructs.Models` must disambiguate, for example `using WebFunctionCode = LayeredCraft.Cdk.Constructs.Models.WebFunctionCode;`. - A region where Lambda Web Functions are available. - A **versioned** S3 bucket that holds the application zip, and an artifact uploaded before you deploy. - `aws-cdk` bootstrapped in the account/region if you use CDK assets elsewhere in the same app. diff --git a/docs/designs/v3-modernization.md b/docs/designs/v3-modernization.md new file mode 100644 index 0000000..23767a5 --- /dev/null +++ b/docs/designs/v3-modernization.md @@ -0,0 +1,294 @@ +# Design: LayeredCraft.Cdk.Constructs 3.0.0 + +| | | +|---|---| +| **Status** | **Proposed** (revision 1, 2026-11-24), awaiting owner review. Approval of this document is an acceptance criterion of [#109](https://github.com/LayeredCraft/cdk-constructs/issues/109); it does not authorize [#110](https://github.com/LayeredCraft/cdk-constructs/issues/110), [#111](https://github.com/LayeredCraft/cdk-constructs/issues/111) or [#112](https://github.com/LayeredCraft/cdk-constructs/issues/112). | +| **Milestone** | [v3.0.0](https://github.com/LayeredCraft/cdk-constructs/milestone/1), epic [#108](https://github.com/LayeredCraft/cdk-constructs/issues/108) | +| **Authority** | This document is the design record for 3.0.0. No standalone ADRs are written. | +| **Target frameworks** | `net10.0`, `net11.0` | +| **AWS CDK floor** | `Amazon.CDK.Lib` 2.278.0 | + +> This page is a design record, not user documentation. It is not in the MkDocs `nav`. + +--- + +## 1. Summary + +3.0.0 is a major release with two kinds of breaking change, which the release notes and the migration +guide keep separate: + +- **Intentional:** .NET 8 and .NET 9 are dropped ([§3](#3-framework-sdk-and-dependency-policy)); the + `LambdaFunctionConstruct` defaults change to alias-only invocation permissions and a logging policy + scoped to its own log group ([§7](#7-lambdafunctionconstruct-u1u4-u7-110)). +- **Upgrade-induced:** the `Amazon.CDK.Lib` 2.278.0 floor, and the type-name collisions it introduces + with this library's Web Function models ([§4](#4-upgrade-induced-changes-amazoncdklib-22780)). + +Everything else is additive: an alias name option, public alias and version, S3 artifact code, and a +new private static-assets construct. The order is fixed by the epic: #109 (this modernization, no +construct output change) → #110 and #111 in parallel → #112 (downstream validation) → the owner's +stable release. + +**Dogfooding is a requirement** (owner, 2026-11-24): LayeredCraft consumers (Jedi Duel first) must be +able to use these constructs instead of raw CDK. Gaps are closed here, not worked around downstream, +and APIs are not compromised to avoid a breaking change. + +## 2. Scope of each issue + +| Issue | Delivers | Construct output change | +|---|---|---| +| #109 | This document; net10/net11; SDK pin; every dependency current; Compono tests; devops-templates v11.2 | **None** — golden templates byte-identical | +| #110 | U1 alias name, U2 permission targets (alias-only default), U3 public alias/version, U4 scoped log policy, U7 S3 artifact code | U2 default and U4 policy only | +| #111 | U6 private static-assets construct | New templates only | +| #112 | Downstream validation against one `3.0.0-preview.N`; migration guide; changelog | — | + +## 3. Framework, SDK and dependency policy + +- **Target frameworks:** `net10.0;net11.0` for the library and the tests. .NET 8 and .NET 9 are + removed. This is an intentional break: a consumer still on .NET 8 or 9 stays on 2.x. +- **SDK:** `global.json` pins `11.0.100` with `rollForward: latestFeature` and + `allowPrerelease: false`; `test.runner` stays `Microsoft.Testing.Platform`. The pin governs building + this repository, not consumers. +- **Dependencies:** the latest compatible stable release of each, as of 2026-11-24: + + | Package | 2.6.0 | 3.0.0 | + |---|---|---| + | `Amazon.CDK.Lib` | 2.274.0 | **2.278.0** (consumer floor) | + | `Microsoft.SourceLink.GitHub` | 10.0.402 | 11.0.100 | + | `xunit.v3.mtp-v2` | 3.2.2 | 4.0.3 | + | `Microsoft.NET.Test.Sdk` | 18.11.0 | 18.12.0 (removal decided in #109, [§6](#6-test-stack)) | + | `xunit.runner.visualstudio` | 3.1.5 | 4.0.1 (removal decided in #109) | + | `Microsoft.Testing.Extensions.CodeCoverage` | 18.12.0 | 18.12.0 (current) | + | `AwesomeAssertions` | 9.6.0 | 9.6.0 (current) | + | `AutoFixture`, `AutoFixture.AutoNSubstitute`, `AutoFixture.Xunit3`, `NSubstitute` | present | **removed** | + | `Compono`, `Compono.XunitV3` | — | 1.4.0 | + +- **No prerelease dependencies.** Any exception needs a written justification and owner approval. +- **Every `Amazon.CDK.Lib` bump** runs the focused real-CDK Web Function security tests + (`CdkUpgradeGuard_*`) and the golden templates before it is accepted (existing rule, `CLAUDE.md`). +- **Workflows:** LayeredCraft devops-templates **v11.2** for pr-build, publish-preview, + publish-release, release-drafter and pr-title-check. The v11 PR build is credential-free + (`contents: read`, no secrets, `runCdk` removed). .NET 10.0.x and 11.0.x are installed. Action pins + in `docs.yml` and `dependabot-auto-merge.yml` move to their latest stable releases; the latter keeps + SHA pinning and its `pull_request_target` actor and repository guard. This supersedes Dependabot + #101. +- **`VersionPrefix`** in `Directory.Build.props` (stale at 2.4.0) becomes `3.0.0`. It only affects + local builds: CI passes `/p:Version` explicitly ([§5](#5-preview-and-versioning-strategy)). + +## 4. Upgrade-induced changes (`Amazon.CDK.Lib` 2.278.0) + +### 4.1 Type-name collisions + +2.278.0 adds AWS's own L2 Web Function constructs to `Amazon.CDK.AWS.Lambda`. Eight of their type names +match this library's: `IWebFunctionEndpoint` (namespace `LayeredCraft.Cdk.Constructs`) and +`WebFunctionCode`, `WebFunctionRuntime`, `WebFunctionAuthType`, `WebFunctionEndpointType`, +`WebFunctionEndpointOptions`, `IWebFunctionEndpointOptions` and `WebFunctionEndpointAttributes` +(namespace `LayeredCraft.Cdk.Constructs.Models`). + +- **Inside the library (#109):** file-local `using` aliases keep our types unambiguous. The public API + and the CloudFormation output are unchanged. +- **For consumers:** a file that imports both `Amazon.CDK.AWS.Lambda` and our namespaces gets + `CS0104` (ambiguous reference) and must add the same aliases. This is source-breaking only; no + binary or template change. It is documented in the README, the Web Function page and the migration + guide. +- **Not done in #109:** renaming our types. Whether to rename, or to adopt AWS's types, belongs to the + Web Function decision in [§9](#9-decision-record-webfunctionconstruct-and-the-aws-cdk-l2). + +### 4.2 Stricter jsii struct validation + +The 2.278.0 jsii runtime validates required struct members when a struct crosses into JavaScript. Two +existing calls passed a wider struct than the parameter declares, and now throw: + +- `LambdaFunctionConstruct`: `Alias.AddFunctionUrl(new FunctionUrlProps { … })` → `FunctionUrlOptions` + (`FunctionUrlProps` requires `function`). +- `StaticSiteConstruct`: `Distribution.AddBehavior(…, new BehaviorOptions { … })` → + `AddBehaviorOptions` (`BehaviorOptions` requires `origin`). + +#109 fixes both. The golden templates prove the output is unchanged. + +## 5. Preview and versioning strategy + +- **Release Drafter is the version source**, as in AlexaVoxCraft (owner, 2026-11-24). On every push to + `main` except docs-only changes, `publish-preview.yml` (devops-templates v11.2) runs Release Drafter + in dry-run mode, takes `resolved_version`, strips any prerelease suffix and publishes + `-preview.`. `publish-release.yml` publishes the exact tag of a GitHub release. +- **The #109 PR carries the `breaking-change` label** (its title uses `!`, which the autolabeler maps to + that label). The latest published release is v2.6.0, so after the merge Release Drafter resolves + `3.0.0` (the `major` resolver), and every following preview is `3.0.0-preview.N` until the stable + release. No interleaved `2.6.x` or `2.7.0` previews. +- **Verification before merge (#109):** confirm the PR has the `breaking-change` label, that no merged + PR since v2.6.0 would resolve higher, and that the stale draft v2.6.1 does not override resolution. + Release Drafter resolves from the last *published* release and the merged PRs' labels, not from the + draft's name. The first preview's version is checked in the publish run after the owner merges. +- **Stable 3.0.0** is published only by the owner, after #112. + +## 6. Test stack + +- Compono and Compono.XunitV3 replace AutoFixture, AutoFixture.AutoNSubstitute, AutoFixture.Xunit3 and + NSubstitute. The `*AutoDataAttribute` classes and `BaseFixtureFactory` become small, + concern-named composition profiles used through `[Compose]` / + `[Compose]`; multi-row theories use one `[ComposeData…]`. Compono.TestDoubles is + added only if a test needs a double. +- Every behavior assertion is kept; the test count per TFM is unchanged unless a difference is + explained test-by-test. +- `Microsoft.NET.Test.Sdk` and `xunit.runner.visualstudio` are removed only if MTP-only execution is + proven in CI (`dotnet test` with the MTP runner) and the IDE. If either cannot be proven, they stay, + and the reason is recorded in #109. +- The public consumer helpers under `src/LayeredCraft.Cdk.Constructs/Testing/` are library API and + are not part of the test-stack migration. + +## 7. `LambdaFunctionConstruct`: U1–U4, U7 (#110) + +API sketches. Final names are settled in #110 review. Every behavior is driven test-first. + +| Item | Change | Default | Template impact | +|---|---|---|---| +| **U1** alias name | `string AliasName` on the props | `"live"` (unchanged) | None at the default. The alias's construct id (`{id}-alias`) does not depend on the name, so its logical ID is stable | +| **U2** permission targets | `LambdaPermissionTargets` flags (`Alias`, `Version`, `Function`), applied to each `LambdaPermission` | **`Alias` only** (owner decision) | **Intentional break:** at the default, the `AWS::Lambda::Permission` resources on the function and on the version disappear. Opting into `Alias \| Version \| Function` restores 2.x output exactly | +| **U3** public alias/version | Public `Alias` (`IAlias`) and `Version` (`IVersion`) properties | — | None | +| **U4** scoped log policy | The execution role may only `logs:CreateLogStream` and `logs:PutLogEvents` on the construct's own log group ARN (`logGroup.LogGroupArn`); `logs:CreateLogGroup`, `logs:TagResource` and the `{name}*` wildcard are removed (the construct creates the log group itself) | — | **Intentional change:** policy document only | +| **U7** S3 artifact code | Optional `Code` (`Amazon.CDK.AWS.Lambda.Code`, e.g. `Code.FromBucketV2(bucket, key, …)`) as an alternative to `AssetPath`; exactly one of the two must be set (validated at synthesis) | `AssetPath` (unchanged) | None for `AssetPath`. `Code.FromBucket` gives the deployer no write access and grants the function no bucket access | + +The testing helpers (`LambdaFunctionConstructAssertions`, `LambdaFunctionConstructPropsBuilder`), +the docs and the golden templates are updated in #110. Golden-template diffs are limited to U2 and U4 +and are listed in the migration guide with before/after examples. + +**Open question for #110 (not a 3.0.0 commitment):** whether the construct should expose the Lambda +logging configuration (`LoggingFormat`, application and system log levels). Today it leaves the +service default (`Text`). Jedi Duel's logging investigation found that its reference implementations +(legacy Jedi Duel and trivia-platform) run with that default, so no consumer currently needs the option. +It is listed so the decision is explicit, not to add scope. + +## 8. Private static-assets construct: U6 (#111) + +A new construct (working name `PrivateStaticAssetsConstruct`) for immutable, versioned web assets +behind CloudFront. `StaticSiteConstruct` is unchanged: it has a public website bucket with Block Public +Access off, requires Route53 and ACM, adds SPA rewrites and prunes everything. + +- **Bucket:** Block Public Access fully on, SSE-S3, SSL-only, versioned, no website endpoint. The + removal policy is configurable and retains by default. +- **CloudFront:** `S3BucketOrigin.WithOriginAccessControl`. The bucket policy is scoped to this + distribution's `SourceArn`. HTTPS-only by default (redirect optional); `CACHING_OPTIMIZED` by + default (configurable). +- **Optional DNS:** domain names plus a certificate (or a hosted-zone lookup) and alias records. Off by + default; the CloudFront domain is used. +- **Optional SPA routing and error rewrites:** off by default. +- **Deployment:** `BucketDeployment` with a destination key prefix, `Prune` (default `false`), + `RetainOnDelete` (default `true`), cache-control and optional invalidation paths. +- **Public properties:** `Bucket`, `Distribution`, `DomainName`. Testing helpers, golden templates + (default and custom-domain variants) and docs. + +It must express Jedi Duel's deployed development asset stack (private bucket, OAC, HTTPS-only, +`game//` prefix, no prune, retain, immutable cache-control) without raw CDK. #112 checks this. + +## 9. Decision record: `WebFunctionConstruct` and the AWS CDK L2 + +**Owner request (2026-11-24):** evaluate whether to retain the custom L1 implementation (A), replace it +with AWS's L2 (B), or refactor it to compose the official L2 while keeping the LayeredCraft-specific +functionality (C). The owner prefers C, provided it supports current behavior without unacceptable +CloudFormation migration risk. **No refactor happens in #109;** any work needs separate approval. + +### 9.1 Evidence + +- AWS CDK 2.278.0 source (`packages/aws-cdk-lib/aws-lambda/lib/webfunction*.ts`) and the `aws-lambda` + README "WebFunction" section, read at tag `v2.278.0`. +- A throwaway synthesis spike (not committed): the L2 `WebFunction` configured like our + `web-function-default` golden case (same stack, construct id `web-function`, function name, imported + bucket `golden-artifacts`, key `app.zip`, Node.js 24, IAM-auth default endpoint), compared resource by + resource with `GoldenTemplates/web-function-default.json`. + +### 9.2 Comparison + +| Area | LayeredCraft `WebFunctionConstruct` (2.6.0) | AWS CDK 2.278.0 L2 `WebFunction` | +|---|---|---| +| **Resources and logical IDs** (default case, same construct id) | `…Function46F1F768`, `…Revision…B2BF6DC1`, `…ExecutionRole7793F0D5`, `…LogGroup5C9D8E36`, `…LocalLogGroup42143EB1`, `…DefaultEndpoint8A7C111C` | `…Function46F1F768`, `…RevisionB2BF6DC1`, `…ServiceRole0296A7AB`, `…LogGroup5C9D8E36`, `…EndpointED416B7D` | +| **Endpoint** | Name `default`; `FunctionName` is the literal name; `AddEndpoint`; `MaxEnvironments`, `RateLimit`; home-Region and multi-Region types | Name `prod`; `FunctionName` is `Fn::GetAtt FunctionArn`; `addEndpoint`; `rateLimit`; `multiRegion`/`perRegion` locations; network-connector constraint | +| **Revision** | `FunctionName` literal; role and log group wired | `FunctionName` is `Ref`; otherwise identical properties in the spike | +| **Code** | `WebFunctionCode.FromBucket(bucket, key, options)`, bucket policy `Automatic` or `ExternallyManaged` | `fromBucket` (adds a policy for in-app buckets, scoped to this function's revisions), plus `fromAssetToManagedBucket` and `fromAssetToProvidedBucket` (custom-resource copy into a versioned bucket) | +| **Execution role** | Optional; `AWSLambdaBasicExecutionRole` plus statements scoped to the managed log groups | Optional; `AWSLambdaBasicExecutionRole` | +| **Logging** | `WebFunctionLogs.Create` (named `/aws/lambda/web/`, 14 days, plus the home-Region `.local` companion, 3 days), `Use`, `ServiceDefault` | One `logGroup`; default is an unnamed group, 731-day retention, **Retain**; no `.local` companion; application/system log levels | +| **Resource policy** | Single `AWS::Lambda::ResourcePolicy` per function | Single `AWS::Lambda::ResourcePolicy` per function (same rule) | +| **Grants** | `GrantInvoke` (identity or resource policy; fails synthesis when an account cannot be established unless `CallerPolicy = ExternallyManaged`), `GrantCloudFrontInvoke`; `CdkUpgradeGuard_*` tests | `endpoint.grants.invoke(grantee)` (same account → identity policy, otherwise resource policy) | +| **CloudFront** | `WebFunctionOrigin` (`IOrigin`, OAC `lambda`/`always`/SigV4 or SigV4A, required resource-policy statement) | **None**: `aws-cloudfront-origins` 2.278.0 has no Web Function origin | +| **Other** | Synthesis-time validation of invalid combinations; testing helpers; customer-managed revision key unsupported | KMS key, network connector (VPC egress), entry point, tags, import by ARN; metrics not modeled | + +### 9.3 Migration risk + +The deciding factor is CloudFormation replacement in deployed stacks (Sharedale runs two Web Functions +on this construct): + +- **Endpoint replacement changes the URL.** `EndpointName` and the endpoint type are create-only. The + L2's default endpoint has a different logical ID and name (`prod` instead of `default`). Without + preserving both, the deploy replaces the endpoint and gives it a new `domainName`, which breaks every + client and CloudFront origin that uses it. +- **Construct path.** The `Function` and `Revision` logical IDs match only when the L2 sits at the same + construct path as our construct. Composing the L2 as a child (`//Function`) changes every + logical ID: CloudFormation would create a new Web Function (new URL) and delete the old one. + Matching the path means deriving from the L2 (`WebFunction` is not sealed) or overriding logical IDs. +- **Role and log groups.** The L2 role's logical ID differs (replacement, which is benign but repoints + the revision). Our log groups are kept only if we pass our own group to the L2. The `.local` companion + stays LayeredCraft-specific either way. +- **Reference expressions.** The L2 writes `Ref`/`GetAtt` where we write literal names. The values + resolve identically, but whether CloudFormation treats these as updates must be proven on a real + stack (`cdk diff`), not assumed. + +### 9.4 Options + +- **A. Retain the L1 implementation.** Zero migration risk. Leaves two Web Function abstractions side + by side in consumers' namespaces (the [§4.1](#41-type-name-collisions) collisions) and duplicates + work AWS now maintains (multi-Region endpoints, asset staging, network connectors, KMS). +- **B. Replace with the L2.** Loses `WebFunctionOrigin`, the `.local` companion, named log groups, + `ExternallyManaged` bucket and caller policies, endpoint-scoped `GrantCloudFrontInvoke` and the + fail-closed grant validation. It also changes every deployed template (endpoint replacement, new + URLs). **Rejected.** +- **C. Compose over the L2 (preferred direction).** Keep the LayeredCraft surface (`WebFunctionOrigin`, + `WebFunctionLogs` including the companion, fail-closed `GrantInvoke`, `GrantCloudFrontInvoke`, + validation, testing helpers) and delegate the function, revision, endpoints, code staging and + resource policy to the L2. **Feasible only if** existing logical IDs and endpoint names are preserved + (derive from the L2 or override IDs, set the default endpoint name to `default`, pass our role and log + groups). The goal is byte-identical golden templates, or a diff proven to be update-in-place on a + deployed stack. + +### 9.5 Recommendation + +1. **3.0.0 (#109):** retain the current implementation (A) with the file-local aliases. No output or + API change. +2. **Proposed additional scope — needs explicit owner approval:** a new issue, *"WebFunctionConstruct + over the AWS CDK L2 (C)"*, in two gated steps: + - **Spike:** a derived or composed prototype that reproduces every existing Web Function golden + template byte-for-byte, or lists each remaining diff with its CloudFormation update behavior. Plus + a `cdk diff` against a deployed Sharedale-shaped stack, read-only, in an isolated temporary checkout + (Sharedale itself is read-only for this work). No implementation commitment. + - **Decision:** if the spike preserves templates (or proves update-in-place), implement C and decide + whether our colliding model types are kept, renamed or replaced by AWS's. If the spike cannot + preserve the endpoint, stay on A and revisit when AWS ships a Web Function CloudFront origin or + endpoint-name control is confirmed. +3. **Timing:** if C is template-compatible, it is not a breaking change for deployed stacks and can + follow 3.0.0. If it requires API breaks (for example replacing our model types with AWS's), it should + land before stable 3.0.0 so the breaking changes ship in one major. The owner decides after the spike. + +## 10. Migration guide outline (#112) + +1. **.NET 8/9 removed** (intentional) — stay on 2.x or move to .NET 10/11. +2. **`Amazon.CDK.Lib` ≥ 2.278.0** (upgrade-induced) — the floor and the Web Function type-name + collisions, with the alias snippet. +3. **`LambdaFunctionConstruct` permission targets** (intentional, U2) — the new alias-only default, + the template before and after, and how to restore 2.x behavior. +4. **`LambdaFunctionConstruct` logging policy** (intentional, U4) — the policy before and after. +5. **New options** (additive) — alias name (U1), public alias/version (U3), S3 artifact code (U7). +6. **New private static-assets construct** (additive, U6) — when to use it instead of + `StaticSiteConstruct`. +7. **Consumer test projects** — no change required; the library's own tests moved to Compono. + +## 11. Open questions for the owner + +1. Approve this design (an acceptance criterion of #109). +2. Approve or decline the proposed Web Function L2 spike issue ([§9.5](#95-recommendation)). +3. Confirm U7's shape: `Code` as an alternative to `AssetPath` (additive) rather than replacing + `AssetPath`. +4. Confirm the working name `PrivateStaticAssetsConstruct` for U6. + +## 12. Revision history + +| Revision | Date | Change | +|---|---|---| +| 1 | 2026-11-24 | Initial proposal for owner review | diff --git a/docs/index.md b/docs/index.md index aee9cd7..be5a0a9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -119,8 +119,8 @@ Full-featured Cognito User Pool with: ## Requirements -- **.NET 8.0** or **.NET 9.0** -- **AWS CDK v2** (Amazon.CDK.Lib 2.274.0+) +- **.NET 10** or **.NET 11** +- **AWS CDK v2** (Amazon.CDK.Lib 2.278.0+) - **AWS CLI** configured with appropriate permissions - **Node.js** (for CDK deployment) diff --git a/global.json b/global.json index 3140116..269797b 100644 --- a/global.json +++ b/global.json @@ -1,4 +1,9 @@ { + "sdk": { + "version": "11.0.100", + "rollForward": "latestFeature", + "allowPrerelease": false + }, "test": { "runner": "Microsoft.Testing.Platform" } diff --git a/src/LayeredCraft.Cdk.Constructs/LambdaFunctionConstruct.cs b/src/LayeredCraft.Cdk.Constructs/LambdaFunctionConstruct.cs index 74c2432..c4ba003 100644 --- a/src/LayeredCraft.Cdk.Constructs/LambdaFunctionConstruct.cs +++ b/src/LayeredCraft.Cdk.Constructs/LambdaFunctionConstruct.cs @@ -127,7 +127,7 @@ public LambdaFunctionConstruct(Construct scope, string id, ILambdaFunctionConstr if (props.GenerateUrl) { - var functionUrl = alias.AddFunctionUrl(new FunctionUrlProps + var functionUrl = alias.AddFunctionUrl(new FunctionUrlOptions { AuthType = FunctionUrlAuthType.NONE }); diff --git a/src/LayeredCraft.Cdk.Constructs/LayeredCraft.Cdk.Constructs.csproj b/src/LayeredCraft.Cdk.Constructs/LayeredCraft.Cdk.Constructs.csproj index aaec97f..7919d20 100644 --- a/src/LayeredCraft.Cdk.Constructs/LayeredCraft.Cdk.Constructs.csproj +++ b/src/LayeredCraft.Cdk.Constructs/LayeredCraft.Cdk.Constructs.csproj @@ -3,7 +3,7 @@ enable enable - net8.0;net9.0;net10.0;net11.0 + net10.0;net11.0 default LayeredCraft.Cdk.Constructs LayeredCraft.Cdk.Constructs diff --git a/src/LayeredCraft.Cdk.Constructs/Models/WebFunctionConstructProps.cs b/src/LayeredCraft.Cdk.Constructs/Models/WebFunctionConstructProps.cs index c1b7732..b039cd1 100644 --- a/src/LayeredCraft.Cdk.Constructs/Models/WebFunctionConstructProps.cs +++ b/src/LayeredCraft.Cdk.Constructs/Models/WebFunctionConstructProps.cs @@ -2,6 +2,11 @@ using Amazon.CDK; using Amazon.CDK.AWS.IAM; using Amazon.CDK.AWS.Lambda; +// Amazon.CDK.Lib 2.278.0 adds same-named Web Function types to Amazon.CDK.AWS.Lambda; +// these aliases keep this library's own types unambiguous. +using IWebFunctionEndpointOptions = LayeredCraft.Cdk.Constructs.Models.IWebFunctionEndpointOptions; +using WebFunctionCode = LayeredCraft.Cdk.Constructs.Models.WebFunctionCode; +using WebFunctionRuntime = LayeredCraft.Cdk.Constructs.Models.WebFunctionRuntime; namespace LayeredCraft.Cdk.Constructs.Models; diff --git a/src/LayeredCraft.Cdk.Constructs/StaticSiteConstruct.cs b/src/LayeredCraft.Cdk.Constructs/StaticSiteConstruct.cs index f96f622..91cbda1 100644 --- a/src/LayeredCraft.Cdk.Constructs/StaticSiteConstruct.cs +++ b/src/LayeredCraft.Cdk.Constructs/StaticSiteConstruct.cs @@ -134,7 +134,7 @@ function handler(event) { ProtocolPolicy = OriginProtocolPolicy.HTTPS_ONLY }); - var apiBehaviorOptions = new BehaviorOptions + var apiBehaviorOptions = new AddBehaviorOptions { AllowedMethods = AllowedMethods.ALLOW_ALL, CachePolicy = CachePolicy.CACHING_DISABLED, diff --git a/src/LayeredCraft.Cdk.Constructs/WebFunctionConstruct.cs b/src/LayeredCraft.Cdk.Constructs/WebFunctionConstruct.cs index 913c30e..40272d7 100644 --- a/src/LayeredCraft.Cdk.Constructs/WebFunctionConstruct.cs +++ b/src/LayeredCraft.Cdk.Constructs/WebFunctionConstruct.cs @@ -8,6 +8,10 @@ using Amazon.JSII.Runtime.Deputy; using Constructs; using LayeredCraft.Cdk.Constructs.Models; +// Amazon.CDK.Lib 2.278.0 adds same-named Web Function types to Amazon.CDK.AWS.Lambda; +// these aliases keep this library's own types unambiguous. +using IWebFunctionEndpointOptions = LayeredCraft.Cdk.Constructs.Models.IWebFunctionEndpointOptions; +using WebFunctionEndpointType = LayeredCraft.Cdk.Constructs.Models.WebFunctionEndpointType; namespace LayeredCraft.Cdk.Constructs; diff --git a/src/LayeredCraft.Cdk.Constructs/WebFunctionEndpointConstruct.cs b/src/LayeredCraft.Cdk.Constructs/WebFunctionEndpointConstruct.cs index 3eb9b1b..26826ec 100644 --- a/src/LayeredCraft.Cdk.Constructs/WebFunctionEndpointConstruct.cs +++ b/src/LayeredCraft.Cdk.Constructs/WebFunctionEndpointConstruct.cs @@ -6,6 +6,12 @@ using Amazon.CDK.AWS.Lambda; using Constructs; using LayeredCraft.Cdk.Constructs.Models; +// Amazon.CDK.Lib 2.278.0 adds same-named Web Function types to Amazon.CDK.AWS.Lambda; +// these aliases keep this library's own types unambiguous. +using IWebFunctionEndpointOptions = LayeredCraft.Cdk.Constructs.Models.IWebFunctionEndpointOptions; +using WebFunctionAuthType = LayeredCraft.Cdk.Constructs.Models.WebFunctionAuthType; +using WebFunctionEndpointAttributes = LayeredCraft.Cdk.Constructs.Models.WebFunctionEndpointAttributes; +using WebFunctionEndpointType = LayeredCraft.Cdk.Constructs.Models.WebFunctionEndpointType; namespace LayeredCraft.Cdk.Constructs; diff --git a/test/LayeredCraft.Cdk.Constructs.Tests/CognitoUserPoolConstructTests.cs b/test/LayeredCraft.Cdk.Constructs.Tests/CognitoUserPoolConstructTests.cs index 7b0aefb..11e03a6 100644 --- a/test/LayeredCraft.Cdk.Constructs.Tests/CognitoUserPoolConstructTests.cs +++ b/test/LayeredCraft.Cdk.Constructs.Tests/CognitoUserPoolConstructTests.cs @@ -2,10 +2,11 @@ using Amazon.CDK.Assertions; using Amazon.CDK.AWS.Route53; using AwesomeAssertions; +using Compono.XunitV3; using LayeredCraft.Cdk.Constructs; using LayeredCraft.Cdk.Constructs.Models; using LayeredCraft.Cdk.Constructs.Testing; -using LayeredCraft.Cdk.Constructs.Tests.TestKit.Attributes; +using LayeredCraft.Cdk.Constructs.Tests.TestKit.Profiles; namespace LayeredCraft.Cdk.Constructs.Tests; @@ -17,7 +18,7 @@ public class CognitoUserPoolConstructTests // ------------------------------------------------------------------------- [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldCreateUserPool(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -29,7 +30,7 @@ public void Construct_ShouldCreateUserPool(CognitoUserPoolConstructProps props) } [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldExposeUserPoolProperty(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -44,7 +45,7 @@ public void Construct_ShouldExposeUserPoolProperty(CognitoUserPoolConstructProps // ------------------------------------------------------------------------- [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldCreateUserPoolDomain(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -56,7 +57,7 @@ public void Construct_ShouldCreateUserPoolDomain(CognitoUserPoolConstructProps p } [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldExposeDomainProperty(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -128,7 +129,7 @@ public void Construct_ShouldLookUpHostedZone_WhenCustomDomainHasNoHostedZone() // ------------------------------------------------------------------------- [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldCreateAppClient(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -140,7 +141,7 @@ public void Construct_ShouldCreateAppClient(CognitoUserPoolConstructProps props) } [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldExposeAppClientsProperty(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -155,7 +156,7 @@ public void Construct_ShouldExposeAppClientsProperty(CognitoUserPoolConstructPro // ------------------------------------------------------------------------- [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldCreateResourceServer(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -171,7 +172,7 @@ public void Construct_ShouldCreateResourceServer(CognitoUserPoolConstructProps p // ------------------------------------------------------------------------- [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldCreateUserGroup(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -187,7 +188,7 @@ public void Construct_ShouldCreateUserGroup(CognitoUserPoolConstructProps props) // ------------------------------------------------------------------------- [Theory] - [CognitoUserPoolConstructAutoData(includeBranding: false)] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldNotCreateManagedLoginBranding_WhenBrandingIsNull(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -203,7 +204,7 @@ public void Construct_ShouldNotCreateManagedLoginBranding_WhenBrandingIsNull(Cog // ------------------------------------------------------------------------- [Theory] - [CognitoUserPoolConstructAutoData(includeBranding: true)] + [Compose(CognitoUserPoolConstructPropsOptions.Branding)] public void Construct_ShouldCreateManagedLoginBranding_WhenBrandingIsConfigured(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -215,7 +216,7 @@ public void Construct_ShouldCreateManagedLoginBranding_WhenBrandingIsConfigured( } [Theory] - [CognitoUserPoolConstructAutoData(includeBranding: true)] + [Compose(CognitoUserPoolConstructPropsOptions.Branding)] public void Construct_ShouldNotCreateBranding_WhenNoBrandingOnClient(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -242,7 +243,7 @@ public void Construct_ShouldNotCreateBranding_WhenNoBrandingOnClient(CognitoUser } [Theory] - [CognitoUserPoolConstructAutoData(includeBranding: true)] + [Compose(CognitoUserPoolConstructPropsOptions.Branding)] public void Construct_ShouldThrow_WhenBrandingSettingsJsonIsEmpty(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -272,7 +273,7 @@ public void Construct_ShouldThrow_WhenBrandingSettingsJsonIsEmpty(CognitoUserPoo // ------------------------------------------------------------------------- [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldExportUserPoolId(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -284,7 +285,7 @@ public void Construct_ShouldExportUserPoolId(CognitoUserPoolConstructProps props } [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldExportUserPoolArn(CognitoUserPoolConstructProps props) { var stack = CreateStack(); @@ -296,7 +297,7 @@ public void Construct_ShouldExportUserPoolArn(CognitoUserPoolConstructProps prop } [Theory] - [CognitoUserPoolConstructAutoData] + [Compose(CognitoUserPoolConstructPropsOptions.None)] public void Construct_ShouldExportAppClientId(CognitoUserPoolConstructProps props) { var stack = CreateStack(); diff --git a/test/LayeredCraft.Cdk.Constructs.Tests/DynamoDbTableConstructTests.cs b/test/LayeredCraft.Cdk.Constructs.Tests/DynamoDbTableConstructTests.cs index 5402c5b..25a70d3 100644 --- a/test/LayeredCraft.Cdk.Constructs.Tests/DynamoDbTableConstructTests.cs +++ b/test/LayeredCraft.Cdk.Constructs.Tests/DynamoDbTableConstructTests.cs @@ -3,8 +3,9 @@ using Amazon.CDK.AWS.DynamoDB; using Amazon.CDK.AWS.Lambda; using AwesomeAssertions; +using Compono.XunitV3; using LayeredCraft.Cdk.Constructs.Models; -using LayeredCraft.Cdk.Constructs.Tests.TestKit.Attributes; +using LayeredCraft.Cdk.Constructs.Tests.TestKit.Profiles; using LayeredCraft.Cdk.Constructs.Testing; using Attribute = Amazon.CDK.AWS.DynamoDB.Attribute; @@ -14,7 +15,7 @@ namespace LayeredCraft.Cdk.Constructs.Tests; public class DynamoDbTableConstructTests { [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void Construct_ShouldCreateDynamoDbTable(DynamoDbTableConstructProps props) { // Arrange @@ -81,7 +82,7 @@ public void Construct_ShouldCreateTableWithPartitionAndSortKey() } [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void Construct_ShouldCreateTableWithGlobalSecondaryIndex(DynamoDbTableConstructProps props) { // Arrange @@ -128,7 +129,7 @@ public void Construct_ShouldCreateTableWithGlobalSecondaryIndex(DynamoDbTableCon } [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void Construct_ShouldCreateTableWithMultipleGlobalSecondaryIndexes(DynamoDbTableConstructProps props) { // Arrange @@ -186,7 +187,7 @@ public void Construct_ShouldCreateTableWithMultipleGlobalSecondaryIndexes(Dynamo } [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void Construct_ShouldCreateTableWithStream(DynamoDbTableConstructProps props) { // Arrange @@ -210,7 +211,7 @@ public void Construct_ShouldCreateTableWithStream(DynamoDbTableConstructProps pr } [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void Construct_ShouldCreateTableWithTimeToLive(DynamoDbTableConstructProps props) { // Arrange @@ -226,7 +227,7 @@ public void Construct_ShouldCreateTableWithTimeToLive(DynamoDbTableConstructProp } [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void Construct_ShouldCreateTableWithPayPerRequestBilling(DynamoDbTableConstructProps props) { // Arrange @@ -302,7 +303,7 @@ public void Construct_ShouldCreateTableWithRetainRemovalPolicy() } [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void AttachStreamLambda_ShouldCreateEventSourceMapping_WhenStreamEnabled(DynamoDbTableConstructProps props) { // Arrange @@ -332,7 +333,7 @@ public void AttachStreamLambda_ShouldCreateEventSourceMapping_WhenStreamEnabled( } [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void AttachStreamLambda_ShouldThrowException_WhenStreamNotEnabled(DynamoDbTableConstructProps props) { // Arrange @@ -353,7 +354,7 @@ public void AttachStreamLambda_ShouldThrowException_WhenStreamNotEnabled(DynamoD } [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void Construct_ShouldCreateAllRequiredOutputs(DynamoDbTableConstructProps props) { // Arrange @@ -396,7 +397,7 @@ public void Construct_ShouldCreateAllRequiredOutputs(DynamoDbTableConstructProps } [Theory] - [DynamoDbTableConstructAutoData] + [Compose] public void Construct_ShouldNotCreateStreamOutput_WhenStreamNotEnabled(DynamoDbTableConstructProps props) { // Arrange diff --git a/test/LayeredCraft.Cdk.Constructs.Tests/LambdaFunctionConstructTests.cs b/test/LayeredCraft.Cdk.Constructs.Tests/LambdaFunctionConstructTests.cs index 6f01636..6f875b0 100644 --- a/test/LayeredCraft.Cdk.Constructs.Tests/LambdaFunctionConstructTests.cs +++ b/test/LayeredCraft.Cdk.Constructs.Tests/LambdaFunctionConstructTests.cs @@ -2,10 +2,11 @@ using Amazon.CDK; using Amazon.CDK.Assertions; using AwesomeAssertions; +using Compono.XunitV3; using LayeredCraft.Cdk.Constructs; using LayeredCraft.Cdk.Constructs.Models; -using LayeredCraft.Cdk.Constructs.Tests.TestKit.Attributes; using LayeredCraft.Cdk.Constructs.Tests.TestKit.Extensions; +using LayeredCraft.Cdk.Constructs.Tests.TestKit.Profiles; using LayeredCraft.Cdk.Constructs.Testing; namespace LayeredCraft.Cdk.Constructs.Tests; @@ -14,7 +15,7 @@ namespace LayeredCraft.Cdk.Constructs.Tests; public class LambdaFunctionConstructTests { [Theory] - [LambdaFunctionConstructAutoData] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldCreateLambdaFunction(LambdaFunctionConstructProps props) { var app = new App(); @@ -38,7 +39,7 @@ public void Construct_ShouldCreateLambdaFunction(LambdaFunctionConstructProps pr } [Theory] - [LambdaFunctionConstructAutoData] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldCreateIAMRole(LambdaFunctionConstructProps props) { var app = new App(); @@ -57,7 +58,7 @@ public void Construct_ShouldCreateIAMRole(LambdaFunctionConstructProps props) } [Theory] - [LambdaFunctionConstructAutoData] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldCreateIAMPolicy(LambdaFunctionConstructProps props) { var app = new App(); @@ -76,7 +77,7 @@ public void Construct_ShouldCreateIAMPolicy(LambdaFunctionConstructProps props) } [Theory] - [LambdaFunctionConstructAutoData] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldIncludeCloudWatchLogsPermissions(LambdaFunctionConstructProps props) { var app = new App(); @@ -119,7 +120,7 @@ public void Construct_ShouldIncludeCloudWatchLogsPermissions(LambdaFunctionConst } [Theory] - [LambdaFunctionConstructAutoData] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldSetEnvironmentVariables(LambdaFunctionConstructProps props) { var app = new App(); @@ -141,7 +142,7 @@ public void Construct_ShouldSetEnvironmentVariables(LambdaFunctionConstructProps } [Theory] - [LambdaFunctionConstructAutoData(includeOtelLayer: true)] + [Compose(LambdaFunctionConstructPropsOptions.Permissions | LambdaFunctionConstructPropsOptions.OtelLayer)] public void Construct_ShouldIncludeOtelLayerWhenEnabled(LambdaFunctionConstructProps props) { var app = new App(); @@ -161,7 +162,7 @@ public void Construct_ShouldIncludeOtelLayerWhenEnabled(LambdaFunctionConstructP } [Theory] - [LambdaFunctionConstructAutoData(includeOtelLayer: false)] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldDisableTracingWhenOtelLayerDisabled(LambdaFunctionConstructProps props) { var app = new App(); @@ -199,7 +200,7 @@ public void Construct_ShouldDisableTracingWhenOtelLayerDisabled(LambdaFunctionCo } [Theory] - [LambdaFunctionConstructAutoData] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldCreateVersionAndAlias(LambdaFunctionConstructProps props) { var app = new App(); @@ -221,7 +222,7 @@ public void Construct_ShouldCreateVersionAndAlias(LambdaFunctionConstructProps p } [Theory] - [LambdaFunctionConstructAutoData(generateUrl: false)] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldAddPermissionsToAllTargets(LambdaFunctionConstructProps props) { var app = new App(); @@ -239,7 +240,7 @@ public void Construct_ShouldAddPermissionsToAllTargets(LambdaFunctionConstructPr } [Theory] - [LambdaFunctionConstructAutoData(includePermissions: false, generateUrl: false)] + [Compose(LambdaFunctionConstructPropsOptions.None)] public void Construct_ShouldHandleEmptyPermissionsList(LambdaFunctionConstructProps props) { var app = new App(); @@ -256,7 +257,7 @@ public void Construct_ShouldHandleEmptyPermissionsList(LambdaFunctionConstructPr } [Theory] - [LambdaFunctionConstructAutoData] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldCreateLogGroupWithRetention(LambdaFunctionConstructProps props) { var app = new App(); @@ -277,7 +278,7 @@ public void Construct_ShouldCreateLogGroupWithRetention(LambdaFunctionConstructP } [Theory] - [LambdaFunctionConstructAutoData] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldNotEnableSnapStartByDefault(LambdaFunctionConstructProps props) { var app = new App(); @@ -294,7 +295,7 @@ public void Construct_ShouldNotEnableSnapStartByDefault(LambdaFunctionConstructP } [Theory] - [LambdaFunctionConstructAutoData] + [Compose(LambdaFunctionConstructPropsOptions.Permissions)] public void Construct_ShouldEnableSnapStartWhenConfigured(LambdaFunctionConstructProps props) { props.EnableSnapStart = true; diff --git a/test/LayeredCraft.Cdk.Constructs.Tests/LayeredCraft.Cdk.Constructs.Tests.csproj b/test/LayeredCraft.Cdk.Constructs.Tests/LayeredCraft.Cdk.Constructs.Tests.csproj index 01897d6..6e9d1ca 100644 --- a/test/LayeredCraft.Cdk.Constructs.Tests/LayeredCraft.Cdk.Constructs.Tests.csproj +++ b/test/LayeredCraft.Cdk.Constructs.Tests/LayeredCraft.Cdk.Constructs.Tests.csproj @@ -5,7 +5,7 @@ enable Exe LayeredCraft.Cdk.Constructs.Tests - net8.0;net9.0;net10.0;net11.0 + net10.0;net11.0 default false