Skip to content

feat(glue-alpha): add a typed secret input to Connection - #38585

Open
otaviomacedo wants to merge 2 commits into
mainfrom
otaviom/glue/connection-secret
Open

feat(glue-alpha): add a typed secret input to Connection#38585
otaviomacedo wants to merge 2 commits into
mainfrom
otaviom/glue/connection-secret

Conversation

@otaviomacedo

Copy link
Copy Markdown
Contributor

Connection credentials could only be expressed as plaintext values in the
free-form properties map, which is emitted verbatim into the template — the
only guard was a suppressible synth-time warning, and the path of least
resistance put a plaintext secret in the template.

Add a typed, discoverable secret prop (ISecretRef) to ConnectionOptions.
It is wired to the connection's SECRET_ID property, so Glue reads the
credentials at runtime and the secret value never appears in the template. The
secret reference is merged in after the plaintext scan, so it is not itself
flagged. Setting both secret and a SECRET_ID in properties throws.

ISecretRef (not ISecret) is used so the prop passes awslint:prefer-ref-interface
and avoids dragging the secretsmanager/lambda L2 surface into the module's type
closure; because ISecret extends ISecretRef, any secretsmanager.ISecret is
still accepted. properties remains the free-form escape hatch, and the
plaintext warning stays as defense-in-depth.

Addresses the Connection secrets finding from the aws-glue-alpha pre-GA API review.


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

Connection credentials could only be expressed as plaintext values in the
free-form `properties` map, which is emitted verbatim into the template — the
only guard was a suppressible synth-time warning, and the path of least
resistance put a plaintext secret in the template.

Add a typed, discoverable `secret` prop (`ISecretRef`) to `ConnectionOptions`.
It is wired to the connection's `SECRET_ID` property, so Glue reads the
credentials at runtime and the secret value never appears in the template. The
secret reference is merged in after the plaintext scan, so it is not itself
flagged. Setting both `secret` and a `SECRET_ID` in `properties` throws.

`ISecretRef` (not `ISecret`) is used so the prop passes `awslint:prefer-ref-interface`
and avoids dragging the secretsmanager/lambda L2 surface into the module's type
closure; because `ISecret extends ISecretRef`, any `secretsmanager.ISecret` is
still accepted. `properties` remains the free-form escape hatch, and the
plaintext warning stays as defense-in-depth.

Addresses the Connection secrets finding from the aws-glue-alpha pre-GA API review.
@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 14:34
@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 14:35 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.

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

Labels

contribution/core This is a PR that came from AWS. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants