Skip to content

feat(ruby): add Ruby language bindings for AWS CDK - #38248

Draft
omarqureshi wants to merge 2 commits into
aws:mainfrom
omarqureshi:ruby-language-bindings
Draft

feat(ruby): add Ruby language bindings for AWS CDK#38248
omarqureshi wants to merge 2 commits into
aws:mainfrom
omarqureshi:ruby-language-bindings

Conversation

@omarqureshi

@omarqureshi omarqureshi commented Jul 4, 2026

Copy link
Copy Markdown

Issue #38247

Warning

Draft — CI is expected to be red, by design. Ruby code generation requires a jsii release with Ruby target support, which is not yet published (tracked in aws/jsii#5178). Until it ships, jsii-pacmak has no Ruby target on the released toolchain, so packaging/codegen checks will fail. End-to-end generation + Ruby gem publishing have already been validated against a pre-release build of the compiler. Once the compiler is released this will go green.

Reason for this change

Add Ruby as a first-class supported language for AWS CDK, alongside TypeScript, Python, Java, C#/.NET and Go. Ruby-centric infrastructure teams currently maintain a parallel toolchain in another language or avoid CDK entirely. Demand has been long-standing — the original request has been open since 2018 and is one of the most-reacted language asks.

Design is captured in RFC 0935: Ruby language bindings — tracking issue aws/aws-cdk-rfcs#935 (full RFC text).

Description of changes

Strictly additive — no changes to existing languages, no breaking changes.

  • Per-module .jsiirc.json Ruby target configuration across aws-cdk-lib (329 modules): each gains a ruby target with its module name (root namespace AWSCDK, idiomatic casing, AWS-prefix de-duplication — e.g. aws-s3AWSCDK::S3::Bucket). Naming follows RFC 0935; version suffixes use lowercase v (AWSCDK::WAFv2, matching the IPv4/IPv6 convention).
  • tools/@aws-cdk/spec2cdk (submodule-files.ts): when regenerating a module's .jsiirc.json, preserve an existing hand-authored ruby target (java/dotnet/python remain auto-derived). Without this, gen-cdk would wipe the Ruby blocks.

The enabling jsii work (compiler + jsii-pacmak Ruby target + @jsii/ruby-runtime) is in aws/jsii#5178.

Describe any new or updated permissions being added

None — this is code-generation configuration only; no runtime/IAM changes.

Description of how you validated changes

  • End-to-end Ruby generation and gem publishing validated against a pre-release build of the Ruby-capable jsii compiler (jsii-calc closure + aws-cdk-lib).
  • Generated Ruby signatures validate under rbs validate in the jsii runtime test suite (see feat(ruby): Ruby language bindings jsii#5178).
  • This PR's own CI is gated on the public compiler release (see warning above); fixtures will regenerate and CI will pass once it ships.

Checklist


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

@github-actions github-actions Bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 labels Jul 4, 2026
@aws-cdk-automation
aws-cdk-automation requested a review from a team July 4, 2026 01:49

@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.

The pull request linter fails with the following errors:

❌ Features must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

✅ A exemption request has been requested. Please wait for a maintainer's review.

@omarqureshi
omarqureshi force-pushed the ruby-language-bindings branch from 7375094 to 731852d Compare July 4, 2026 11:53
@omarqureshi omarqureshi changed the title feat(ruby): Ruby language bindings for AWS CDK feat(ruby): add Ruby language bindings for AWS CDK Jul 4, 2026
Adds Ruby language target configuration (.jsiirc.json module/gem naming and acronyms) across aws-cdk-lib, in support of jsii Ruby bindings.
@omarqureshi

Copy link
Copy Markdown
Author

Exemption Request - This PR contains no runtime code changes, it is pure configuration and as such no integration tests or changes to snapshots have been made.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Jul 4, 2026
…n bad .jsiirc

writeJsiiRc only preserved an existing targets.ruby, so a brand-new
service submodule generated after a rebase would ship with no ruby module
name, silently breaking the invariant that every submodule has one. It
now derives { module: "AWSCDK::<Name>" } when absent, reading the root
module and acronym list from aws-cdk-lib's package.json at derivation
time — the single source of truth; nothing is hardcoded.

The conformance test proves the rules against reality: derivation
reproduces the committed .jsiirc.json ruby module for every regular
scope-map submodule, with the 16 genuinely hand-chosen irregulars
enumerated and asserted as committed-value-wins overrides (existing
declarations are always preserved verbatim).

The JSON-parse swallow is gone: an unreadable or invalid .jsiirc.json now
throws with the file path instead of silently dropping ruby targets.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants