Repository navigation
feat(aws): BucketDeployment composite (#1139) - #1921
Merged
Merged
Conversation
lex00
force-pushed
the
feat/1139-bucket-deployment
branch
from
August 25, 2026 05:32
4a5094e to
0ac28f4
Compare
… content (#1139) Adds lexicons/aws/src/composites/bucket-deployment.ts: encrypted, access-blocked-by-default S3 bucket with a website/public-read shape and a removalPolicy (DeletionPolicy) escape hatch. The most-used aws-bench CDK pattern (37 instantiations, chant#1139) had no chant equivalent. Content upload — the deploy-time half of CDK's BucketDeployment — has no CloudFormation resource shape, so it stays out of the composite; it pairs with the existing s3-sync capability (lexicons/aws/src/components/apply.ts, shipped in #566, unpaired with any composite until now) rather than inventing custom-resource machinery chant doesn't have. Building it against Floci turned up a real emulator gap, logged as entry 11 in test/floci-gaps.md: the S3 CloudFormation provider applies BucketEncryption but silently drops WebsiteConfiguration, PublicAccessBlockConfiguration and Tags, and AWS::S3::BucketPolicy reports CREATE_COMPLETE while calling PutBucketPolicy never. All four round-trip fine through the plain S3 API. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013GoZx3iYpaQxKNCNxguYvT
lex00
force-pushed
the
feat/1139-bucket-deployment
branch
from
August 25, 2026 06:28
92b0b4d to
0688290
Compare
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the bucket-deployment composite gap from #1139 (the epic stays open — this closes one of seven listed composite gaps, not the epic):
s3deploy.BucketDeploymentis the aws-bench corpus's most-used CDK pattern, 37 instantiations across 8 real apps, with no chant equivalent before this.lexicons/aws/src/composites/bucket-deployment.ts—BucketDeployment: anAWS::S3::Bucketencrypted and public-access-blocked by default (matchingLambdaS3's existing bucket shape), with an opt-inwebsiteshape (opens the access block, setsWebsiteConfiguration, attaches a scopedAWS::S3::BucketPolicyfors3:GetObject), optionalversioned, and aremovalPolicy("retain" | "destroy", mapped toDeletionPolicy) for the epic's "cleanup" half.defaults.bucket/defaults.bucketPolicyescape hatches follow the standing convention.Design choice, per the task's own steer: deploy-time content upload — the actual thing CDK's
BucketDeploymentdoes at deploy time via a Lambda-backed custom resource — has no CloudFormation resource shape, so it does not belong in aComposite()that only emits fixed CFN resources. chant already ships the mechanism for this: thes3-synccapability (lexicons/aws/src/components/apply.ts'screateS3SyncCapability, realaws s3 sync/cpviaCloudExecutor, typed step-builders3Syncin../components/builders.ts) — it shipped in #566 but had no composite pairing it with a bucket to sync into until this one. This composite is that pairing point; a component composesBucketDeployment({...})with ans3Sync({ from, to: Sub\s3://${bucket.Ref}` })deploy step. No CFN custom-resource / Lambda-backed provisioner exists anywhere in chant (verified), and inventing one to reproduce aPutObjectloop would be new plumbing for an already-solved problem — the epic's own note thatAwsCustomResource` maps to chant Ops, not composites, points the same direction. This is documented in the composite's file-header docstring.Floci gap found while verifying: deploying the exact CFN shape this composite produces (bucket with encryption/public-access-block/website/tags + a sibling
BucketPolicy) againstfloci/floci:1.5.34reachesCREATE_COMPLETE, but onlyBucketEncryptionis actually applied —WebsiteConfiguration,PublicAccessBlockConfigurationandTagsare silently dropped, and theBucketPolicyresource applies nothing at all (PutBucketPolicynever called). All four round-trip correctly through the plain S3 API when set directly. Logged as entry 11 intest/floci-gaps.md— this is emulator behavior, not a composite bug (chant graphon the composite emits every property correctly).Test plan
npx vitest run lexicons/aws/src/composites/bucket-deployment.test.ts— 8 new tests (default private+retain shape, bucketName/versioning,removalPolicy: destroy→DeletionPolicy: Delete, website shape opens the access block + attaches the scoped policy, website withouterrorDocument, tags pass-through,defaults.bucket/defaults.bucketPolicyescape hatches)npx vitest run lexicons/aws/src/composites/barrel.test.ts— confirmsBucketDeploymentreaches the package root, not justcomposites/indexnpx tsc --noEmit -p lexicons/aws/tsconfig.build.json— cleanjust check-lexicons— cleannpx vitest run lexicons/aws— 122 files, 1596 passed / 2 skipped (pre-existing skips, unrelated)floci/floci:1.5.34via Docker) of the exact CFN shape this composite emits —CREATE_COMPLETE, gap found and logged rather than hidden🤖 Generated with Claude Code
https://claude.ai/code/session_013GoZx3iYpaQxKNCNxguYvT