Skip to content

Conversation

@rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Nov 6, 2025

The introduction of reference interfaces (IBucketRef, IRoleRef, etc) led to an increased potential for cyclic references between service modules. Cyclic references are a problem in both Python and Go, and prevents us from taking this idea as far as we want to go.

In this PR, we introduce a new submodule aws-cdk-lib.interfaces where all reference interfaces will live. Because some services have resources with the same name, there are submodules inside the interfaces submodule, so actual interface references will look like aws-cdk-lib.interfaces.aws_s3.IBucketRef.

Because moving the canonical location for these interfaces will be breaking, we leave behind aliases for them in the old location, so TypeScript code can still do import { IBucketRef } from 'aws-cdk-lib/aws-s3';. Unfortunately we cannot do the same for other languages because (a) jsii doesn't understand type aliases yet and (b) even if it did, type aliases can not be rendered appropriately in either Java or C#. This means that this change might be backwards breaking for some consumers that implement L2 interfaces in jsii client languages, but we are assuming that most people doing this would be using TypeScript which will remain unaffected. It is unfortunate that we have to do this, but we have painted ourselves into a corner that we otherwise cannot get out of.

Implementation notes

This PR contains heavy refactoring in spec2cdk around determining file paths and import paths. We used to have to pass import paths into every service module that we code generated; but if we determine the file names ahead of time, we can also just use path.posix.relative() to determine the right import location, which is much easier to use.


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

@rix0rrr rix0rrr requested review from a team November 6, 2025 13:08
@github-actions github-actions bot added the p2 label Nov 6, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team November 6, 2025 13:08
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 6, 2025
Copy link
Collaborator

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

Choose a reason for hiding this comment

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

(This review is outdated)

@rix0rrr rix0rrr added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Nov 6, 2025
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 6, 2025 13:26

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

@mrgrain mrgrain added the pr/request-cli-integ-tests Request CLI integ tests to be run. You will need to review the code and approve the deployment. label Nov 12, 2025
@rix0rrr rix0rrr deployed to test-pipeline November 12, 2025 11:06 — with GitHub Actions Active
@aws-cdk-automation
Copy link
Collaborator

➡️ PR build request submitted to test-main-pipeline ⬅️

A maintainer must now check the pipeline and add the pr-linter/cli-integ-tested label once the pipeline succeeds.

@mergify
Copy link
Contributor

mergify bot commented Nov 12, 2025

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
Copy link
Contributor

mergify bot commented Nov 12, 2025

This pull request has been removed from the queue for the following reason: checks failed.

The merge conditions cannot be satisfied due to failing checks:

You may have to fix your CI before adding the pull request to the queue again.
If you update this pull request, to fix the CI, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@mrgrain mrgrain added pr/needs-tests This PR is missing tests. pr-linter/cli-integ-tested Assert that any CLI changes have been integ tested and removed pr/needs-tests This PR is missing tests. labels Nov 12, 2025
@mrgrain
Copy link
Contributor

mrgrain commented Nov 12, 2025

@Mergifyio queue

@mergify
Copy link
Contributor

mergify bot commented Nov 12, 2025

queue

🛑 There are no queue conditions matching

There are queue conditions defined in the configuration, but none matches. The pull request has not been embarked.

Details:

  • Queue default-merge:
  • -closed
  • -merged
  • label~=no-squash
  • #approved-reviews-by>=1
  • #changes-requested-reviews-by=0
  • -approved-reviews-by~=author
  • -label~=(blocked|do-not-merge)
  • -title~=(WIP|wip)
  • check-success=build
  • check-success=validate-pr
  • any of:
    • -label~=pr/needs-integration-tests-deployment
    • check-success=Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)
  • Queue priority-squash:
  • -closed
  • -merged
  • label~=priority-pr
  • #approved-reviews-by>=1
  • #changes-requested-reviews-by=0
  • -approved-reviews-by~=author
  • -label~=(blocked|do-not-merge|no-squash)
  • -title~=(WIP|wip)
  • base!=release
  • check-success=build
  • check-success=validate-pr
  • any of:
    • -label~=pr/needs-integration-tests-deployment
    • check-success=Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)
  • Queue default-squash:
  • -closed
  • -merged
  • #approved-reviews-by>=1
  • #changes-requested-reviews-by=0
  • -approved-reviews-by~=author
  • -label~=(blocked|do-not-merge|no-squash|priority-pr)
  • -title~=(WIP|wip)
  • base!=release
  • check-success=build
  • check-success=validate-pr
  • any of:
    • -label~=pr/needs-integration-tests-deployment
    • check-success=Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)

@mrgrain mrgrain removed the pr/request-cli-integ-tests Request CLI integ tests to be run. You will need to review the code and approve the deployment. label Nov 12, 2025
@mrgrain
Copy link
Contributor

mrgrain commented Nov 12, 2025

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Nov 12, 2025

refresh

✅ Pull request refreshed

@mergify
Copy link
Contributor

mergify bot commented Nov 12, 2025

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 1e4dfe6 into main Nov 12, 2025
36 of 41 checks passed
@mergify mergify bot deleted the huijbers/centralized-l1-interfaces branch November 12, 2025 12:37
@github-actions
Copy link
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 Nov 12, 2025
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-linter/cli-integ-tested Assert that any CLI changes have been integ tested 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