UNPKG

@aws-cdk/integ-runner

Version:

CDK Integration Testing Tool

96 lines 2.61 kB
import type { DeployOptions, DestroyOptions, ICdk, ListOptions, SynthOptions, WatchEvents, WatchOptions } from './cdk-interface'; export interface ToolkitLibEngineOptions { /** * The directory to run the cdk commands from */ readonly workingDirectory: string; /** * Additional environment variables to set * in the execution environment that will be running * the cdk app * * @default - no additional env vars */ readonly env?: { [name: string]: string; }; /** * Show the output from running the CDK CLI * * @default false */ readonly showOutput?: boolean; /** * The region the CDK app should synthesize itself for */ readonly region: string; /** * The AWS profile to use when authenticating * * @default - no profile is passed, the default profile is used */ readonly profile?: string; } /** * A runner engine powered directly by the toolkit-lib */ export declare class ToolkitLibRunnerEngine implements ICdk { private readonly toolkit; private readonly options; private readonly showOutput; private readonly ioHost; constructor(options: ToolkitLibEngineOptions); /** * Synthesizes the CDK app */ synth(options: SynthOptions): Promise<void>; /** * Lists the stacks in the CDK app */ list(options: ListOptions): Promise<string[]>; /** * Deploys the CDK app */ deploy(options: DeployOptions): Promise<void>; /** * Watches the CDK app for changes and deploys them automatically */ watch(options: WatchOptions, events?: WatchEvents): Promise<void>; /** * Destroys the CDK app */ destroy(options: DestroyOptions): Promise<void>; /** * Creates a Cloud Assembly Source from the provided options. */ private cx; /** * Creates a StackSelector from the provided options. */ private stackSelector; /** * Check that the regions for the stacks in the CloudAssembly match the regions requested on the engine * * This prevents misconfiguration of the integ test app. People tend to put: * * ```ts * new Stack(app, 'Stack', { * env: { * region: 'some-region-that-suits-me', * } * }); * ``` * * Into their integ tests, instead of: * * ```ts * { * region: process.env.CDK_DEFAULT_REGION, * } * ``` * * This catches that misconfiguration. */ private validateRegion; } //# sourceMappingURL=toolkit-lib.d.ts.map