Skip to content

3.0.0: private static-assets construct (Block Public Access, CloudFront OAC, optional DNS, immutable deployment) #111

Done

Description

@ncipollina

Objective

Add a reusable private static-assets construct for immutable, versioned web assets behind CloudFront. StaticSiteConstruct doesn't fit this: it uses a public-read website bucket with Block Public Access off, requires Route53 and ACM, has SPA and error rewrites, auto-deletes objects and prunes everything.

Scope

  • Bucket: Block Public Access fully on, SSE-S3, SSL-only, versioned, no website endpoint. Removal policy configurable, retain by default.
  • CloudFront: S3 origin with OAC (S3BucketOrigin.WithOriginAccessControl). Viewer policy HTTPS-only by default, redirect optional. Cache policy configurable, caching-optimized by default. The bucket policy is scoped to this distribution's SourceArn.
  • Optional custom DNS: domain names plus an ACM certificate or hosted-zone lookup, and alias records. Default is none, using the CloudFront domain.
  • Optional SPA routing and error rewrites; both off by default.
  • Immutable deployment: BucketDeployment with a destination key prefix, Prune (default false), RetainOnDelete (default true), cache-control and optional invalidation paths.
  • Public properties: bucket, distribution and domain name. Testing helpers (assertions and props builder), golden templates and docs.

Exclusions

Changes to StaticSiteConstruct; API proxy behaviors; Web Function origins.

Acceptance criteria

  • Tests first (observed Red, then Green), Compono-first. They cover: Block Public Access, encryption, SSL-only, versioning, OAC-only bucket access, HTTPS-only viewer policy, no website endpoint, no rewrites by default, prefix/prune/retain/cache-control, and the DNS option on and off.
  • New golden templates for the default and custom-domain variants; existing golden templates unchanged.
  • Passes on net10.0 and net11.0.

Dependencies

Blocked by #109. Can run in parallel with #110 (no shared files except docs and the changelog).


Milestone v3.0.0 · epic #108 · Beads cdkc-2lh.4 (epic cdkc-2lh).

Activity

  1. added this to the v3.0.0 milestone on Nov 24, 2026
  2. added
    ✨ enhancement
    on Nov 24, 2026
  3. ncipollina commented on Nov 24, 2026

    @ncipollina
    ContributorAuthor

    Accepted on merge evidence: #116 merged as 6dc5f00; Publish Preview published 3.0.0-preview.33. Acceptance: all listed behaviors test-first (observed Red then Green), including the Codex-found us-east-1 certificate guard; new default and custom-domain goldens, existing goldens unchanged; 655/655 tests on net10.0 and net11.0. Migration-guide entry: #118.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions