import '../private/dispose-polyfill'; import type { TemplateDiff } from '@aws-cdk/cloudformation-diff'; import type { DeployResult, DestroyResult, FeatureFlag, RollbackResult } from './types'; import type { BootstrapEnvironments, BootstrapOptions, BootstrapResult } from '../actions/bootstrap'; import { type DeployOptions } from '../actions/deploy'; import { type DestroyOptions } from '../actions/destroy'; import type { DiagnoseOptions, DiagnoseResult } from '../actions/diagnose'; import type { DiffOptions } from '../actions/diff'; import type { DriftOptions, DriftResult } from '../actions/drift'; import { type ListOptions } from '../actions/list'; import type { OrphanOptions } from '../actions/orphan'; import type { PublishAssetsOptions, PublishAssetsResult } from '../actions/publish-assets'; import type { RefactorOptions } from '../actions/refactor'; import { type RollbackOptions } from '../actions/rollback'; import { type SynthOptions } from '../actions/synth'; import type { IWatcher, WatchOptions } from '../actions/watch'; import { type SdkConfig } from '../api/aws-auth'; import type { ICloudAssemblySource } from '../api/cloud-assembly'; import { CachedCloudAssembly } from '../api/cloud-assembly'; import { CloudAssemblySourceBuilder } from '../api/cloud-assembly/source-builder'; import type { IIoHost } from '../api/io'; import { PluginHost } from '../api/plugin'; import type { StackDetails } from '../payloads'; export interface ToolkitOptions { /** * The IoHost implementation, handling the inline interactions between the Toolkit and an integration. */ readonly ioHost?: IIoHost; /** * Allow emojis in messages sent to the IoHost. * * @default true */ readonly emojis?: boolean; /** * Whether to allow ANSI colors and formatting in IoHost messages. * Setting this value to `false` enforces that no color or style shows up * in messages sent to the IoHost. * Setting this value to true is a no-op; it is equivalent to the default. * * @default - Detects color from the TTY status of the IoHost */ readonly color?: boolean; /** * Configuration options for the SDK. */ readonly sdkConfig?: SdkConfig; /** * Name of the toolkit stack to be used. * * @default "CDKToolkit" */ readonly toolkitStackName?: string; /** * Fail Cloud Assemblies * * @default "error" */ readonly assemblyFailureAt?: 'error' | 'warn' | 'none'; /** * The plugin host to use for loading and querying plugins * * By default, a unique instance of a plugin managing class will be used. * * Use `toolkit.pluginHost.load()` to load plugins into the plugin host from disk. * * @default - A fresh plugin host */ readonly pluginHost?: PluginHost; /** * Set of unstable features to opt into. If you are using an unstable feature, * you must explicitly acknowledge that you are aware of the risks of using it, * by passing it in this set. */ readonly unstableFeatures?: Array; } /** * Names of toolkit features that are still under development, and may change in * the future. */ export type UnstableFeature = 'refactor' | 'orphan' | 'flags' | 'publish-assets' | 'diagnose'; /** * The AWS CDK Programmatic Toolkit */ export declare class Toolkit extends CloudAssemblySourceBuilder { private readonly props; /** * The toolkit stack name used for bootstrapping resources. */ readonly toolkitStackName: string; /** * The IoHost of this Toolkit */ readonly ioHost: IIoHost; /** * The plugin host for loading and managing plugins */ readonly pluginHost: PluginHost; /** * Cache of the internal SDK Provider instance */ private sdkProviderCache?; private baseCredentials; private readonly unstableFeatures; constructor(props?: ToolkitOptions); /** * Bootstrap Action */ bootstrap(environments: BootstrapEnvironments, options?: BootstrapOptions): Promise; /** * Synth Action * * The caller assumes ownership of the `CachedCloudAssembly` and is responsible for calling `dispose()` on * it after use. */ synth(cx: ICloudAssemblySource, options?: SynthOptions): Promise; /** * Diff Action */ diff(cx: ICloudAssemblySource, options?: DiffOptions): Promise<{ [name: string]: TemplateDiff; }>; /** * Drift Action */ drift(cx: ICloudAssemblySource, options?: DriftOptions): Promise<{ [name: string]: DriftResult; }>; /** * Publish Assets Action * * Publishes assets for the selected stacks without deploying */ publishAssets(cx: ICloudAssemblySource, options?: PublishAssetsOptions): Promise; /** * List Action * * List selected stacks and their dependencies */ list(cx: ICloudAssemblySource, options?: ListOptions): Promise; /** * Try to find the root causes for deployment failures of the given stacks. * * Both emits the diagnosis results over the IO host as they are coming in, as well * as returns all of them as the result of the function. * * NOTE: The Cloud Assembly Source **should** be configured with `debug: true` to add * the maximum number of diagnostics. */ diagnose(cx: ICloudAssemblySource, options?: DiagnoseOptions): Promise; /** * Deploy Action * * Deploys the selected stacks into an AWS account */ deploy(cx: ICloudAssemblySource, options?: DeployOptions): Promise; /** * Helper to allow deploy being called as part of the watch action. */ private _deploy; /** * Watch Action * * Continuously observe project files and deploy the selected stacks * automatically when changes are detected. Defaults to hotswap deployments. * * This function returns immediately, starting a watcher in the background. */ watch(cx: ICloudAssemblySource, options?: WatchOptions): Promise; /** * Rollback Action * * Rolls back the selected stacks. */ rollback(cx: ICloudAssemblySource, options?: RollbackOptions): Promise; /** * Helper to allow rollback being called as part of the deploy or watch action. */ private _rollback; /** * Orphan Action. Detaches resources from a CloudFormation stack without deleting them. */ orphan(cx: ICloudAssemblySource, options: OrphanOptions): Promise; /** * Refactor Action. Moves resources from one location (stack + logical ID) to another. */ refactor(cx: ICloudAssemblySource, options?: RefactorOptions): Promise; private _refactor; /** * Destroy Action * * Destroys the selected Stacks. */ destroy(cx: ICloudAssemblySource, options?: DestroyOptions): Promise; /** * Helper to allow destroy being called as part of the deploy action. */ private _destroy; /** * Validate the stacks for errors and warnings according to the CLI's current settings */ private validateStacksMetadata; /** * Create a deployments class */ private deploymentsForAction; private invokeDeployFromWatch; /** * Retrieve feature flag information from the cloud assembly */ flags(cx: ICloudAssemblySource): Promise; private requireUnstableFeature; /** * Create a buildAsset function for use in WorkGraph */ private createBuildAssetFunction; /** * Create a publishAsset function for use in WorkGraph */ private createPublishAssetFunction; } //# sourceMappingURL=toolkit.d.ts.map