-
Notifications
You must be signed in to change notification settings - Fork 83
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
Cross-App Resource Sharing #159
Comments
I tried to implement the idea and created a repo https://github.com/ivawzh/cdk-playground#plan-1---multiple-cdk-apps. It is failing on deploying the service repo for error:
Is the cross-app reference limitation necessary on AWS CDK? My assumption is the highest-level units store in AWS are CloudFormation stacks. AWS has no concept of |
@ivawzh this is an interesting proposal. I am moving this issue to the RFC repo. I would recommend creating an RFC and following the RFC process to get this explored a bit deeper. |
Has there been any movement on this? I would very much support a more intuitive way to split up CDK apps across different projects, as of now the CDK assumes you want to deploy all of your stacks in the same project and reference things by exposing public properties of each stack. As soon as you try to split up CDK projects into smaller projects this all falls apart, and you are stuck with 1 of 3 options:
I don't know what a better solution would be, maybe this has to be functionality outside of current CloudFormation support, but some way to more easily detect deploy orders when referencing things across projects and be able to automatically deploy projects that are dependent on values in that project/stack would be a huge improvement. Maybe this is all a cautionary tale against splitting up CDK stacks across multiple projects, but I wanted to jot some things down in case someone else comes across this issue so they can consider all of the options. |
No plans to implement because of large effort required and there is not enough upvotes that this feature is beneficial to all users. |
Could we reopen this? I think this is very much a desired feature and there really isn’t a good solution currently. |
I found cross-cdk-repo resource importing is a massive pain point of using AWS CDK. Majority of the public static methods with the pattern of
from...Atributes(scrope, id, attrs)
(such asfromVpcAttributes
,fromClusterAttributes
,fromDomainNameAttributes
, etc) are hard to work with because they require many attributes. For example,fromClusterAttributes
requires the argument ofsecurityGroups
. I don't even know how to makeCfnOutput
of the arraycluser.connection.securityGroups
via CDK while documentation doesn't mention thesecurityGroups
will always be in a fixed order.Use case
I believe cross-repo resource sharing is a common scenario for enterprise, SOA, and micro-service architectures.
Proposed Solution
Instead of importing individual resources with attribute lookup and CfnOutputs, now my idea is to utilize the programming language and import the entire dependent CDK App as a library. And enhance the
App
class to better support in-memory children resource lookup.For example,
At Infrastructure CDK app
At micro-service CDK app
The only API change I need is the new method
app.lookupByStackId(id: string): Stack
. I can also build my own functionlookupStack(app: App, stackId: string): Stack
if you could provide me some guidelines on how to implement the lookup.Other
This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: