-
Notifications
You must be signed in to change notification settings - Fork 4k
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
chore(toolkit): synth action with tests #32971
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/@aws-cdk/toolkit/lib/api/cloud-assembly/private/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export * from './context-aware-source'; | ||
export * from './exec'; | ||
export * from './prepare-source'; | ||
export * from './source-builder'; | ||
export * from './stack-selectors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/@aws-cdk/toolkit/lib/api/cloud-assembly/private/stack-selectors.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { StackSelectionStrategy, StackSelector } from '../stack-selector'; | ||
|
||
export const ALL_STACKS: StackSelector = { | ||
strategy: StackSelectionStrategy.ALL_STACKS, | ||
}; |
109 changes: 109 additions & 0 deletions
109
packages/@aws-cdk/toolkit/lib/api/cloud-assembly/source-builder.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import type * as cxapi from '@aws-cdk/cx-api'; | ||
|
||
export interface AppProps { | ||
/** | ||
* The output directory into which to the builder app will emit synthesized artifacts. | ||
*/ | ||
readonly outdir?: string; | ||
|
||
/** | ||
* The context provided tp the builder app to synthesize the Cloud Assembly. | ||
*/ | ||
readonly context?: { [key: string]: any }; | ||
} | ||
|
||
export type AssemblyBuilder = (props: AppProps) => Promise<cxapi.CloudAssembly>; | ||
|
||
/** | ||
* Configuration for creating a CLI from an AWS CDK App directory | ||
*/ | ||
export interface CdkAppSourceProps { | ||
/** | ||
* @default - current working directory | ||
*/ | ||
readonly workingDirectory?: string; | ||
|
||
/** | ||
* Emits the synthesized cloud assembly into a directory | ||
* | ||
* @default cdk.out | ||
*/ | ||
readonly outdir?: string; | ||
|
||
/** | ||
* Perform context lookups. | ||
* | ||
* Synthesis fails if this is disabled and context lookups need to be performed. | ||
* | ||
* @default true | ||
*/ | ||
readonly lookups?: boolean; | ||
|
||
/** | ||
* Options that are passed through the context to a CDK app on synth | ||
*/ | ||
readonly synthOptions?: AppSynthOptions; | ||
} | ||
|
||
/** | ||
* Settings that are passed to a CDK app via the context | ||
*/ | ||
export interface AppSynthOptions { | ||
/** | ||
* Debug the CDK app. | ||
* Logs additional information during synthesis, such as creation stack traces of tokens. | ||
* This also sets the `CDK_DEBUG` env variable and will slow down synthesis. | ||
* | ||
* @default false | ||
*/ | ||
readonly debug?: boolean; | ||
|
||
/** | ||
* Enables the embedding of the "aws:cdk:path" in CloudFormation template metadata. | ||
* | ||
* @default true | ||
*/ | ||
readonly pathMetadata?: boolean; | ||
|
||
/** | ||
* Enable the collection and reporting of version information. | ||
* | ||
* @default true | ||
*/ | ||
readonly versionReporting?: boolean; | ||
|
||
/** | ||
* Whe enabled, `aws:asset:xxx` metadata entries are added to the template. | ||
* | ||
* Disabling this can be useful in certain cases like integration tests. | ||
* | ||
* @default true | ||
*/ | ||
readonly assetMetadata?: boolean; | ||
|
||
/** | ||
* Enable asset staging. | ||
* | ||
* Disabling asset staging means that copyable assets will not be copied to the | ||
* output directory and will be referenced with absolute paths. | ||
* | ||
* Not copied to the output directory: this is so users can iterate on the | ||
* Lambda source and run SAM CLI without having to re-run CDK (note: we | ||
* cannot achieve this for bundled assets, if assets are bundled they | ||
* will have to re-run CDK CLI to re-bundle updated versions). | ||
* | ||
* Absolute path: SAM CLI expects `cwd`-relative paths in a resource's | ||
* `aws:asset:path` metadata. In order to be predictable, we will always output | ||
* absolute paths. | ||
* | ||
* @default true | ||
*/ | ||
readonly assetStaging?: boolean; | ||
|
||
/** | ||
* Select which stacks should have asset bundling enabled | ||
* | ||
* @default ["**"] - all stacks | ||
*/ | ||
readonly bundlingForStacks?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './io-host'; | ||
export * from './io-message'; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We previously used a mix in names. This is aligning on
outdir
as the canonical short version of "Output Directory"