toolkit-info.d.ts
 1  import * as cxapi from '@aws-cdk/cx-api';
 2  import { ISDK } from './aws-auth';
 3  import { CloudFormationStack } from './util/cloudformation';
 4  export declare const DEFAULT_TOOLKIT_STACK_NAME = "CDKToolkit";
 5  /**
 6   * Information on the Bootstrap stack of the environment we're deploying to.
 7   *
 8   * This class serves to:
 9   *
10   * - Inspect the bootstrap stack, and return various properties of it for successful
11   *   asset deployment (in case of legacy-synthesized stacks).
12   * - Validate the version of the target environment, and nothing else (in case of
13   *   default-synthesized stacks).
14   *
15   * An object of this type might represent a bootstrap stack that could not be found.
16   * This is not an issue unless any members are used that require the bootstrap stack
17   * to have been found, in which case an error is thrown (default-synthesized stacks
18   * should never run into this as they don't need information from the bootstrap
19   * stack, all information is already encoded into the Cloud Assembly Manifest).
20   *
21   * Nevertheless, an instance of this class exists to serve as a cache for SSM
22   * parameter lookups (otherwise, the "bootstrap stack version" parameter would
23   * need to be read repeatedly).
24   *
25   * Called "ToolkitInfo" for historical reasons.
26   *
27   */
28  export declare abstract class ToolkitInfo {
29      protected readonly sdk: ISDK;
30      static determineName(overrideName?: string): string;
31      static lookup(environment: cxapi.Environment, sdk: ISDK, stackName: string | undefined): Promise<ToolkitInfo>;
32      static fromStack(stack: CloudFormationStack, sdk: ISDK): ToolkitInfo;
33      static bootstraplessDeploymentsOnly(sdk: ISDK): ToolkitInfo;
34      static bootstrapStackNotFoundInfo(sdk: ISDK): ToolkitInfo;
35      abstract readonly found: boolean;
36      abstract readonly bucketUrl: string;
37      abstract readonly bucketName: string;
38      abstract readonly version: number;
39      abstract readonly bootstrapStack: CloudFormationStack;
40      private readonly ssmCache;
41      constructor(sdk: ISDK);
42      abstract validateVersion(expectedVersion: number, ssmParameterName: string | undefined): Promise<void>;
43      abstract prepareEcrRepository(repositoryName: string): Promise<EcrRepositoryInfo>;
44      /**
45       * Read a version from an SSM parameter, cached
46       */
47      protected versionFromSsmParameter(parameterName: string): Promise<number>;
48  }
49  export interface EcrRepositoryInfo {
50      repositoryUri: string;
51  }
52  export interface EcrCredentials {
53      username: string;
54      password: string;
55      endpoint: string;
56  }