Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as cxapi from '@aws-cdk/cx-api';
import { ToolkitError } from '../../../api/shared-public';
import { ToolkitError } from '../../../toolkit/toolkit-error';

/**
* Given a set of "<account>/<region>" strings, construct environments for them
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/toolkit-lib/lib/actions/diff/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { StackSelector } from '../../../lib/api/shared-public';
import type { StackSelector } from '../../api/cloud-assembly';

export interface CloudFormationDiffOptions {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import type { ResourcesToImport } from '../../../api/resource-import';
import { removeNonImportResources, ResourceMigrator } from '../../../api/resource-import';
import type { IoHelper, SdkProvider } from '../../../api/shared-private';
import { IO, cfnApi } from '../../../api/shared-private';
import { ToolkitError } from '../../../api/shared-public';
import { deserializeStructure, formatErrorMessage } from '../../../private/util';
import { ToolkitError } from '../../../toolkit/toolkit-error';
import { deserializeStructure, formatErrorMessage } from '../../../util';

export function prepareDiff(
ioHelper: IoHelper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import * as promptly from 'promptly';
import { makeCachingProvider } from './provider-caching';
import { ProxyAgentProvider } from './proxy-agent';
import type { SdkHttpOptions } from './types';
import { AuthenticationError } from '../../toolkit/toolkit-error';
import { IO, type IoHelper } from '../io/private';
import { AuthenticationError } from '../toolkit-error';

const DEFAULT_CONNECTION_TIMEOUT = 10000;
const DEFAULT_TIMEOUT = 300000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { inspect } from 'util';
import type { CredentialProviderSource, ForReading, ForWriting, PluginProviderResult, SDKv2CompatibleCredentials, SDKv3CompatibleCredentialProvider, SDKv3CompatibleCredentials } from '@aws-cdk/cli-plugin-contract';
import type { AwsCredentialIdentity, AwsCredentialIdentityProvider } from '@smithy/types';
import { credentialsAboutToExpire, makeCachingProvider } from './provider-caching';
import { AuthenticationError } from '../../toolkit/toolkit-error';
import { formatErrorMessage } from '../../util';
import { IO, type IoHelper } from '../io/private';
import type { PluginHost } from '../plugin';
import type { Mode } from '../plugin/mode';
import { AuthenticationError } from '../toolkit-error';

/**
* Cache for credential providers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { CredentialPlugins } from './credential-plugins';
import { makeCachingProvider } from './provider-caching';
import { SDK } from './sdk';
import { callTrace, traceMemberMethods } from './tracing';
import { AuthenticationError } from '../../toolkit/toolkit-error';
import { formatErrorMessage } from '../../util';
import { IO, type IoHelper } from '../io/private';
import { PluginHost, Mode } from '../plugin';
import { AuthenticationError } from '../toolkit-error';

export type AssumeRoleAdditionalOptions = Partial<Omit<AssumeRoleCommandInput, 'ExternalId' | 'RoleArn'>>;

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/toolkit-lib/lib/api/aws-auth/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ import { cachedAsync } from './cached';
import type { Account } from './sdk-provider';
import { traceMemberMethods } from './tracing';
import { defaultCliUserAgent } from './user-agent';
import { AuthenticationError } from '../../toolkit/toolkit-error';
import { formatErrorMessage } from '../../util';
import { IO, type IoHelper } from '../io/private';
import { AuthenticationError } from '../toolkit-error';

export interface S3ClientOptions {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import type * as cxapi from '@aws-cdk/cx-api';
import type { BootstrapEnvironmentOptions, BootstrappingParameters } from './bootstrap-props';
import { BootstrapStack, bootstrapVersionFromTemplate } from './deploy-bootstrap';
import { legacyBootstrapTemplate } from './legacy-template';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { bundledPackageRootDir, loadStructuredFile, serializeStructure } from '../../util';
import type { SDK, SdkProvider } from '../aws-auth/private';
import type { SuccessfulDeployStackResult } from '../deployments';
import { IO, type IoHelper } from '../io/private';
import { Mode } from '../plugin';
import { ToolkitError } from '../toolkit-error';
import { DEFAULT_TOOLKIT_STACK_NAME } from '../toolkit-info';

export type BootstrapSource = { source: 'legacy' } | { source: 'default' } | { source: 'custom'; templateFile: string };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { StackSelectionStrategy, StackSelector } from './stack-selector';
export { ExpandStackSelection, StackSelectionStrategy, StackSelector } from './stack-selector';
export * from './cached-source';
export * from './source-builder';
export * from './types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { MissingContext } from '@aws-cdk/cloud-assembly-schema';
import * as contextproviders from '../../../context-providers';
import type { ToolkitServices } from '../../../toolkit/private';
import { ToolkitError } from '../../../toolkit/toolkit-error';
import { PROJECT_CONTEXT, type Context } from '../../context';
import type { IoHelper } from '../../io/private';
import { IO } from '../../io/private';
import { ToolkitError } from '../../shared-public';
import type { ICloudAssemblySource, IReadableCloudAssembly } from '../types';

export interface ContextAwareCloudAssemblyProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as child_process from 'node:child_process';
// eslint-disable-next-line @typescript-eslint/no-require-imports
import split = require('split2');
import { ToolkitError } from '../../shared-public';
import { ToolkitError } from '../../../toolkit/toolkit-error';

type EventPublisher = (event: 'open' | 'data_stdout' | 'data_stderr' | 'close', line: string) => void;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import * as cxapi from '@aws-cdk/cx-api';
import * as fs from 'fs-extra';
import { lte } from 'semver';
import type { SdkProvider, IoHelper } from '../../../api/shared-private';
import { splitBySize, versionNumber } from '../../../private/util';
import type { ToolkitServices } from '../../../toolkit/private';
import { ToolkitError } from '../../../toolkit/toolkit-error';
import { splitBySize, versionNumber } from '../../../util';
import { IO } from '../../io/private';
import type { IReadLock, IWriteLock } from '../../rwlock';
import { RWLock } from '../../rwlock';
import { Settings } from '../../settings';
import { ToolkitError } from '../../shared-public';
import { loadTree, some } from '../../tree';
import { prepareDefaultEnvironment as oldPrepare, prepareContext, spaceAvailableForContext, guessExecutable } from '../environment';
import type { AppSynthOptions, LoadAssemblyOptions } from '../source-builder';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import type { ContextAwareCloudAssemblyProps } from './context-aware-source';
import { ContextAwareCloudAssemblySource } from './context-aware-source';
import { execInChildProcess } from './exec';
import { ExecutionEnvironment, assemblyFromDirectory } from './prepare-source';
import type { ToolkitServices } from '../../../toolkit/private';
import { IO } from '../../io/private';
import { ToolkitError, AssemblyError } from '../../shared-public';
import { ToolkitError, AssemblyError } from '../../../toolkit/toolkit-error';
import type { AssemblyBuilder, FromCdkAppOptions } from '../source-builder';
import { ReadableCloudAssembly } from './readable-assembly';
import type { ToolkitServices } from '../../../toolkit/private';
import { Context } from '../../context';
import { IO } from '../../io/private';
import { RWLock } from '../../rwlock';
import { Settings } from '../../settings';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '../../../private/dispose-polyfill';
import { major } from 'semver';
import { ToolkitError } from '../../../toolkit/toolkit-error';
import type { IoHelper } from '../../shared-private';
import { ToolkitError } from '../../shared-public';
import { BaseStackAssembly, ExtendedStackSelection as CliExtendedStackSelection } from '../stack-assembly';
import { StackCollection } from '../stack-collection';
import type { StackSelector } from '../stack-selector';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type * as cxapi from '@aws-cdk/cx-api';
import { SynthesisMessageLevel } from '@aws-cdk/cx-api';
import { AssemblyError, ToolkitError } from '../toolkit-error';
import type { IStackAssembly } from './stack-assembly';
import { type StackDetails } from '../../payloads/stack-details';
import { AssemblyError, ToolkitError } from '../../toolkit/toolkit-error';

/**
* A collection of stacks and related artifacts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { CloudFormationStackArtifact } from '@aws-cdk/cx-api';
import type { Export, ListExportsCommandOutput, StackResourceSummary } from '@aws-sdk/client-cloudformation';
import type { SDK } from '../aws-auth/private';
import { ToolkitError } from '../toolkit-error';
import type { NestedStackTemplates } from './nested-stack-helpers';
import type { Template } from './stack-helpers';
import { ToolkitError } from '../../toolkit/toolkit-error';
import type { SDK } from '../aws-auth/private';
import type { ResourceMetadata } from '../resource-metadata';
import { resourceMetadata } from '../resource-metadata';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Stack, Tag } from '@aws-sdk/client-cloudformation';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { formatErrorMessage, deserializeStructure } from '../../util';
import type { ICloudFormationClient } from '../aws-auth/private';
import { StackStatus } from '../stack-events';
import { ToolkitError } from '../toolkit-error';

export interface Template {
Parameters?: Record<string, TemplateParameter>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { type CloudFormationStackArtifact, type Environment, EnvironmentPlacehol
import { HeadObjectCommand, S3Client } from '@aws-sdk/client-s3';
import { getEndpointFromInstructions } from '@smithy/middleware-endpoint';
import * as chalk from 'chalk';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { contentHash, toYAML } from '../../util';
import type { AssetManifestBuilder } from '../deployments';
import type { EnvironmentResources } from '../environment';
import { IO, type IoHelper } from '../io/private';
import { ToolkitError } from '../toolkit-error';

export type TemplateBodyParameter = {
TemplateBody?: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/toolkit-lib/lib/api/context.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Settings } from './settings';
import { ToolkitError } from './toolkit-error';
import { ToolkitError } from '../toolkit/toolkit-error';

export { TRANSIENT_CONTEXT_KEY } from './settings';
export const PROJECT_CONTEXT = 'cdk.context.json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import type {
import {
AssetPublishing,
} from 'cdk-assets';
import { ToolkitError } from '../../toolkit/toolkit-error';
import type { SDK, SdkProvider } from '../aws-auth/private';
import type { IoMessageMaker, IoHelper } from '../io/private';
import { IO } from '../io/private';
import { Mode } from '../plugin';
import { ToolkitError } from '../toolkit-error';

interface PublishAssetsOptions {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import * as cxschema from '@aws-cdk/cloud-assembly-schema';
import * as cxapi from '@aws-cdk/cx-api';
import * as chalk from 'chalk';
import type { AssetManifestBuilder } from './asset-manifest-builder';
import { ToolkitError } from '../../toolkit/toolkit-error';
import type { EnvironmentResources } from '../environment';
import { IO, type IoHelper } from '../io/private';
import { ToolkitError } from '../toolkit-error';
import type { ToolkitInfo } from '../toolkit-info';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import type { FileManifestEntry } from 'cdk-assets';
import { AssetManifest } from 'cdk-assets';
import { AssetManifestBuilder } from './asset-manifest-builder';
import type { Deployments } from './deployments';
import { ToolkitError } from '../../toolkit/toolkit-error';
import type { ICloudFormationClient, SdkProvider } from '../aws-auth/private';
import type { Template, TemplateBodyParameter, TemplateParameter } from '../cloudformation';
import { CloudFormationStack, makeBodyParameter } from '../cloudformation';
import { IO, type IoHelper } from '../io/private';
import type { ResourcesToImport } from '../resource-import';
import { ToolkitError } from '../toolkit-error';

/**
* Describe a changeset in CloudFormation, regardless of its current state.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ToolkitError } from '../../toolkit/toolkit-error';
import type { SDK } from '../aws-auth/private';
import { IO, type IoHelper } from '../io/private';
import { ToolkitError } from '../toolkit-error';

export async function determineAllowCrossAccountAssetPublishing(
sdk: SDK,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
import { determineAllowCrossAccountAssetPublishing } from './checks';
import type { ChangeSetDeploymentMethod, DeploymentMethod } from './deployment-method';
import type { DeployStackResult, SuccessfulDeployStackResult } from './deployment-result';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { formatErrorMessage } from '../../util';
import type { SDK, SdkProvider, ICloudFormationClient } from '../aws-auth/private';
import type { TemplateBodyParameter } from '../cloudformation';
Expand All @@ -37,7 +38,6 @@ import { tryHotswapDeployment } from '../hotswap/hotswap-deployments';
import { IO, type IoHelper } from '../io/private';
import type { ResourcesToImport } from '../resource-import';
import { StackActivityMonitor } from '../stack-events';
import { ToolkitError } from '../toolkit-error';

export interface DeployStackOptions {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ToolkitError } from '../toolkit-error';
import { ToolkitError } from '../../toolkit/toolkit-error';

export type DeployStackResult =
| SuccessfulDeployStackResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { determineAllowCrossAccountAssetPublishing } from './checks';
import { deployStack, destroyStack } from './deploy-stack';
import type { DeploymentMethod } from './deployment-method';
import type { DeployStackResult } from './deployment-result';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { formatErrorMessage } from '../../util';
import type { SdkProvider } from '../aws-auth/private';
import type {
Expand All @@ -34,7 +35,6 @@ import { IO, type IoHelper } from '../io/private';
import type { ResourceIdentifierSummaries, ResourcesToImport } from '../resource-import';
import { StackActivityMonitor, StackEventPoller, RollbackChoice } from '../stack-events';
import type { Tag } from '../tags';
import { ToolkitError } from '../toolkit-error';
import { DEFAULT_TOOLKIT_STACK_NAME } from '../toolkit-info';

const BOOTSTRAP_STACK_VERSION_FOR_ROLLBACK = 23;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type * as cxapi from '@aws-cdk/cx-api';
import { ToolkitError } from '../toolkit-error';
import type { EnvironmentResources } from './environment-resources';
import { EnvironmentResourcesRegistry } from './environment-resources';
import type { StringWithoutPlaceholders } from './placeholders';
import { replaceEnvPlaceholders } from './placeholders';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { formatErrorMessage } from '../../util';
import type { SDK, CredentialsOptions, SdkForEnvironment, SdkProvider } from '../aws-auth/private';
import { IO, type IoHelper } from '../io/private';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Environment } from '@aws-cdk/cx-api';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { formatErrorMessage } from '../../util';
import type { SDK } from '../aws-auth/private';
import { IO, type IoHelper } from '../io/private';
import { Notices } from '../notices';
import { ToolkitError } from '../toolkit-error';
import { type EcrRepositoryInfo, ToolkitInfo } from '../toolkit-info';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import type { IECRClient, IS3Client, SDK, SdkProvider } from '../aws-auth/privat
import { DEFAULT_TOOLKIT_STACK_NAME, ToolkitInfo } from '../toolkit-info';
import { ProgressPrinter } from './progress-printer';
import { ActiveAssetCache, BackgroundStackRefresh, refreshStacks } from './stack-refresh';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { IO, type IoHelper } from '../io/private';
import { Mode } from '../plugin';
import { ToolkitError } from '../toolkit-error';

// Must use a require() otherwise esbuild complains
// eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/consistent-type-imports
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as chalk from 'chalk';
import type { GcAsset as GCAsset } from './garbage-collector';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { IO, type IoHelper } from '../io/private';
import { ToolkitError } from '../toolkit-error';

export class ProgressPrinter {
private ioHelper: IoHelper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ParameterDeclaration } from '@aws-sdk/client-cloudformation';
import { ToolkitError } from '../../toolkit/toolkit-error';
import type { ICloudFormationClient } from '../aws-auth/private';
import { IO, type IoHelper } from '../io/private';
import { ToolkitError } from '../toolkit-error';

export class ActiveAssetCache {
private readonly stacks: Set<string> = new Set();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import {
classifyChanges,
} from './common';
import type { ResourceChange } from '../../payloads/hotswap';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { lowerCaseFirstCharacter, transformObjectKeys } from '../../util';
import type { SDK } from '../aws-auth/private';

import type { EvaluateCloudFormationTemplate } from '../cloudformation';
import { ToolkitError } from '../toolkit-error';

export async function isHotswappableAppSyncChange(
logicalId: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/toolkit-lib/lib/api/hotswap/common.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { PropertyDifference } from '@aws-cdk/cloudformation-diff';
import type { HotswappableChange, NonHotswappableChange, ResourceChange } from '../../payloads/hotswap';
import { NonHotswappableReason } from '../../payloads/hotswap';
import { ToolkitError } from '../../toolkit/toolkit-error';
import type { SDK } from '../aws-auth/private';
import { ToolkitError } from '../toolkit-error';

export const ICON = '✨';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import {
isHotswappableS3BucketDeploymentChange,
} from './s3-bucket-deployments';
import { isHotswappableStateMachineChange } from './stepfunctions-state-machines';
import { ToolkitError } from '../../toolkit/toolkit-error';
import type { SuccessfulDeployStackResult } from '../deployments';
import { IO, SPAN } from '../io/private';
import type { IMessageSpan, IoHelper } from '../io/private';
import { Mode } from '../plugin';
import { ToolkitError } from '../toolkit-error';

// Must use a require() otherwise esbuild complains about calling a namespace
// eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/consistent-type-imports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import type { FunctionConfiguration, UpdateFunctionConfigurationCommandInput } f
import type { HotswapChange } from './common';
import { classifyChanges } from './common';
import type { AffectedResource, ResourceChange } from '../../payloads/hotswap';
import { ToolkitError } from '../../toolkit/toolkit-error';
import { flatMap } from '../../util';
import type { ILambdaClient, SDK } from '../aws-auth/private';
import { CfnEvaluationException, type EvaluateCloudFormationTemplate } from '../cloudformation';
import { ToolkitError } from '../toolkit-error';

// namespace object imports won't work in the bundle for function exports
// eslint-disable-next-line @typescript-eslint/no-require-imports
Expand Down
1 change: 0 additions & 1 deletion packages/@aws-cdk/toolkit-lib/lib/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export * from './resource-import';
export * from './rwlock';
export * from './settings';
export * from './stack-events';
export * from './toolkit-error';
export * from './toolkit-info';
export * from './work-graph';
export * from './tree';
Expand Down
Loading