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: interoperable Cloud Assembly contract #133

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Jan 20, 2025

Issue

Relates to aws/aws-cdk#32998

Reason for this change

We are publishing the cx-api package twice: Once as a standalone package @aws-cdk/cx-api and once as part of the construct library under aws-cdk-lib/cx-api. The code is copied during the release and the same versions of the packages will have the same code.

However this makes it difficult for other packages to take a type dependency on types from this package. The most common class that's used from cx-api is CloudAssembly - the result of app.synth(). Previously a package had to take a dependency on the very large aws-cdk-lib just to use a single type. It would be better if other packages could instead depend on the smaller, much more focused @aws-cdk/cx-api package.

Description of changes

In aws/aws-cdk#32998 we are adding a mechanism to detect cross-library compatibility of the CloudAssembly class. However, that alone doesn't help us with type checking. Instead we introduce a new type ICloudAssembly into the Cloud Assembly Schema. This interface only declares a single property: directory. Consumers can use this type to indicate where they would like to receive a CloudAssembly. They can then use runtime code to either confirm a provided object already satisfies the requirements or fallback to creating a new CloudAssembly from the directory.

@mergify mergify bot merged commit 50cc543 into main Jan 20, 2025
12 checks passed
@mergify mergify bot deleted the mrgrain/feat/interoperable-cloud-assembly-interface branch January 20, 2025 12:56
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.

2 participants