Skip to content

feat(glue-alpha): model SecurityConfiguration encryption as factory subtypes - #38586

Merged
mergify[bot] merged 3 commits into
mainfrom
otaviom/glue/security-config-encryption
Aug 18, 2026
Merged

feat(glue-alpha): model SecurityConfiguration encryption as factory subtypes#38586
mergify[bot] merged 3 commits into
mainfrom
otaviom/glue/security-config-encryption

Conversation

@otaviomacedo

Copy link
Copy Markdown
Contributor

The three encryption blocks were co-optional { mode, kmsKey? } structs. For S3, this let an illegal combination be expressed — { mode: S3_MANAGED, kmsKey } — and the key was then silently dropped (SSE-S3 was applied with no error), a security-relevant silent failure. The mode field on the CloudWatch and Job Bookmarks blocks was also a mandatory single-value enum carrying no information.

Replace the structs with factory classes that pair the mode with its key correct-by-construction:

  • S3Encryption.s3Managed() / S3Encryption.kms(key?)
  • CloudWatchEncryption.kms(key?)
  • JobBookmarksEncryption.clientSideKms(key?)

s3Managed() takes no key, so a key can never be paired with S3-managed encryption — the silent-drop is now unrepresentable. The single-value mode field is gone (the factory name encodes it), which removes the now-dead CloudWatchEncryptionMode and JobBookmarksEncryptionMode enums. kms() still auto-creates a key when one is omitted, and the existing shared-key behavior is unchanged, so synthesized output for all valid inputs is identical.

Addresses the SecurityConfiguration encryption-blocks finding from the aws-glue-alpha pre-GA API review.

BREAKING CHANGE: s3Encryption, cloudWatchEncryption, and jobBookmarksEncryption are no longer object literals. Use S3Encryption.s3Managed() / S3Encryption.kms(key?), CloudWatchEncryption.kms(key?), and JobBookmarksEncryption.clientSideKms(key?). The CloudWatchEncryptionMode and JobBookmarksEncryptionMode enums are removed (their mode is now implicit); S3EncryptionMode is retained.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

…ubtypes

The three encryption blocks were co-optional `{ mode, kmsKey? }` structs. For
S3, this let an illegal combination be expressed — `{ mode: S3_MANAGED, kmsKey }`
— and the key was then silently dropped (SSE-S3 was applied with no error), a
security-relevant silent failure. The `mode` field on the CloudWatch and Job
Bookmarks blocks was also a mandatory single-value enum carrying no information.

Replace the structs with factory classes that pair the mode with its key
correct-by-construction:

- S3Encryption.s3Managed() / S3Encryption.kms(key?)
- CloudWatchEncryption.kms(key?)
- JobBookmarksEncryption.clientSideKms(key?)

`s3Managed()` takes no key, so a key can never be paired with S3-managed
encryption — the silent-drop is now unrepresentable. The single-value `mode`
field is gone (the factory name encodes it), which removes the now-dead
`CloudWatchEncryptionMode` and `JobBookmarksEncryptionMode` enums. `kms()` still
auto-creates a key when one is omitted, and the existing shared-key behavior is
unchanged, so synthesized output for all valid inputs is identical.

Addresses the SecurityConfiguration encryption-blocks finding from the
aws-glue-alpha pre-GA API review.

BREAKING CHANGE: `s3Encryption`, `cloudWatchEncryption`, and
`jobBookmarksEncryption` are no longer object literals. Use
`S3Encryption.s3Managed()` / `S3Encryption.kms(key?)`,
`CloudWatchEncryption.kms(key?)`, and `JobBookmarksEncryption.clientSideKms(key?)`.
The `CloudWatchEncryptionMode` and `JobBookmarksEncryptionMode` enums are removed
(their mode is now implicit); `S3EncryptionMode` is retained.
@github-actions github-actions Bot added the p2 label Aug 17, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team August 17, 2026 15:49
@mergify mergify Bot added the contribution/core This is a PR that came from AWS. label Aug 17, 2026
@mergify
mergify Bot deployed to automation August 17, 2026 15:49 Active
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This pull request description does not follow the correct template structure.

PRs without a linked issue will receive lower priority for review and merging. Please update the description to follow the PR template and include a line like Closes #123 in the Issue section. If no existing issue matches your change, create one first.

@aws-cdk-automation aws-cdk-automation left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(This review is outdated)

@otaviomacedo otaviomacedo added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Aug 18, 2026
@aws-cdk-automation
aws-cdk-automation dismissed their stale review August 18, 2026 08:02

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Aug 18, 2026
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 18, 2026
@mergify

mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify

mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-08-18 12:52 UTC · Rule: default-squash · triggered by rule automatic merge
  • Checks passed · in-place
  • Merged2026-08-18 14:21 UTC · at 44648d25c18255e19cb1f2744fce7c3dd389280b · squash

This pull request spent 1 hour 28 minutes 54 seconds in the queue, including 1 hour 58 seconds running CI.

Required conditions to merge

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Aug 18, 2026
@mergify

mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
mergify Bot deployed to automation August 18, 2026 13:20 Active
@mergify
mergify Bot deployed to automation August 18, 2026 13:20 Active
@mergify

mergify Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
mergify Bot merged commit e37e7a6 into main Aug 18, 2026
18 of 20 checks passed
@mergify
mergify Bot deleted the otaviom/glue/security-config-encryption branch August 18, 2026 14:21
@github-actions

Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contribution/core This is a PR that came from AWS. p2 pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. pr-linter/exempt-integ-test The PR linter will not require integ test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants