Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: everything is a construct #747

Merged
merged 3 commits into from
May 25, 2022

Conversation

iliapolo
Copy link
Member

@iliapolo iliapolo commented May 25, 2022

Currently, imported resources are not treated as constructs. We didn't initially implement them this way because there was no need, and it makes the API slightly more awkward.

Lately, we've been adding more and more of those, and a use case for them being constructs has risen, when those resources are being used for constructing actual managed resources.

This PR makes it so all imported resources (and selected as well) are constructs, and thus have stable id's we can use.
Even though this hurts API ergonomics a little bit, its worth it for the simplicity and flexibility it gives us. This is also in-line with how the AWS CDK treats imported resources, and in general, having to pass scopes and id's to classes in a construct library is a well known practice.

BREAKING CHANGE: You must now pass a scope and id to imported and selected resources

iliapolo added 2 commits May 25, 2022 09:51
Signed-off-by: Eli Polonsky <[email protected]>
Signed-off-by: Eli Polonsky <[email protected]>
@iliapolo iliapolo requested a review from a team May 25, 2022 07:30
@iliapolo iliapolo requested a review from rix0rrr May 25, 2022 10:17
@mergify mergify bot merged commit 24d9f61 into k8s-24/main May 25, 2022
cdk8s-automation pushed a commit that referenced this pull request May 25, 2022
Currently, imported resources are not treated as constructs. We didn't initially implement them this way because there was no need, and it makes the API slightly more awkward.

Lately, we've been adding more and more of those, and a use case for them being constructs has risen, when those resources are being used for constructing actual managed resources.

This PR makes it so all imported resources (and selected as well) are constructs, and thus have stable id's we can use.
Even though this hurts API ergonomics a little bit, its worth it for the simplicity and flexibility it gives us. This is also in-line with how the AWS CDK treats imported resources, and in general, having to pass scopes and id's to classes in a construct library is a well known practice.

BREAKING CHANGE: You must now pass a `scope` and `id` to imported and selected resources

(cherry picked from commit 24d9f61)
Signed-off-by: Eli Polonsky <[email protected]>
cdk8s-automation pushed a commit that referenced this pull request May 25, 2022
Currently, imported resources are not treated as constructs. We didn't initially implement them this way because there was no need, and it makes the API slightly more awkward.

Lately, we've been adding more and more of those, and a use case for them being constructs has risen, when those resources are being used for constructing actual managed resources.

This PR makes it so all imported resources (and selected as well) are constructs, and thus have stable id's we can use.
Even though this hurts API ergonomics a little bit, its worth it for the simplicity and flexibility it gives us. This is also in-line with how the AWS CDK treats imported resources, and in general, having to pass scopes and id's to classes in a construct library is a well known practice.

BREAKING CHANGE: You must now pass a `scope` and `id` to imported and selected resources

(cherry picked from commit 24d9f61)
Signed-off-by: Eli Polonsky <[email protected]>
@cdk8s-automation
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
k8s-22/main
k8s-23/main

Questions ?

Please refer to the Backport tool documentation

mergify bot pushed a commit that referenced this pull request May 25, 2022
# Backport

This will backport the following commits from `k8s-24/main` to `k8s-22/main`:
 - [feat: everything is a construct (#747)](#747)



### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
mergify bot pushed a commit that referenced this pull request May 25, 2022
# Backport

This will backport the following commits from `k8s-24/main` to `k8s-23/main`:
 - [feat: everything is a construct (#747)](#747)



### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
@iliapolo iliapolo deleted the epolon/everything-is-a-construct branch May 25, 2022 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants