import * as cxapi from '@aws-cdk/cloud-assembly-api';
import { type DescribeChangeSetCommandOutput, type Parameter, type ResourceToImport } from '@aws-sdk/client-cloudformation';
import type { Deployments } from './deployments';
import type { StackDiagnosis } from '../../actions/diagnose';
import type { ICloudFormationClient, SdkProvider } from '../aws-auth/private';
import type { Template, TemplateBodyParameter, TemplateParameter } from '../cloudformation';
import { CloudFormationStack } from '../cloudformation';
import { CloudFormationStackDiagnoser } from '../diagnosing/stack-diagnoser';
import type { IoHelper } from '../io/private';
import type { ResourcesToImport } from '../resource-import';
export interface ChangeSetReport {
    readonly description: DescribeChangeSetCommandOutput;
    readonly diagnosis: StackDiagnosis;
}
/**
 * Waits for a ChangeSet to reach a terminal state and returns the diagnosis without throwing.
 */
export declare function waitForChangeSetReport(cfn: ICloudFormationClient, ioHelper: IoHelper, stackNameOrArn: string, changeSetNameOrArn: string, { fetchAll, diagnoser, includePropertyValues }: {
    fetchAll: boolean;
    diagnoser: CloudFormationStackDiagnoser;
    includePropertyValues?: boolean;
}): Promise<ChangeSetReport>;
/**
 * Waits for a ChangeSet to be available for triggering a StackUpdate.
 *
 * Will return a changeset that is either ready to be executed or has no changes.
 * Will throw in other cases.
 *
 * @param cfn       - a CloudFormation client
 * @param stackNameOrArn       - the name or ARN of the Stack the ChangeSet belongs to, prefer ARN
 * @param changeSetNameOrArn   - the name or ARN of the ChangeSet, prefer ARN
 * @param fetchAll  - if true, fetches all pages of the ChangeSet before returning.
 * @returns         the CloudFormation description of the ChangeSet
 */
export declare function waitForChangeSet(cfn: ICloudFormationClient, ioHelper: IoHelper, stackNameOrArn: string, changeSetNameOrArn: string, { fetchAll, diagnoser, includePropertyValues }: {
    fetchAll: boolean;
    diagnoser: CloudFormationStackDiagnoser;
    includePropertyValues?: boolean;
}): Promise<DescribeChangeSetCommandOutput>;
export declare function waitForChangeSetGone(cfn: ICloudFormationClient, ioHelper: IoHelper, stackNameOrArn: string, changeSetNameOrArn: string): Promise<void>;
export type PrepareChangeSetOptions = {
    stack: cxapi.CloudFormationStackArtifact;
    deployments: Deployments;
    uuid: string;
    willExecute: boolean;
    sdkProvider: SdkProvider;
    parameters: {
        [name: string]: string | undefined;
    };
    resourcesToImport?: ResourcesToImport;
    importExistingResources?: boolean;
    includeNestedStacks?: boolean;
    /**
     * Default behavior is to log AWS CloudFormation errors and move on. Set this property to true to instead
     * fail on errors received by AWS CloudFormation.
     *
     * @default false
     */
    failOnError?: boolean;
};
export interface CreateChangeSetOptions {
    cfn: ICloudFormationClient;
    changeSetName: string;
    willExecute: boolean;
    exists: boolean;
    uuid: string;
    stack: cxapi.CloudFormationStackArtifact;
    bodyParameter: TemplateBodyParameter;
    parameters: {
        [name: string]: string | undefined;
    };
    resourcesToImport?: ResourceToImport[];
    importExistingResources?: boolean;
    includeNestedStacks?: boolean;
    role?: string;
    diagnoser: CloudFormationStackDiagnoser;
}
/**
 * Create a changeset for a diff operation
 */
