deploy-stack.d.ts
1 import * as cxapi from '@aws-cdk/cx-api'; 2 import { Tag } from '../cdk-toolkit'; 3 import { ISDK, SdkProvider } from './aws-auth'; 4 import { ToolkitInfo } from './toolkit-info'; 5 import { StackActivityProgress } from './util/cloudformation/stack-activity-monitor'; 6 export interface DeployStackResult { 7 readonly noOp: boolean; 8 readonly outputs: { 9 [name: string]: string; 10 }; 11 readonly stackArn: string; 12 readonly stackArtifact: cxapi.CloudFormationStackArtifact; 13 } 14 export interface DeployStackOptions { 15 /** 16 * The stack to be deployed 17 */ 18 stack: cxapi.CloudFormationStackArtifact; 19 /** 20 * The environment to deploy this stack in 21 * 22 * The environment on the stack artifact may be unresolved, this one 23 * must be resolved. 24 */ 25 resolvedEnvironment: cxapi.Environment; 26 /** 27 * The SDK to use for deploying the stack 28 * 29 * Should have been initialized with the correct role with which 30 * stack operations should be performed. 31 */ 32 sdk: ISDK; 33 /** 34 * SDK provider (seeded with default credentials) 35 * 36 * Will exclusively be used to assume publishing credentials (which must 37 * start out from current credentials regardless of whether we've assumed an 38 * action role to touch the stack or not). 39 * 40 * Used for the following purposes: 41 * 42 * - Publish legacy assets. 43 * - Upload large CloudFormation templates to the staging bucket. 44 */ 45 sdkProvider: SdkProvider; 46 /** 47 * Information about the bootstrap stack found in the target environment 48 */ 49 toolkitInfo: ToolkitInfo; 50 /** 51 * Role to pass to CloudFormation to execute the change set 52 * 53 * @default - Role specified on stack, otherwise current 54 */ 55 roleArn?: string; 56 /** 57 * Notification ARNs to pass to CloudFormation to notify when the change set has completed 58 * 59 * @default - No notifications 60 */ 61 notificationArns?: string[]; 62 /** 63 * Name to deploy the stack under 64 * 65 * @default - Name from assembly 66 */ 67 deployName?: string; 68 /** 69 * Quiet or verbose deployment 70 * 71 * @default false 72 */ 73 quiet?: boolean; 74 /** 75 * List of asset IDs which shouldn't be built 76 * 77 * @default - Build all assets 78 */ 79 reuseAssets?: string[]; 80 /** 81 * Tags to pass to CloudFormation to add to stack 82 * 83 * @default - No tags 84 */ 85 tags?: Tag[]; 86 /** 87 * Whether to execute the changeset or leave it in review. 88 * 89 * @default true 90 */ 91 execute?: boolean; 92 /** 93 * Optional name to use for the CloudFormation change set. 94 * If not provided, a name will be generated automatically. 95 */ 96 changeSetName?: string; 97 /** 98 * The collection of extra parameters 99 * (in addition to those used for assets) 100 * to pass to the deployed template. 101 * Note that parameters with `undefined` or empty values will be ignored, 102 * and not passed to the template. 103 * 104 * @default - no additional parameters will be passed to the template 105 */ 106 parameters?: { 107 [name: string]: string | undefined; 108 }; 109 /** 110 * Use previous values for unspecified parameters 111 * 112 * If not set, all parameters must be specified for every deployment. 113 * 114 * @default false 115 */ 116 usePreviousParameters?: boolean; 117 /** 118 * Display mode for stack deployment progress. 119 * 120 * @default StackActivityProgress.Bar stack events will be displayed for 121 * the resource currently being deployed. 122 */ 123 progress?: StackActivityProgress; 124 /** 125 * Deploy even if the deployed template is identical to the one we are about to deploy. 126 * @default false 127 */ 128 force?: boolean; 129 /** 130 * Whether we are on a CI system 131 * 132 * @default false 133 */ 134 readonly ci?: boolean; 135 /** 136 * Rollback failed deployments 137 * 138 * @default true 139 */ 140 readonly rollback?: boolean; 141 } 142 export declare function deployStack(options: DeployStackOptions): Promise<DeployStackResult>; 143 export interface DestroyStackOptions { 144 /** 145 * The stack to be destroyed 146 */ 147 stack: cxapi.CloudFormationStackArtifact; 148 sdk: ISDK; 149 roleArn?: string; 150 deployName?: string; 151 quiet?: boolean; 152 } 153 export declare function destroyStack(options: DestroyStackOptions): Promise<void>;