-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(toolkit): synth action with tests (#32971)
### Issue Closes #32940 ### Description of changes Define the API for the synth action. Includes DX improvements for some other APIs. ### Describe any new or updated permissions being added n/a ### Description of how you validated changes These are the tests! ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
Showing
42 changed files
with
1,989 additions
and
211 deletions.
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.