Skip to content

fix: replace deprecated S3Origin and Provider logRetention - #283

Merged
revmischa merged 1 commit into
mainfrom
fix/deprecated-cdk-apis
Sep 29, 2026
Merged

revmischa merged 1 commit into
mainfrom
fix/deprecated-cdk-apis

Conversation

@revmischa

Copy link
Copy Markdown
Member

Reopen of #281 (auto-closed when its base branch was deleted). Clears the deprecation warnings from #269.

S3Origin -> S3BucketOrigin.withOriginAccessIdentity. Kept OAI instead of moving to OAC because the CDK docs are explicit that switching an existing distribution from OAI to OAC in one deploy can cause CloudFront to lose bucket access while the policy propagates (bucket policies are eventually consistent). Same OAI and bucket policy as before, so no template change for existing stacks beyond the origin class. OAC as the default is a candidate for v5.

overrides.s3OriginProps is now generated from S3BucketOriginWithOAIProps instead of the deprecated S3OriginProps. Same fields, only the doc strings differ.

The revalidation Provider gets an explicit one day LogGroup instead of logRetention. Existing stacks will get a new log group; the old auto-created /aws/lambda/... group is left in place.

Fixes #269

S3Origin is deprecated in favour of S3BucketOrigin. Use
S3BucketOrigin.withOriginAccessIdentity so existing deployments keep
their OAI and bucket policy unchanged; moving to OAC in place can drop
CloudFront's bucket access while the policy propagates, so that's left
for a major release.

The revalidation Provider's logRetention is replaced with an explicit
one day LogGroup.

Fixes #269
@revmischa
revmischa merged commit 984c4a0 into main Sep 29, 2026
4 checks passed
@revmischa
revmischa deleted the fix/deprecated-cdk-apis branch September 29, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update use of deprecated CDK APIs

1 participant