export declare function createDiffChangeSet(ioHelper: IoHelper, options: Omit<PrepareChangeSetOptions, 'includeNestedStacks' | 'diagnoser'>): Promise<DescribeChangeSetCommandOutput | undefined>;
/**
 * Uploads the assets that look like templates for this CloudFormation stack
 *
 * This is necessary for any CloudFormation call that needs the template, it may need
 * to be uploaded to an S3 bucket first. We have to follow the instructions in the
 * asset manifest, because technically that is the only place that knows about
 * bucket and assumed roles and such.
 */
export declare function uploadStackTemplateAssets(stack: cxapi.CloudFormationStackArtifact, deployments: Deployments): Promise<void>;
/**
 * Create a change set for online validation (never executes, returns diagnosis instead of throwing).
 *
 * Uses the same env preparation as diff, but calls `waitForChangeSetReport` to return
 * the diagnosis rather than throwing on failure. Always cleans up the change set afterwards.
 */
export declare function createValidationChangeSet(ioHelper: IoHelper, options: Omit<PrepareChangeSetOptions, 'includeNestedStacks' | 'diagnoser' | 'sdkProvider'>): Promise<ChangeSetReport>;
/**
 * Waits for a CloudFormation stack to stabilize in a complete/available state
 * after a delete operation is issued.
 *
 * Fails if the stack is in a FAILED state. Will not fail if the stack was
 * already deleted.
 *
 * @param cfn        - a CloudFormation client
 * @param stackNameOrArn      - the name of the stack to wait for after a delete
 *
 * @returns     the CloudFormation description of the stabilized stack after the delete attempt
 */
export declare function waitForStackDelete(cfn: ICloudFormationClient, ioHelper: IoHelper, stackNameOrArn: string, stabilizationPollingInterval?: number): Promise<CloudFormationStack | undefined>;
/**
 * Waits for a CloudFormation stack to stabilize in a complete/available state
 * after an update/create operation is issued.
 *
 * Fails if the stack is in a FAILED state, ROLLBACK state, or DELETED state.
 *
 * @param cfn        - a CloudFormation client
 * @param stackName      - the name of the stack to wait for after an update
 *
 * @returns     the CloudFormation description of the stabilized stack after the update attempt
 */
export declare function waitForStackDeploy(cfn: ICloudFormationClient, ioHelper: IoHelper, stackName: string, stabilizationPollingInterval?: number): Promise<CloudFormationStack | undefined>;
/**
 * Wait for a stack to become stable (no longer _IN_PROGRESS), returning it
 */
export declare function stabilizeStack(cfn: ICloudFormationClient, ioHelper: IoHelper, stackNameOrArn: string, pollingInterval?: number): Promise<CloudFormationStack | undefined>;
/**
 * The set of (formal) parameters that have been declared in a template
 */
export declare class TemplateParameters {
    private readonly params;
    static fromTemplate(template: Template): TemplateParameters;
    constructor(params: Record<string, TemplateParameter>);
    /**
     * Calculate stack parameters to pass from the given desired parameter values
     *
     * Will throw if parameters without a Default value or a Previous value are not
     * supplied.
     */
    supplyAll(updates: Record<string, string | undefined>): ParameterValues;
    /**
     * From the template, the given desired values and the current values, calculate the changes to the stack parameters
     *
     * Will take into account parameters already set on the template (will emit
     * 'UsePreviousValue: true' for those unless the value is changed), and will
     * throw if parameters without a Default value or a Previous value are not
     * supplied.
     */
    updateExisting(updates: Record<string, string | undefined>, previousValues: Record<string, string>): ParameterValues;
}
/**
 * The set of parameters we're going to pass to a Stack
 */
export declare class ParameterValues {
    private readonly formalParams;
    readonly values: Record<string, string>;
    readonly apiParameters: Parameter[];
    constructor(formalParams: Record<string, TemplateParameter>, updates: Record<string, string | undefined>, previousValues?: Record<string, string>);
    /**
     * Whether this set of parameter updates will change the actual stack values
     */
    hasChanges(currentValues: Record<string, string>): ParameterChanges;
}
export type ParameterChanges = boolean | 'ssm';
//# sourceMappingURL=cfn-api.d.ts.map