fix(s3vectors): read EncryptionConfiguration with the CFn SseType / KmsKeyArn spellings - #1397
Merged
Merged
Conversation
…msKeyArn spellings The provider read the vector bucket's encryption sub-keys as SSEType / KMSKeyArn, which the AWS::S3Vectors::VectorBucket CFn registry schema and CDK's CfnVectorBucket renderer never emit (both spell them SseType / KmsKeyArn). Both lookups were therefore always undefined, so CreateVectorBucket shipped the account-default encryption instead of the requested customer-managed KMS key - a silent, security-relevant drop. readCurrentState re-emitted the same wrong spellings, so cdkd drift could not surface the divergence either. - create: read SseType / KmsKeyArn and map to the SDK sseType / kmsKeyArn - readCurrentState: emit SseType / KmsKeyArn (CFn spelling) so state and the AWS-current snapshot compare on the same keys - unit tests pin both directions; the two new create tests were verified to fail without the fix - s3-vectors integ fixture gains a CMK-encrypted vector bucket and verify.sh asserts GetVectorBucket returns the requested key ARN Closes #1385
…describe-key probe Re-review follow-ups: the sibling KMS create assertion still used toEqual (which ignores undefined-valued keys) while the AES256 one had been made strict, and the post-destroy 'aws kms describe-key' ran bare under set -euo pipefail so a throttle/AccessDenied aborted with the raw AWS error instead of the named FAIL line.
github-actions Bot
pushed a commit
that referenced
this pull request
Aug 9, 2026
## [0.278.4](v0.278.3...v0.278.4) (2026-08-09) ### Bug Fixes * **s3vectors:** read EncryptionConfiguration with the CFn SseType / KmsKeyArn spellings ([#1397](#1397)) ([58aa6ee](58aa6ee))
|
🎉 This PR is included in version 0.278.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
S3VectorsProviderread the vector bucket's encryption sub-keys asSSEType/KMSKeyArn, which theAWS::S3Vectors::VectorBucketCFn registry schema andCDK's
CfnVectorBucketrenderer never emit — both spell themSseType/KmsKeyArn(verified live againstcloudformation:describe-typeandaws-cdk-lib's generated renderer on 2026-08-09).Both lookups were therefore permanently
undefined, soCreateVectorBucketshipped the account-default encryption instead of the requested
customer-managed KMS key. Deploy reported success; nothing surfaced the
divergence, because
readCurrentStatere-emitted the same wrong spellings, socdkd driftcomparedSSETypeagainstSSETypeand saw no drift while stateheld the template's
SseType.What changed
create()readsSseType/KmsKeyArnand maps them onto the SDK'ssseType/kmsKeyArn.readCurrentState()emitsSseType/KmsKeyArn(the CFn spelling), sostate and the AWS-current snapshot compare on the same keys. The Class-1
KMS-only guard on
KmsKeyArnis preserved verbatim.create-path tests pin the mapping.
Test plan
vp run check/typecheck:test/build/test— 515 files, 8693 tests, 0 type errors.SSEType/KMSKeyArninto the realprovider makes the two new create tests fail (
sseType: undefined), thenrestoring turns them green — the tests fail without the fix.
s3-vectorsfixture now deploys a CMK-encrypted vectorbucket and
verify.shassertsGetVectorBucketreturnssseType=aws:kmsplus the exact key ARN from the stack output. Run2026-08-09: all assertions green, destroy 2 deleted / 0 errors, 0 orphans
(the CMK is asserted to be
PendingDeletion, which is the only state AWSoffers for a deleted key). Recorded in
docs/_generated/integ-last-run.tsv.Upgrade notes for existing stacks
Two consequences of the wire-format change that reviewers surfaced, both
recorded here rather than papered over:
was purely on the wire — the template and
state.propertiesboth alreadyheld
SseType, so a post-upgradecdkd deploysees no diff and the bucketsilently keeps the account-default encryption.
EncryptionConfigurationiscreate-only, so only a replacement fixes it. After upgrading, run
cdkd drift <stack>; a vector bucket that reportsEncryptionConfigurationdrift must be recreated.
cdkd driftreports two phantom rows on such a bucket (SSEType -> undefinedplusSseType: undefined -> …), because theobservedPropertiesbaseline written by the old binary holds the oldspellings while
readCurrentStatenow emits the new ones. This does notself-heal:
kickOffAutoRefreshObservedPropertiesskips any resource thatalready has a baseline (
src/deployment/deploy-engine.ts:876), andEncryptionConfigurationis create-only so no UPDATE ever refreshes it —the rows persist on every subsequent run. Clear them with
cdkd state refresh-observed <stack>, which overwrites the baselineunconditionally.
drift --reverton those rows dead-ends inResourceUpdateNotSupportedError(create-only), which is correct — seepoint 1 for the real remedy.
Notes
AWS::S3Vectors::VectorBucketis not inNESTED_KEY_TARGETS(
scripts/gen-nested-key-coverage.ts), and the critic could not have caughtthis class anyway: the CFn key
SseTypelower-firsts cleanly to the SDK'ssseType, so the pass classifies itsame-spellingand never looks at whatspelling the provider actually reads. Extending the critic to that blind spot
is tracked in (#1393).
Closes #1385