@aws-cdk/app-staging-synthesizer-alpha 2.82.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,401 @@
1
+ # App Staging Synthesizer
2
+ <!--BEGIN STABILITY BANNER-->
3
+
4
+ ---
5
+
6
+ ![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
7
+
8
+ > The APIs of higher level constructs in this module are experimental and under active development.
9
+ > They are subject to non-backward compatible changes or removal in any future version. These are
10
+ > not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
11
+ > announced in the release notes. This means that while you may use them, you may need to update
12
+ > your source code when upgrading to a newer version of this package.
13
+
14
+ ---
15
+
16
+ <!--END STABILITY BANNER-->
17
+
18
+ This library includes constructs aimed at replacing the current model of bootstrapping and providing
19
+ greater control of the bootstrap experience to the CDK user. The important constructs in this library
20
+ are as follows:
21
+
22
+ - the `IStagingResources` interface: a framework for an app-level bootstrap stack that handles
23
+ file assets and docker assets.
24
+ - the `DefaultStagingStack`, which is a works-out-of-the-box implementation of the `IStagingResources`
25
+ interface.
26
+ - the `AppStagingSynthesizer`, a new CDK synthesizer that will synthesize CDK applications with
27
+ the staging resources provided.
28
+
29
+ > As this library is `experimental`, there are features that are not yet implemented. Please look
30
+ > at the list of [Known Limitations](#known-limitations) before getting started.
31
+
32
+ To get started, update your CDK App with a new `defaultStackSynthesizer`:
33
+
34
+ ```ts
35
+ const app = new App({
36
+ defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
37
+ appId: 'my-app-id', // put a unique id here
38
+ }),
39
+ });
40
+ ```
41
+
42
+ This will introduce a `DefaultStagingStack` in your CDK App and staging assets of your App
43
+ will live in the resources from that stack rather than the CDK Bootstrap stack.
44
+
45
+ If you are migrating from a different version of synthesis your updated CDK App will target
46
+ the resources in the `DefaultStagingStack` and no longer be tied to the bootstrapped resources
47
+ in your account.
48
+
49
+ ## Bootstrap Model
50
+
51
+ Our current bootstrap model looks like this, when you run `cdk bootstrap aws://<account>/<region>` :
52
+
53
+ ```text
54
+ ┌───────────────────────────────────┐┌────────────────────────┐┌────────────────────────┐
55
+ │ ││ ││ │
56
+ │ ││ ││ │
57
+ │ ┌───────────────┐ ││ ┌──────────────┐ ││ ┌──────────────┐ │
58
+ │ │Bootstrap Stack│ ││ │ CDK App 1 │ ││ │ CDK App 2 │ │
59
+ │ └───────────────┘ ││ └──────────────┘ ││ └──────────────┘ │
60
+ │ ││ ││ │
61
+ │ ││ ││ │
62
+ │ ┌───────────────────────────┐ ││ ┌────────────┐ ││ │
63
+ │ │IAM Role for CFN execution │ ││┌────│ S3 Asset │ ││ │
64
+ │ │ IAM Role for lookup │ │││ └────────────┘ ││ │
65
+ │ │ IAM Role for deployment │ │││ ││ │
66
+ │ └───────────────────────────┘ │││ ││ ┌─────────────┐ │
67
+ │ │││ ┌──────────┼┼─────│ S3 Asset │ │
68
+ │ │││ │ ││ └─────────────┘ │
69
+ │ ┌───────────────────────────────┐ │││ │ ││ │
70
+ │ │ IAM Role for File Publishing │ │││ │ ││ │
71
+ │ │ IAM Role for Image Publishing │ │││ │ ││ │
72
+ │ └───────────────────────────────┘ │││ │ ││ │
73
+ │ │││ │ ││ │
74
+ │ ┌─────────────────────────────┐ │││ │ ││ │
75
+ │ │S3 Bucket for Staging Assets │ │││ │ ││ │
76
+ │ │ KMS Key encryption │◀─┼┼┴────────────┘ ││ ┌────────────┐ │
77
+ │ └─────────────────────────────┘ ││ ┌──────────┼┼───── │ ECR Asset │ │
78
+ │ ││ │ ││ └────────────┘ │
79
+ │ ││ │ ││ │
80
+ │┌─────────────────────────────────┐││ │ ││ │
81
+ ││ECR Repository for Staging Assets◀┼┼─────────────┘ ││ │
82
+ │└─────────────────────────────────┘││ ││ │
83
+ │ ││ ││ │
84
+ │ ││ ││ │
85
+ │ ││ ││ │
86
+ │ ││ ││ │
87
+ │ ││ ││ │
88
+ │ ││ ││ │
89
+ └───────────────────────────────────┘└────────────────────────┘└────────────────────────┘
90
+ ```
91
+
92
+ Your CDK Application utilizes these resources when deploying. For example, if you have a file asset,
93
+ it gets uploaded to the S3 Staging Bucket using the File Publishing Role when you run `cdk deploy`.
94
+
95
+ This library introduces an alternate model to bootstrapping, by splitting out essential CloudFormation IAM roles
96
+ and staging resources. There will still be a Bootstrap Stack, but this will only contain IAM roles necessary for
97
+ CloudFormation deployment. Each CDK App will instead be in charge of its own staging resources, including the
98
+ S3 Bucket, ECR Repositories, and associated IAM roles. It works like this:
99
+
100
+ The Staging Stack will contain, on a per-need basis,
101
+
102
+ - 1 S3 Bucket with KMS encryption for all file assets in the CDK App.
103
+ - An ECR Repository _per_ image (and its revisions).
104
+ - IAM roles with access to the Bucket and Repositories.
105
+
106
+ ```text
107
+ ┌─────────────────────────────┐┌───────────────────────────────────────┐┌───────────────────────────────────────┐
108
+ │ ││ ││ │
109
+ │ ┌───────────────┐ ││ ┌──────────────┐ ││ ┌──────────────┐ │
110
+ │ │Bootstrap Stack│ ││ │ CDK App 1 │ ││ │ CDK App 2 │ │
111
+ │ └───────────────┘ ││ └──────────────┘ ││ └──────────────┘ │
112
+ │ ││┌──────────────────┐ ││┌──────────────────┐ │
113
+ │ │││ ┌──────────────┐ │ │││ ┌──────────────┐ │ │
114
+ │ │││ │Staging Stack │ │ │││ │Staging Stack │ │ │
115
+ │ │││ └──────────────┘ │ │││ └──────────────┘ │ │
116
+ │ │││ │ │││ │ │
117
+ │ │││ │ │││ │ │
118
+ │ │││┌────────────────┐│ ┌────────────┐│││┌────────────────┐│ ┌────────────┐│
119
+ │ ││││ IAM Role for ││ ┌───│ S3 Asset │││││ IAM Role for ││ ┌───│ S3 Asset ││
120
+ │ ││││File Publishing ││ │ └────────────┘││││File Publishing ││ │ └────────────┘│
121
+ │ │││└────────────────┘│ │ ││││ IAM Role for ││ │ │
122
+ │ │││ │ │ ││││Image Publishing││ │ │
123
+ │┌───────────────────────────┐│││ │ │ │││└────────────────┘│ │ │
124
+ ││IAM Role for CFN execution ││││ │ │ │││ │ │ │
125
+ ││ IAM Role for lookup ││││ │ │ │││ │ │ │
126
+ ││ IAM Role for deployment ││││┌────────────────┐│ │ │││┌────────────────┐│ │ │
127
+ │└───────────────────────────┘││││ S3 Bucket for ││ │ ││││ S3 Bucket for ││ │ │
128
+ │ ││││ Staging Assets │◀─┘ ││││ Staging Assets │◀─┘ │
129
+ │ │││└────────────────┘│ │││└────────────────┘│ ┌───────────┐│
130
+ │ │││ │ │││ │ ┌───│ ECR Asset ││
131
+ │ │││ │ │││┌────────────────┐│ │ └───────────┘│
132
+ │ │││ │ ││││ ECR Repository ││ │ │
133
+ │ │││ │ ││││ for Staging │◀──┘ │
134
+ │ │││ │ ││││ Assets ││ │
135
+ │ │││ │ │││└────────────────┘│ │
136
+ │ │││ │ │││ │ │
137
+ │ │││ │ │││ │ │
138
+ │ │││ │ │││ │ │
139
+ │ │││ │ │││ │ │
140
+ │ │││ │ │││ │ │
141
+ │ ││└──────────────────┘ ││└──────────────────┘ │
142
+ └─────────────────────────────┘└───────────────────────────────────────┘└───────────────────────────────────────┘
143
+ ```
144
+
145
+ This allows staging resources to be created when needed next to the CDK App. It has the following
146
+ benefits:
147
+
148
+ - Resources between separate CDK Apps are separated so they can be cleaned up and lifecycle
149
+ controlled individually.
150
+ - Users have a familiar way to customize staging resources in the CDK Application.
151
+
152
+ ## Using the Default Staging Stack per Environment
153
+
154
+ The most common use case will be to use the built-in default resources. In this scenario, the
155
+ synthesizer will create a new Staging Stack in each environment the CDK App is deployed to store
156
+ its staging resources. To use this kind of synthesizer, use `AppStagingSynthesizer.defaultResources()`.
157
+
158
+ ```ts
159
+ const app = new App({
160
+ defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
161
+ appId: 'my-app-id',
162
+ }),
163
+ });
164
+ ```
165
+
166
+ Every CDK App that uses the `DefaultStagingStack` must include an `appId`. This should
167
+ be an identifier unique to the app and is used to differentiate staging resources associated
168
+ with the app.
169
+
170
+ ### Default Staging Stack
171
+
172
+ The Default Staging Stack includes all the staging resources necessary for CDK Assets. The below example
173
+ is of a CDK App using the `AppStagingSynthesizer` and creating a file asset for the Lambda Function
174
+ source code. As part of the `DefaultStagingStack`, an S3 bucket and IAM role will be created that will be
175
+ used to upload the asset to S3.
176
+
177
+ ```ts
178
+ const app = new App({
179
+ defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({ appId: 'my-app-id' }),
180
+ });
181
+
182
+ const stack = new Stack(app, 'my-stack');
183
+
184
+ new lambda.Function(stack, 'lambda', {
185
+ code: lambda.AssetCode.fromAsset(path.join(__dirname, 'assets')),
186
+ handler: 'index.handler',
187
+ runtime: lambda.Runtime.PYTHON_3_9,
188
+ });
189
+
190
+ app.synth();
191
+ ```
192
+
193
+ ### Custom Roles
194
+
195
+ You can customize some or all of the roles you'd like to use in the synthesizer as well,
196
+ if all you need is to supply custom roles (and not change anything else in the `DefaultStagingStack`):
197
+
198
+ ```ts
199
+ const app = new App({
200
+ defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
201
+ appId: 'my-app-id',
202
+ deploymentIdentities: DeploymentIdentities.specifyRoles({
203
+ cloudFormationExecutionRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Execute'),
204
+ deploymentRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Deploy'),
205
+ lookupRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/Lookup'),
206
+ }),
207
+ }),
208
+ });
209
+ ```
210
+
211
+ Or, you can ask to use the CLI credentials that exist at deploy-time.
212
+ These credentials must have the ability to perform CloudFormation calls,
213
+ lookup resources in your account, and perform CloudFormation deployment.
214
+ For a full list of what is necessary, see `LookupRole`, `DeploymentActionRole`,
215
+ and `CloudFormationExecutionRole` in the
216
+ [bootstrap template](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml).
217
+
218
+ ```ts
219
+ const app = new App({
220
+ defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
221
+ appId: 'my-app-id',
222
+ deploymentIdentities: DeploymentIdentities.cliCredentials(),
223
+ }),
224
+ });
225
+ ```
226
+
227
+ The default staging stack will create roles to publish to the S3 bucket and ECR repositories,
228
+ assumable by the deployment role. You can also specify an existing IAM role for the
229
+ `fileAssetPublishingRole` or `imageAssetPublishingRole`:
230
+
231
+ ```ts
232
+ const app = new App({
233
+ defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
234
+ appId: 'my-app-id',
235
+ fileAssetPublishingRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/S3Access'),
236
+ imageAssetPublishingRole: BootstrapRole.fromRoleArn('arn:aws:iam::123456789012:role/ECRAccess'),
237
+ }),
238
+ });
239
+ ```
240
+
241
+ ### Deploy Time S3 Assets
242
+
243
+ There are two types of assets:
244
+
245
+ - Assets used only during deployment. These are used to hand off a large piece of data to another
246
+ service, that will make a private copy of that data. After deployment, the asset is only necessary for
247
+ a potential future rollback.
248
+ - Assets accessed throughout the running life time of the application.
249
+
250
+ Examples of assets that are only used at deploy time are CloudFormation Templates and Lambda Code
251
+ bundles. Examples of assets accessed throughout the life time of the application are script files
252
+ downloaded to run in a CodeBuild Project, or on EC2 instance startup. ECR images are always application
253
+ life-time assets. S3 deploy time assets are stored with a `deploy-time/` prefix, and a lifecycle rule will collect them after a configurable number of days.
254
+
255
+ Lambda assets are by default marked as deploy time assets:
256
+
257
+ ```ts
258
+ declare const stack: Stack;
259
+ new lambda.Function(stack, 'lambda', {
260
+ code: lambda.AssetCode.fromAsset(path.join(__dirname, 'assets')), // lambda marks deployTime = true
261
+ handler: 'index.handler',
262
+ runtime: lambda.Runtime.PYTHON_3_9,
263
+ });
264
+ ```
265
+
266
+ Or, if you want to create your own deploy time asset:
267
+
268
+ ```ts
269
+ import { Asset } from 'aws-cdk-lib/aws-s3-assets';
270
+
271
+ declare const stack: Stack;
272
+ const asset = new Asset(stack, 'deploy-time-asset', {
273
+ deployTime: true,
274
+ path: path.join(__dirname, './deploy-time-asset'),
275
+ });
276
+ ```
277
+
278
+ By default, we store deploy time assets for 30 days, but you can change this number by specifying
279
+ `deployTimeFileAssetLifetime`. The number you specify here is how long you will be able to roll back
280
+ to a previous version of an application just by doing a CloudFormation deployment with the old
281
+ template, without rebuilding and republishing assets.
282
+
283
+ ```ts
284
+ const app = new App({
285
+ defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
286
+ appId: 'my-app-id',
287
+ deployTimeFileAssetLifetime: Duration.days(100),
288
+ }),
289
+ });
290
+ ```
291
+
292
+ ### Lifecycle Rules on ECR Repositories
293
+
294
+ By default, we store a maximum of 3 revisions of a particular docker image asset. This allows
295
+ for smooth faciliation of rollback scenarios where we may reference previous versions of an
296
+ image. When more than 3 revisions of an asset exist in the ECR repository, the oldest one is
297
+ purged.
298
+
299
+ To change the number of revisions stored, use `imageAssetVersionCount`:
300
+
301
+ ```ts
302
+ const app = new App({
303
+ defaultStackSynthesizer: AppStagingSynthesizer.defaultResources({
304
+ appId: 'my-app-id',
305
+ imageAssetVersionCount: 10,
306
+ }),
307
+ });
308
+ ```
309
+
310
+ ## Using a Custom Staging Stack per Environment
311
+
312
+ If you want to customize some behavior that is not configurable via properties,
313
+ you can implement your own class that implements `IStagingResources`. To get a head start,
314
+ you can subclass `DefaultStagingStack`.
315
+
316
+ ```ts
317
+ interface CustomStagingStackOptions extends DefaultStagingStackOptions {}
318
+
319
+ class CustomStagingStack extends DefaultStagingStack {
320
+ }
321
+ ```
322
+
323
+ Or you can roll your own staging resources from scratch, as long as it implements `IStagingResources`.
324
+
325
+ ```ts
326
+ interface CustomStagingStackProps extends StackProps {}
327
+
328
+ class CustomStagingStack extends Stack implements IStagingResources {
329
+ public constructor(scope: Construct, id: string, props: CustomStagingStackProps) {
330
+ super(scope, id, props);
331
+ }
332
+
333
+ public addFile(asset: FileAssetSource): FileStagingLocation {
334
+ return {
335
+ bucketName: 'myBucket',
336
+ assumeRoleArn: 'myArn',
337
+ dependencyStack: this,
338
+ };
339
+ }
340
+
341
+ public addDockerImage(asset: DockerImageAssetSource): ImageStagingLocation {
342
+ return {
343
+ repoName: 'myRepo',
344
+ assumeRoleArn: 'myArn',
345
+ dependencyStack: this,
346
+ };
347
+ }
348
+ }
349
+ ```
350
+
351
+ Using your custom staging resources means implementing a `CustomFactory` class and calling the
352
+ `AppStagingSynthesizer.customFactory()` static method. This has the benefit of providing a
353
+ custom Staging Stack that can be created in every environment the CDK App is deployed to.
354
+
355
+ ```ts fixture=with-custom-staging
356
+ class CustomFactory implements IStagingResourcesFactory {
357
+ public obtainStagingResources(stack: Stack, context: ObtainStagingResourcesContext) {
358
+ const myApp = App.of(stack);
359
+
360
+ return new CustomStagingStack(myApp!, `CustomStagingStack-${context.environmentString}`, {});
361
+ }
362
+ }
363
+
364
+ const app = new App({
365
+ defaultStackSynthesizer: AppStagingSynthesizer.customFactory({
366
+ factory: new CustomFactory(),
367
+ oncePerEnv: true, // by default
368
+ }),
369
+ });
370
+ ```
371
+
372
+ ## Using an Existing Staging Stack
373
+
374
+ Use `AppStagingSynthesizer.customResources()` to supply an existing stack as the Staging Stack.
375
+ Make sure that the custom stack you provide implements `IStagingResources`.
376
+
377
+ ```ts fixture=with-custom-staging
378
+ const resourceApp = new App();
379
+ const resources = new CustomStagingStack(resourceApp, 'CustomStagingStack', {});
380
+
381
+ const app = new App({
382
+ defaultStackSynthesizer: AppStagingSynthesizer.customResources({
383
+ resources,
384
+ }),
385
+ });
386
+ ```
387
+
388
+ ## Known Limitations
389
+
390
+ Since this module is experimental, there are some known limitations:
391
+
392
+ - Currently this module does not support CDK Pipelines. You must deploy CDK Apps using this
393
+ synthesizer via `cdk deploy`.
394
+ - This synthesizer only needs a bootstrap stack with Roles, without staging resources. We
395
+ haven't written such a bootstrap stack yet; at the moment you can use the existing modern
396
+ bootstrap stack, the staging resources in them will just go unused.
397
+ - Due to limitations on the CloudFormation template size, CDK Applications can have
398
+ at most 38 independent ECR images.
399
+ - When you run `cdk destroy` (for example during testing), the staging bucket and ECR
400
+ repositories will be left behind because CloudFormation cannot clean up non-empty resources.
401
+ You must deploy those resources manually if you want to redeploy again using the same `appId`.
@@ -0,0 +1,30 @@
1
+ # Staging Stack Resource Names
2
+
3
+ The Staging Stack can produce the following types of resources, depending on what is needed for the app:
4
+
5
+ - iam role (file publishing role and asset publishing role)
6
+ - s3 bucket (one per app)
7
+ - ecr repository (one per image asset family)
8
+
9
+ These resources need to be named unique to their scope to avoid CloudFormation errors when trying to create
10
+ a resource with an existing name. The resource specific limitations are as follows:
11
+
12
+ - iam role names: must be unique to their account
13
+ - s3 bucket names: must be globally unique
14
+ - ecr repository names: must be unique to their account/region
15
+
16
+ The attributes we can use to name our resources are as follows:
17
+
18
+ - account number (i.e. `123456789012`)
19
+ - region name (i.e. `us-east-1`)
20
+ - app id (a user-specified id that should be unique to the app)
21
+ - image id (a user-specified id added on image assets)
22
+
23
+ This information can be distilled into the following table, which shows what identifiers are necessary to
24
+ make each resource name unique:
25
+
26
+ | Resource | Account | Region | App Id | Image Id |
27
+ | --------- | ------- | ------ | ------ | -------- |
28
+ | iam roles | | ✔️ | ✔️ | |
29
+ | s3 bucket | ✔️ | ✔️ | ✔️ ️️ | |
30
+ | ecr repos | | | ✔️ | ✔️ |
package/jest.config.js ADDED
@@ -0,0 +1,4 @@
1
+ const baseConfig = require('@aws-cdk/cdk-build-tools/config/jest.config');
2
+ module.exports = {
3
+ ...baseConfig,
4
+ };
@@ -0,0 +1,125 @@
1
+ import { DockerImageAssetLocation, DockerImageAssetSource, FileAssetLocation, FileAssetSource, IBoundStackSynthesizer as IBoundAppStagingSynthesizer, IReusableStackSynthesizer, ISynthesisSession, Stack, StackSynthesizer } from 'aws-cdk-lib';
2
+ import { DeploymentIdentities } from './bootstrap-roles';
3
+ import { DefaultStagingStackOptions } from './default-staging-stack';
4
+ import { IStagingResources, IStagingResourcesFactory } from './staging-stack';
5
+ /**
6
+ * Options that apply to all AppStagingSynthesizer variants
7
+ */
8
+ export interface AppStagingSynthesizerOptions {
9
+ /**
10
+ * What roles to use to deploy applications
11
+ *
12
+ * These are the roles that have permissions to interact with CloudFormation
13
+ * on your behalf. By default these are the standard bootstrapped CDK roles,
14
+ * but you can customize them or turn them off and use the CLI credentials
15
+ * to deploy.
16
+ *
17
+ * @default - The standard bootstrapped CDK roles
18
+ */
19
+ readonly deploymentIdentities?: DeploymentIdentities;
20
+ /**
21
+ * Qualifier to disambiguate multiple bootstrapped environments in the same account
22
+ *
23
+ * This qualifier is only used to reference bootstrapped resources. It will not
24
+ * be used in the creation of app-specific staging resources: `appId` is used for that
25
+ * instead.
26
+ *
27
+ * @default - Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise `DEFAULT_QUALIFIER`
28
+ */
29
+ readonly bootstrapQualifier?: string;
30
+ }
31
+ /**
32
+ * Properties for stackPerEnv static method
33
+ */
34
+ export interface DefaultResourcesOptions extends AppStagingSynthesizerOptions, DefaultStagingStackOptions {
35
+ }
36
+ /**
37
+ * Properties for customFactory static method
38
+ */
39
+ export interface CustomFactoryOptions extends AppStagingSynthesizerOptions {
40
+ /**
41
+ * The factory that will be used to return staging resources for each stack
42
+ */
43
+ readonly factory: IStagingResourcesFactory;
44
+ /**
45
+ * Reuse the answer from the factory for stacks in the same environment
46
+ *
47
+ * @default true
48
+ */
49
+ readonly oncePerEnv?: boolean;
50
+ }
51
+ /**
52
+ * Properties for customResources static method
53
+ */
54
+ export interface CustomResourcesOptions extends AppStagingSynthesizerOptions {
55
+ /**
56
+ * Use these exact staging resources for every stack that this synthesizer is used for
57
+ */
58
+ readonly resources: IStagingResources;
59
+ }
60
+ /**
61
+ * App Staging Synthesizer
62
+ */
63
+ export declare class AppStagingSynthesizer extends StackSynthesizer implements IReusableStackSynthesizer {
64
+ private readonly props;
65
+ /**
66
+ * Default ARN qualifier
67
+ */
68
+ static readonly DEFAULT_QUALIFIER = "hnb659fds";
69
+ /**
70
+ * Default CloudFormation role ARN.
71
+ */
72
+ static readonly DEFAULT_CLOUDFORMATION_ROLE_ARN = "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${Qualifier}-cfn-exec-role-${AWS::AccountId}-${AWS::Region}";
73
+ /**
74
+ * Default deploy role ARN.
75
+ */
76
+ static readonly DEFAULT_DEPLOY_ROLE_ARN = "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${Qualifier}-deploy-role-${AWS::AccountId}-${AWS::Region}";
77
+ /**
78
+ * Default lookup role ARN for missing values.
79
+ */
80
+ static readonly DEFAULT_LOOKUP_ROLE_ARN = "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-${Qualifier}-lookup-role-${AWS::AccountId}-${AWS::Region}";
81
+ /**
82
+ * Use the Default Staging Resources, creating a single stack per environment this app is deployed in
83
+ */
84
+ static defaultResources(options: DefaultResourcesOptions): AppStagingSynthesizer;
85
+ /**
86
+ * Use these exact staging resources for every stack that this synthesizer is used for
87
+ */
88
+ static customResources(options: CustomResourcesOptions): AppStagingSynthesizer;
89
+ /**
90
+ * Supply your own stagingStackFactory method for creating an IStagingStack when
91
+ * a stack is bound to the synthesizer.
92
+ *
93
+ * By default, `oncePerEnv = true`, which means that a new instance of the IStagingStack
94
+ * will be created in new environments. Set `oncePerEnv = false` to turn off that behavior.
95
+ */
96
+ static customFactory(options: CustomFactoryOptions): AppStagingSynthesizer;
97
+ private readonly roles;
98
+ private constructor();
99
+ /**
100
+ * Returns a version of the synthesizer bound to a stack.
101
+ */
102
+ reusableBind(stack: Stack): IBoundAppStagingSynthesizer;
103
+ /**
104
+ * Implemented for legacy purposes; this will never be called.
105
+ */
106
+ bind(_stack: Stack): void;
107
+ /**
108
+ * Implemented for legacy purposes; this will never be called.
109
+ */
110
+ synthesize(_session: ISynthesisSession): void;
111
+ /**
112
+ * Implemented for legacy purposes; this will never be called.
113
+ */
114
+ addFileAsset(_asset: FileAssetSource): FileAssetLocation;
115
+ /**
116
+ * Implemented for legacy purposes; this will never be called.
117
+ */
118
+ addDockerImageAsset(_asset: DockerImageAssetSource): DockerImageAssetLocation;
119
+ /**
120
+ * Check that we're only being used for exclusively gnostic or agnostic stacks.
121
+ *
122
+ * We can think about whether to loosen this requirement later.
123
+ */
124
+ private checkEnvironmentGnosticism;
125
+ }