aws-cdk.app-staging-synthesizer-alpha 2.127.0a0__py3-none-any.whl → 2.128.0a0__py3-none-any.whl

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.

Potentially problematic release.


This version of aws-cdk.app-staging-synthesizer-alpha might be problematic. Click here for more details.

@@ -32,9 +32,13 @@ are as follows:
32
32
  To get started, update your CDK App with a new `defaultStackSynthesizer`:
33
33
 
34
34
  ```python
35
+ from aws_cdk.aws_s3 import BucketEncryption
36
+
37
+
35
38
  app = App(
36
39
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
37
- app_id="my-app-id"
40
+ app_id="my-app-id", # put a unique id here
41
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED
38
42
  )
39
43
  )
40
44
  ```
@@ -94,9 +98,13 @@ synthesizer will create a new Staging Stack in each environment the CDK App is d
94
98
  its staging resources. To use this kind of synthesizer, use `AppStagingSynthesizer.defaultResources()`.
95
99
 
96
100
  ```python
101
+ from aws_cdk.aws_s3 import BucketEncryption
102
+
103
+
97
104
  app = App(
98
105
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
99
106
  app_id="my-app-id",
107
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
100
108
 
101
109
  # The following line is optional. By default it is assumed you have bootstrapped in the same
102
110
  # region(s) as the stack(s) you are deploying.
@@ -117,8 +125,14 @@ source code. As part of the `DefaultStagingStack`, an S3 bucket and IAM role wil
117
125
  used to upload the asset to S3.
118
126
 
119
127
  ```python
128
+ from aws_cdk.aws_s3 import BucketEncryption
129
+
130
+
120
131
  app = App(
121
- default_stack_synthesizer=AppStagingSynthesizer.default_resources(app_id="my-app-id")
132
+ default_stack_synthesizer=AppStagingSynthesizer.default_resources(
133
+ app_id="my-app-id",
134
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED
135
+ )
122
136
  )
123
137
 
124
138
  stack = Stack(app, "my-stack")
@@ -138,9 +152,13 @@ You can customize some or all of the roles you'd like to use in the synthesizer
138
152
  if all you need is to supply custom roles (and not change anything else in the `DefaultStagingStack`):
139
153
 
140
154
  ```python
155
+ from aws_cdk.aws_s3 import BucketEncryption
156
+
157
+
141
158
  app = App(
142
159
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
143
160
  app_id="my-app-id",
161
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
144
162
  deployment_identities=DeploymentIdentities.specify_roles(
145
163
  cloud_formation_execution_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Execute"),
146
164
  deployment_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Deploy"),
@@ -158,9 +176,13 @@ and `CloudFormationExecutionRole` in the
158
176
  [bootstrap template](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml).
159
177
 
160
178
  ```python
179
+ from aws_cdk.aws_s3 import BucketEncryption
180
+
181
+
161
182
  app = App(
162
183
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
163
184
  app_id="my-app-id",
185
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
164
186
  deployment_identities=DeploymentIdentities.cli_credentials()
165
187
  )
166
188
  )
@@ -171,9 +193,13 @@ assumable by the deployment role. You can also specify an existing IAM role for
171
193
  `fileAssetPublishingRole` or `imageAssetPublishingRole`:
172
194
 
173
195
  ```python
196
+ from aws_cdk.aws_s3 import BucketEncryption
197
+
198
+
174
199
  app = App(
175
200
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
176
201
  app_id="my-app-id",
202
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
177
203
  file_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/S3Access"),
178
204
  image_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/ECRAccess")
179
205
  )
@@ -225,9 +251,13 @@ to a previous version of an application just by doing a CloudFormation deploymen
225
251
  template, without rebuilding and republishing assets.
226
252
 
227
253
  ```python
254
+ from aws_cdk.aws_s3 import BucketEncryption
255
+
256
+
228
257
  app = App(
229
258
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
230
259
  app_id="my-app-id",
260
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
231
261
  deploy_time_file_asset_lifetime=Duration.days(100)
232
262
  )
233
263
  )
@@ -243,9 +273,13 @@ purged.
243
273
  To change the number of revisions stored, use `imageAssetVersionCount`:
244
274
 
245
275
  ```python
276
+ from aws_cdk.aws_s3 import BucketEncryption
277
+
278
+
246
279
  app = App(
247
280
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
248
281
  app_id="my-app-id",
282
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
249
283
  image_asset_version_count=10
250
284
  )
251
285
  )
@@ -259,9 +293,13 @@ or `emptyOnDelete` turned on. This creates custom resources under the hood to fa
259
293
  cleanup. To turn this off, specify `autoDeleteStagingAssets: false`.
260
294
 
261
295
  ```python
296
+ from aws_cdk.aws_s3 import BucketEncryption
297
+
298
+
262
299
  app = App(
263
300
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
264
301
  app_id="my-app-id",
302
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
265
303
  auto_delete_staging_assets=False
266
304
  )
267
305
  )
@@ -269,20 +307,20 @@ app = App(
269
307
 
270
308
  ### Staging Bucket Encryption
271
309
 
272
- By default, the staging resources will be stored in an S3 Bucket with KMS encryption. To use
273
- SSE-S3, set `stagingBucketEncryption` to `BucketEncryption.S3_MANAGED`.
310
+ You must explicitly specify the encryption type for the staging bucket via the `stagingBucketEncryption` property. In
311
+ future versions of this package, the default will be `BucketEncryption.S3_MANAGED`.
274
312
 
275
- ```python
276
- from aws_cdk.aws_s3 import BucketEncryption
313
+ In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost
314
+ $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module
315
+ we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3
316
+ managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.
277
317
 
318
+ If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to
319
+ `BucketEncryption.KMS`. If you are creating a new staging bucket, you can set this property to
320
+ `BucketEncryption.S3_MANAGED` to avoid the cost of a KMS key.
278
321
 
279
- app = App(
280
- default_stack_synthesizer=AppStagingSynthesizer.default_resources(
281
- app_id="my-app-id",
282
- staging_bucket_encryption=BucketEncryption.S3_MANAGED
283
- )
284
- )
285
- ```
322
+ You can learn more about choosing a bucket encryption type in the
323
+ [S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html).
286
324
 
287
325
  ## Using a Custom Staging Stack per Environment
288
326
 
@@ -483,12 +521,12 @@ class AppStagingSynthesizer(
483
521
  bootstrap_qualifier: typing.Optional[builtins.str] = None,
484
522
  deployment_identities: typing.Optional["DeploymentIdentities"] = None,
485
523
  app_id: builtins.str,
524
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
486
525
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
487
526
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
488
527
  file_asset_publishing_role: typing.Optional["BootstrapRole"] = None,
489
528
  image_asset_publishing_role: typing.Optional["BootstrapRole"] = None,
490
529
  image_asset_version_count: typing.Optional[jsii.Number] = None,
491
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
492
530
  staging_bucket_name: typing.Optional[builtins.str] = None,
493
531
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
494
532
  ) -> "AppStagingSynthesizer":
@@ -497,12 +535,12 @@ class AppStagingSynthesizer(
497
535
  :param bootstrap_qualifier: (experimental) Qualifier to disambiguate multiple bootstrapped environments in the same account. This qualifier is only used to reference bootstrapped resources. It will not be used in the creation of app-specific staging resources: ``appId`` is used for that instead. Default: - Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise ``DEFAULT_QUALIFIER``
498
536
  :param deployment_identities: (experimental) What roles to use to deploy applications. These are the roles that have permissions to interact with CloudFormation on your behalf. By default these are the standard bootstrapped CDK roles, but you can customize them or turn them off and use the CLI credentials to deploy. Default: - The standard bootstrapped CDK roles
499
537
  :param app_id: (experimental) A unique identifier for the application that the staging stack belongs to. This identifier will be used in the name of staging resources created for this application, and should be unique across CDK apps. The identifier should include lowercase characters and dashes ('-') only and have a maximum of 20 characters.
538
+ :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. In future versions of this package, the default will be BucketEncryption.S3_MANAGED. In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3 managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required. If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
500
539
  :param auto_delete_staging_assets: (experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories. Default: true
501
540
  :param deploy_time_file_asset_lifetime: (experimental) The lifetime for deploy time file assets. Assets that are only necessary at deployment time (for instance, CloudFormation templates and Lambda source code bundles) will be automatically deleted after this many days. Assets that may be read from the staging bucket during your application's run time will not be deleted. Set this to the length of time you wish to be able to roll back to previous versions of your application without having to do a new ``cdk synth`` and re-upload of assets. Default: - Duration.days(30)
502
541
  :param file_asset_publishing_role: (experimental) Pass in an existing role to be used as the file publishing role. Default: - a new role will be created
503
542
  :param image_asset_publishing_role: (experimental) Pass in an existing role to be used as the image publishing role. Default: - a new role will be created
504
543
  :param image_asset_version_count: (experimental) The maximum number of image versions to store in a repository. Previous versions of an image can be stored for rollback purposes. Once a repository has more than 3 image versions stored, the oldest version will be discarded. This allows for sensible garbage collection while maintaining a few previous versions for rollback scenarios. Default: - up to 3 versions stored
505
- :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. Default: - s3.BucketEncryption.KMS
506
544
  :param staging_bucket_name: (experimental) Explicit name for the staging bucket. Default: - a well-known name unique to this app/env.
507
545
  :param staging_stack_name_prefix: (experimental) Specify a custom prefix to be used as the staging stack name and construct ID. The prefix will be appended before the appId, which is required to be part of the stack name and construct ID to ensure uniqueness. Default: 'StagingStack'
508
546
 
@@ -512,12 +550,12 @@ class AppStagingSynthesizer(
512
550
  bootstrap_qualifier=bootstrap_qualifier,
513
551
  deployment_identities=deployment_identities,
514
552
  app_id=app_id,
553
+ staging_bucket_encryption=staging_bucket_encryption,
515
554
  auto_delete_staging_assets=auto_delete_staging_assets,
516
555
  deploy_time_file_asset_lifetime=deploy_time_file_asset_lifetime,
517
556
  file_asset_publishing_role=file_asset_publishing_role,
518
557
  image_asset_publishing_role=image_asset_publishing_role,
519
558
  image_asset_version_count=image_asset_version_count,
520
- staging_bucket_encryption=staging_bucket_encryption,
521
559
  staging_bucket_name=staging_bucket_name,
522
560
  staging_stack_name_prefix=staging_stack_name_prefix,
523
561
  )
@@ -804,9 +842,13 @@ class BootstrapRole(
804
842
 
805
843
  Example::
806
844
 
845
+ from aws_cdk.aws_s3 import BucketEncryption
846
+
847
+
807
848
  app = App(
808
849
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
809
850
  app_id="my-app-id",
851
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
810
852
  deployment_identities=DeploymentIdentities.specify_roles(
811
853
  cloud_formation_execution_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Execute"),
812
854
  deployment_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Deploy"),
@@ -876,9 +918,13 @@ class BootstrapRoles:
876
918
 
877
919
  Example::
878
920
 
921
+ from aws_cdk.aws_s3 import BucketEncryption
922
+
923
+
879
924
  app = App(
880
925
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
881
926
  app_id="my-app-id",
927
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
882
928
  deployment_identities=DeploymentIdentities.specify_roles(
883
929
  cloud_formation_execution_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Execute"),
884
930
  deployment_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Deploy"),
@@ -1193,9 +1239,13 @@ class DefaultBootstrapRolesOptions:
1193
1239
 
1194
1240
  Example::
1195
1241
 
1242
+ from aws_cdk.aws_s3 import BucketEncryption
1243
+
1244
+
1196
1245
  app = App(
1197
1246
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
1198
1247
  app_id="my-app-id",
1248
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
1199
1249
 
1200
1250
  # The following line is optional. By default it is assumed you have bootstrapped in the same
1201
1251
  # region(s) as the stack(s) you are deploying.
@@ -1240,12 +1290,12 @@ class DefaultBootstrapRolesOptions:
1240
1290
  jsii_struct_bases=[],
1241
1291
  name_mapping={
1242
1292
  "app_id": "appId",
1293
+ "staging_bucket_encryption": "stagingBucketEncryption",
1243
1294
  "auto_delete_staging_assets": "autoDeleteStagingAssets",
1244
1295
  "deploy_time_file_asset_lifetime": "deployTimeFileAssetLifetime",
1245
1296
  "file_asset_publishing_role": "fileAssetPublishingRole",
1246
1297
  "image_asset_publishing_role": "imageAssetPublishingRole",
1247
1298
  "image_asset_version_count": "imageAssetVersionCount",
1248
- "staging_bucket_encryption": "stagingBucketEncryption",
1249
1299
  "staging_bucket_name": "stagingBucketName",
1250
1300
  "staging_stack_name_prefix": "stagingStackNamePrefix",
1251
1301
  },
@@ -1255,24 +1305,24 @@ class DefaultStagingStackOptions:
1255
1305
  self,
1256
1306
  *,
1257
1307
  app_id: builtins.str,
1308
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
1258
1309
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
1259
1310
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
1260
1311
  file_asset_publishing_role: typing.Optional[BootstrapRole] = None,
1261
1312
  image_asset_publishing_role: typing.Optional[BootstrapRole] = None,
1262
1313
  image_asset_version_count: typing.Optional[jsii.Number] = None,
1263
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
1264
1314
  staging_bucket_name: typing.Optional[builtins.str] = None,
1265
1315
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
1266
1316
  ) -> None:
1267
1317
  '''(experimental) User configurable options to the DefaultStagingStack.
1268
1318
 
1269
1319
  :param app_id: (experimental) A unique identifier for the application that the staging stack belongs to. This identifier will be used in the name of staging resources created for this application, and should be unique across CDK apps. The identifier should include lowercase characters and dashes ('-') only and have a maximum of 20 characters.
1320
+ :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. In future versions of this package, the default will be BucketEncryption.S3_MANAGED. In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3 managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required. If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
1270
1321
  :param auto_delete_staging_assets: (experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories. Default: true
1271
1322
  :param deploy_time_file_asset_lifetime: (experimental) The lifetime for deploy time file assets. Assets that are only necessary at deployment time (for instance, CloudFormation templates and Lambda source code bundles) will be automatically deleted after this many days. Assets that may be read from the staging bucket during your application's run time will not be deleted. Set this to the length of time you wish to be able to roll back to previous versions of your application without having to do a new ``cdk synth`` and re-upload of assets. Default: - Duration.days(30)
1272
1323
  :param file_asset_publishing_role: (experimental) Pass in an existing role to be used as the file publishing role. Default: - a new role will be created
1273
1324
  :param image_asset_publishing_role: (experimental) Pass in an existing role to be used as the image publishing role. Default: - a new role will be created
1274
1325
  :param image_asset_version_count: (experimental) The maximum number of image versions to store in a repository. Previous versions of an image can be stored for rollback purposes. Once a repository has more than 3 image versions stored, the oldest version will be discarded. This allows for sensible garbage collection while maintaining a few previous versions for rollback scenarios. Default: - up to 3 versions stored
1275
- :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. Default: - s3.BucketEncryption.KMS
1276
1326
  :param staging_bucket_name: (experimental) Explicit name for the staging bucket. Default: - a well-known name unique to this app/env.
1277
1327
  :param staging_stack_name_prefix: (experimental) Specify a custom prefix to be used as the staging stack name and construct ID. The prefix will be appended before the appId, which is required to be part of the stack name and construct ID to ensure uniqueness. Default: 'StagingStack'
1278
1328
 
@@ -1281,21 +1331,24 @@ class DefaultStagingStackOptions:
1281
1331
 
1282
1332
  Example::
1283
1333
 
1284
- default_staging_stack = DefaultStagingStack.factory(app_id="my-app-id")
1334
+ from aws_cdk.aws_s3 import BucketEncryption
1335
+
1336
+ default_staging_stack = DefaultStagingStack.factory(app_id="my-app-id", staging_bucket_encryption=BucketEncryption.S3_MANAGED)
1285
1337
  '''
1286
1338
  if __debug__:
1287
1339
  type_hints = typing.get_type_hints(_typecheckingstub__09dbc6ce5bcfd58fa48337caac574e10727d4bf9a43dc89866fbe7541b026219)
1288
1340
  check_type(argname="argument app_id", value=app_id, expected_type=type_hints["app_id"])
1341
+ check_type(argname="argument staging_bucket_encryption", value=staging_bucket_encryption, expected_type=type_hints["staging_bucket_encryption"])
1289
1342
  check_type(argname="argument auto_delete_staging_assets", value=auto_delete_staging_assets, expected_type=type_hints["auto_delete_staging_assets"])
1290
1343
  check_type(argname="argument deploy_time_file_asset_lifetime", value=deploy_time_file_asset_lifetime, expected_type=type_hints["deploy_time_file_asset_lifetime"])
1291
1344
  check_type(argname="argument file_asset_publishing_role", value=file_asset_publishing_role, expected_type=type_hints["file_asset_publishing_role"])
1292
1345
  check_type(argname="argument image_asset_publishing_role", value=image_asset_publishing_role, expected_type=type_hints["image_asset_publishing_role"])
1293
1346
  check_type(argname="argument image_asset_version_count", value=image_asset_version_count, expected_type=type_hints["image_asset_version_count"])
1294
- check_type(argname="argument staging_bucket_encryption", value=staging_bucket_encryption, expected_type=type_hints["staging_bucket_encryption"])
1295
1347
  check_type(argname="argument staging_bucket_name", value=staging_bucket_name, expected_type=type_hints["staging_bucket_name"])
1296
1348
  check_type(argname="argument staging_stack_name_prefix", value=staging_stack_name_prefix, expected_type=type_hints["staging_stack_name_prefix"])
1297
1349
  self._values: typing.Dict[builtins.str, typing.Any] = {
1298
1350
  "app_id": app_id,
1351
+ "staging_bucket_encryption": staging_bucket_encryption,
1299
1352
  }
1300
1353
  if auto_delete_staging_assets is not None:
1301
1354
  self._values["auto_delete_staging_assets"] = auto_delete_staging_assets
@@ -1307,8 +1360,6 @@ class DefaultStagingStackOptions:
1307
1360
  self._values["image_asset_publishing_role"] = image_asset_publishing_role
1308
1361
  if image_asset_version_count is not None:
1309
1362
  self._values["image_asset_version_count"] = image_asset_version_count
1310
- if staging_bucket_encryption is not None:
1311
- self._values["staging_bucket_encryption"] = staging_bucket_encryption
1312
1363
  if staging_bucket_name is not None:
1313
1364
  self._values["staging_bucket_name"] = staging_bucket_name
1314
1365
  if staging_stack_name_prefix is not None:
@@ -1330,6 +1381,27 @@ class DefaultStagingStackOptions:
1330
1381
  assert result is not None, "Required property 'app_id' is missing"
1331
1382
  return typing.cast(builtins.str, result)
1332
1383
 
1384
+ @builtins.property
1385
+ def staging_bucket_encryption(self) -> _aws_cdk_aws_s3_ceddda9d.BucketEncryption:
1386
+ '''(experimental) Encryption type for staging bucket.
1387
+
1388
+ In future versions of this package, the default will be BucketEncryption.S3_MANAGED.
1389
+
1390
+ In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost
1391
+ $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module
1392
+ we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3
1393
+ managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.
1394
+
1395
+ If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to
1396
+ BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to
1397
+ BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
1398
+
1399
+ :stability: experimental
1400
+ '''
1401
+ result = self._values.get("staging_bucket_encryption")
1402
+ assert result is not None, "Required property 'staging_bucket_encryption' is missing"
1403
+ return typing.cast(_aws_cdk_aws_s3_ceddda9d.BucketEncryption, result)
1404
+
1333
1405
  @builtins.property
1334
1406
  def auto_delete_staging_assets(self) -> typing.Optional[builtins.bool]:
1335
1407
  '''(experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories.
@@ -1402,19 +1474,6 @@ class DefaultStagingStackOptions:
1402
1474
  result = self._values.get("image_asset_version_count")
1403
1475
  return typing.cast(typing.Optional[jsii.Number], result)
1404
1476
 
1405
- @builtins.property
1406
- def staging_bucket_encryption(
1407
- self,
1408
- ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption]:
1409
- '''(experimental) Encryption type for staging bucket.
1410
-
1411
- :default: - s3.BucketEncryption.KMS
1412
-
1413
- :stability: experimental
1414
- '''
1415
- result = self._values.get("staging_bucket_encryption")
1416
- return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption], result)
1417
-
1418
1477
  @builtins.property
1419
1478
  def staging_bucket_name(self) -> typing.Optional[builtins.str]:
1420
1479
  '''(experimental) Explicit name for the staging bucket.
@@ -1458,12 +1517,12 @@ class DefaultStagingStackOptions:
1458
1517
  jsii_struct_bases=[DefaultStagingStackOptions, _aws_cdk_ceddda9d.StackProps],
1459
1518
  name_mapping={
1460
1519
  "app_id": "appId",
1520
+ "staging_bucket_encryption": "stagingBucketEncryption",
1461
1521
  "auto_delete_staging_assets": "autoDeleteStagingAssets",
1462
1522
  "deploy_time_file_asset_lifetime": "deployTimeFileAssetLifetime",
1463
1523
  "file_asset_publishing_role": "fileAssetPublishingRole",
1464
1524
  "image_asset_publishing_role": "imageAssetPublishingRole",
1465
1525
  "image_asset_version_count": "imageAssetVersionCount",
1466
- "staging_bucket_encryption": "stagingBucketEncryption",
1467
1526
  "staging_bucket_name": "stagingBucketName",
1468
1527
  "staging_stack_name_prefix": "stagingStackNamePrefix",
1469
1528
  "analytics_reporting": "analyticsReporting",
@@ -1488,12 +1547,12 @@ class DefaultStagingStackProps(
1488
1547
  self,
1489
1548
  *,
1490
1549
  app_id: builtins.str,
1550
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
1491
1551
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
1492
1552
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
1493
1553
  file_asset_publishing_role: typing.Optional[BootstrapRole] = None,
1494
1554
  image_asset_publishing_role: typing.Optional[BootstrapRole] = None,
1495
1555
  image_asset_version_count: typing.Optional[jsii.Number] = None,
1496
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
1497
1556
  staging_bucket_name: typing.Optional[builtins.str] = None,
1498
1557
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
1499
1558
  analytics_reporting: typing.Optional[builtins.bool] = None,
@@ -1512,12 +1571,12 @@ class DefaultStagingStackProps(
1512
1571
  '''(experimental) Default Staging Stack Properties.
1513
1572
 
1514
1573
  :param app_id: (experimental) A unique identifier for the application that the staging stack belongs to. This identifier will be used in the name of staging resources created for this application, and should be unique across CDK apps. The identifier should include lowercase characters and dashes ('-') only and have a maximum of 20 characters.
1574
+ :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. In future versions of this package, the default will be BucketEncryption.S3_MANAGED. In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3 managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required. If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
1515
1575
  :param auto_delete_staging_assets: (experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories. Default: true
1516
1576
  :param deploy_time_file_asset_lifetime: (experimental) The lifetime for deploy time file assets. Assets that are only necessary at deployment time (for instance, CloudFormation templates and Lambda source code bundles) will be automatically deleted after this many days. Assets that may be read from the staging bucket during your application's run time will not be deleted. Set this to the length of time you wish to be able to roll back to previous versions of your application without having to do a new ``cdk synth`` and re-upload of assets. Default: - Duration.days(30)
1517
1577
  :param file_asset_publishing_role: (experimental) Pass in an existing role to be used as the file publishing role. Default: - a new role will be created
1518
1578
  :param image_asset_publishing_role: (experimental) Pass in an existing role to be used as the image publishing role. Default: - a new role will be created
1519
1579
  :param image_asset_version_count: (experimental) The maximum number of image versions to store in a repository. Previous versions of an image can be stored for rollback purposes. Once a repository has more than 3 image versions stored, the oldest version will be discarded. This allows for sensible garbage collection while maintaining a few previous versions for rollback scenarios. Default: - up to 3 versions stored
1520
- :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. Default: - s3.BucketEncryption.KMS
1521
1580
  :param staging_bucket_name: (experimental) Explicit name for the staging bucket. Default: - a well-known name unique to this app/env.
1522
1581
  :param staging_stack_name_prefix: (experimental) Specify a custom prefix to be used as the staging stack name and construct ID. The prefix will be appended before the appId, which is required to be part of the stack name and construct ID to ensure uniqueness. Default: 'StagingStack'
1523
1582
  :param analytics_reporting: Include runtime versioning information in this Stack. Default: ``analyticsReporting`` setting of containing ``App``, or value of 'aws:cdk:version-reporting' context key
@@ -1551,6 +1610,7 @@ class DefaultStagingStackProps(
1551
1610
  default_staging_stack_props = app_staging_synthesizer_alpha.DefaultStagingStackProps(
1552
1611
  app_id="appId",
1553
1612
  qualifier="qualifier",
1613
+ staging_bucket_encryption=s3.BucketEncryption.UNENCRYPTED,
1554
1614
 
1555
1615
  # the properties below are optional
1556
1616
  analytics_reporting=False,
@@ -1568,7 +1628,6 @@ class DefaultStagingStackProps(
1568
1628
  image_asset_version_count=123,
1569
1629
  permissions_boundary=permissions_boundary,
1570
1630
  stack_name="stackName",
1571
- staging_bucket_encryption=s3.BucketEncryption.UNENCRYPTED,
1572
1631
  staging_bucket_name="stagingBucketName",
1573
1632
  staging_stack_name_prefix="stagingStackNamePrefix",
1574
1633
  suppress_template_indentation=False,
@@ -1584,12 +1643,12 @@ class DefaultStagingStackProps(
1584
1643
  if __debug__:
1585
1644
  type_hints = typing.get_type_hints(_typecheckingstub__ac9f132bcac8375ac08c16bf3c9bb7407b641e71cfd23cea8b50befa3cf79bbf)
1586
1645
  check_type(argname="argument app_id", value=app_id, expected_type=type_hints["app_id"])
1646
+ check_type(argname="argument staging_bucket_encryption", value=staging_bucket_encryption, expected_type=type_hints["staging_bucket_encryption"])
1587
1647
  check_type(argname="argument auto_delete_staging_assets", value=auto_delete_staging_assets, expected_type=type_hints["auto_delete_staging_assets"])
1588
1648
  check_type(argname="argument deploy_time_file_asset_lifetime", value=deploy_time_file_asset_lifetime, expected_type=type_hints["deploy_time_file_asset_lifetime"])
1589
1649
  check_type(argname="argument file_asset_publishing_role", value=file_asset_publishing_role, expected_type=type_hints["file_asset_publishing_role"])
1590
1650
  check_type(argname="argument image_asset_publishing_role", value=image_asset_publishing_role, expected_type=type_hints["image_asset_publishing_role"])
1591
1651
  check_type(argname="argument image_asset_version_count", value=image_asset_version_count, expected_type=type_hints["image_asset_version_count"])
1592
- check_type(argname="argument staging_bucket_encryption", value=staging_bucket_encryption, expected_type=type_hints["staging_bucket_encryption"])
1593
1652
  check_type(argname="argument staging_bucket_name", value=staging_bucket_name, expected_type=type_hints["staging_bucket_name"])
1594
1653
  check_type(argname="argument staging_stack_name_prefix", value=staging_stack_name_prefix, expected_type=type_hints["staging_stack_name_prefix"])
1595
1654
  check_type(argname="argument analytics_reporting", value=analytics_reporting, expected_type=type_hints["analytics_reporting"])
@@ -1606,6 +1665,7 @@ class DefaultStagingStackProps(
1606
1665
  check_type(argname="argument deploy_role_arn", value=deploy_role_arn, expected_type=type_hints["deploy_role_arn"])
1607
1666
  self._values: typing.Dict[builtins.str, typing.Any] = {
1608
1667
  "app_id": app_id,
1668
+ "staging_bucket_encryption": staging_bucket_encryption,
1609
1669
  "qualifier": qualifier,
1610
1670
  }
1611
1671
  if auto_delete_staging_assets is not None:
@@ -1618,8 +1678,6 @@ class DefaultStagingStackProps(
1618
1678
  self._values["image_asset_publishing_role"] = image_asset_publishing_role
1619
1679
  if image_asset_version_count is not None:
1620
1680
  self._values["image_asset_version_count"] = image_asset_version_count
1621
- if staging_bucket_encryption is not None:
1622
- self._values["staging_bucket_encryption"] = staging_bucket_encryption
1623
1681
  if staging_bucket_name is not None:
1624
1682
  self._values["staging_bucket_name"] = staging_bucket_name
1625
1683
  if staging_stack_name_prefix is not None:
@@ -1663,6 +1721,27 @@ class DefaultStagingStackProps(
1663
1721
  assert result is not None, "Required property 'app_id' is missing"
1664
1722
  return typing.cast(builtins.str, result)
1665
1723
 
1724
+ @builtins.property
1725
+ def staging_bucket_encryption(self) -> _aws_cdk_aws_s3_ceddda9d.BucketEncryption:
1726
+ '''(experimental) Encryption type for staging bucket.
1727
+
1728
+ In future versions of this package, the default will be BucketEncryption.S3_MANAGED.
1729
+
1730
+ In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost
1731
+ $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module
1732
+ we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3
1733
+ managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.
1734
+
1735
+ If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to
1736
+ BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to
1737
+ BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
1738
+
1739
+ :stability: experimental
1740
+ '''
1741
+ result = self._values.get("staging_bucket_encryption")
1742
+ assert result is not None, "Required property 'staging_bucket_encryption' is missing"
1743
+ return typing.cast(_aws_cdk_aws_s3_ceddda9d.BucketEncryption, result)
1744
+
1666
1745
  @builtins.property
1667
1746
  def auto_delete_staging_assets(self) -> typing.Optional[builtins.bool]:
1668
1747
  '''(experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories.
@@ -1735,19 +1814,6 @@ class DefaultStagingStackProps(
1735
1814
  result = self._values.get("image_asset_version_count")
1736
1815
  return typing.cast(typing.Optional[jsii.Number], result)
1737
1816
 
1738
- @builtins.property
1739
- def staging_bucket_encryption(
1740
- self,
1741
- ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption]:
1742
- '''(experimental) Encryption type for staging bucket.
1743
-
1744
- :default: - s3.BucketEncryption.KMS
1745
-
1746
- :stability: experimental
1747
- '''
1748
- result = self._values.get("staging_bucket_encryption")
1749
- return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption], result)
1750
-
1751
1817
  @builtins.property
1752
1818
  def staging_bucket_name(self) -> typing.Optional[builtins.str]:
1753
1819
  '''(experimental) Explicit name for the staging bucket.
@@ -1997,9 +2063,13 @@ class DeploymentIdentities(
1997
2063
 
1998
2064
  Example::
1999
2065
 
2066
+ from aws_cdk.aws_s3 import BucketEncryption
2067
+
2068
+
2000
2069
  app = App(
2001
2070
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
2002
2071
  app_id="my-app-id",
2072
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
2003
2073
 
2004
2074
  # The following line is optional. By default it is assumed you have bootstrapped in the same
2005
2075
  # region(s) as the stack(s) you are deploying.
@@ -2802,12 +2872,12 @@ class UsingAppStagingSynthesizer(
2802
2872
  "bootstrap_qualifier": "bootstrapQualifier",
2803
2873
  "deployment_identities": "deploymentIdentities",
2804
2874
  "app_id": "appId",
2875
+ "staging_bucket_encryption": "stagingBucketEncryption",
2805
2876
  "auto_delete_staging_assets": "autoDeleteStagingAssets",
2806
2877
  "deploy_time_file_asset_lifetime": "deployTimeFileAssetLifetime",
2807
2878
  "file_asset_publishing_role": "fileAssetPublishingRole",
2808
2879
  "image_asset_publishing_role": "imageAssetPublishingRole",
2809
2880
  "image_asset_version_count": "imageAssetVersionCount",
2810
- "staging_bucket_encryption": "stagingBucketEncryption",
2811
2881
  "staging_bucket_name": "stagingBucketName",
2812
2882
  "staging_stack_name_prefix": "stagingStackNamePrefix",
2813
2883
  },
@@ -2819,12 +2889,12 @@ class DefaultResourcesOptions(AppStagingSynthesizerOptions, DefaultStagingStackO
2819
2889
  bootstrap_qualifier: typing.Optional[builtins.str] = None,
2820
2890
  deployment_identities: typing.Optional[DeploymentIdentities] = None,
2821
2891
  app_id: builtins.str,
2892
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
2822
2893
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
2823
2894
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
2824
2895
  file_asset_publishing_role: typing.Optional[BootstrapRole] = None,
2825
2896
  image_asset_publishing_role: typing.Optional[BootstrapRole] = None,
2826
2897
  image_asset_version_count: typing.Optional[jsii.Number] = None,
2827
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
2828
2898
  staging_bucket_name: typing.Optional[builtins.str] = None,
2829
2899
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
2830
2900
  ) -> None:
@@ -2833,12 +2903,12 @@ class DefaultResourcesOptions(AppStagingSynthesizerOptions, DefaultStagingStackO
2833
2903
  :param bootstrap_qualifier: (experimental) Qualifier to disambiguate multiple bootstrapped environments in the same account. This qualifier is only used to reference bootstrapped resources. It will not be used in the creation of app-specific staging resources: ``appId`` is used for that instead. Default: - Value of context key '@aws-cdk/core:bootstrapQualifier' if set, otherwise ``DEFAULT_QUALIFIER``
2834
2904
  :param deployment_identities: (experimental) What roles to use to deploy applications. These are the roles that have permissions to interact with CloudFormation on your behalf. By default these are the standard bootstrapped CDK roles, but you can customize them or turn them off and use the CLI credentials to deploy. Default: - The standard bootstrapped CDK roles
2835
2905
  :param app_id: (experimental) A unique identifier for the application that the staging stack belongs to. This identifier will be used in the name of staging resources created for this application, and should be unique across CDK apps. The identifier should include lowercase characters and dashes ('-') only and have a maximum of 20 characters.
2906
+ :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. In future versions of this package, the default will be BucketEncryption.S3_MANAGED. In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3 managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required. If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
2836
2907
  :param auto_delete_staging_assets: (experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories. Default: true
2837
2908
  :param deploy_time_file_asset_lifetime: (experimental) The lifetime for deploy time file assets. Assets that are only necessary at deployment time (for instance, CloudFormation templates and Lambda source code bundles) will be automatically deleted after this many days. Assets that may be read from the staging bucket during your application's run time will not be deleted. Set this to the length of time you wish to be able to roll back to previous versions of your application without having to do a new ``cdk synth`` and re-upload of assets. Default: - Duration.days(30)
2838
2909
  :param file_asset_publishing_role: (experimental) Pass in an existing role to be used as the file publishing role. Default: - a new role will be created
2839
2910
  :param image_asset_publishing_role: (experimental) Pass in an existing role to be used as the image publishing role. Default: - a new role will be created
2840
2911
  :param image_asset_version_count: (experimental) The maximum number of image versions to store in a repository. Previous versions of an image can be stored for rollback purposes. Once a repository has more than 3 image versions stored, the oldest version will be discarded. This allows for sensible garbage collection while maintaining a few previous versions for rollback scenarios. Default: - up to 3 versions stored
2841
- :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. Default: - s3.BucketEncryption.KMS
2842
2912
  :param staging_bucket_name: (experimental) Explicit name for the staging bucket. Default: - a well-known name unique to this app/env.
2843
2913
  :param staging_stack_name_prefix: (experimental) Specify a custom prefix to be used as the staging stack name and construct ID. The prefix will be appended before the appId, which is required to be part of the stack name and construct ID to ensure uniqueness. Default: 'StagingStack'
2844
2914
 
@@ -2847,9 +2917,13 @@ class DefaultResourcesOptions(AppStagingSynthesizerOptions, DefaultStagingStackO
2847
2917
 
2848
2918
  Example::
2849
2919
 
2920
+ from aws_cdk.aws_s3 import BucketEncryption
2921
+
2922
+
2850
2923
  app = App(
2851
2924
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
2852
2925
  app_id="my-app-id",
2926
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
2853
2927
  file_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/S3Access"),
2854
2928
  image_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/ECRAccess")
2855
2929
  )
@@ -2860,16 +2934,17 @@ class DefaultResourcesOptions(AppStagingSynthesizerOptions, DefaultStagingStackO
2860
2934
  check_type(argname="argument bootstrap_qualifier", value=bootstrap_qualifier, expected_type=type_hints["bootstrap_qualifier"])
2861
2935
  check_type(argname="argument deployment_identities", value=deployment_identities, expected_type=type_hints["deployment_identities"])
2862
2936
  check_type(argname="argument app_id", value=app_id, expected_type=type_hints["app_id"])
2937
+ check_type(argname="argument staging_bucket_encryption", value=staging_bucket_encryption, expected_type=type_hints["staging_bucket_encryption"])
2863
2938
  check_type(argname="argument auto_delete_staging_assets", value=auto_delete_staging_assets, expected_type=type_hints["auto_delete_staging_assets"])
2864
2939
  check_type(argname="argument deploy_time_file_asset_lifetime", value=deploy_time_file_asset_lifetime, expected_type=type_hints["deploy_time_file_asset_lifetime"])
2865
2940
  check_type(argname="argument file_asset_publishing_role", value=file_asset_publishing_role, expected_type=type_hints["file_asset_publishing_role"])
2866
2941
  check_type(argname="argument image_asset_publishing_role", value=image_asset_publishing_role, expected_type=type_hints["image_asset_publishing_role"])
2867
2942
  check_type(argname="argument image_asset_version_count", value=image_asset_version_count, expected_type=type_hints["image_asset_version_count"])
2868
- check_type(argname="argument staging_bucket_encryption", value=staging_bucket_encryption, expected_type=type_hints["staging_bucket_encryption"])
2869
2943
  check_type(argname="argument staging_bucket_name", value=staging_bucket_name, expected_type=type_hints["staging_bucket_name"])
2870
2944
  check_type(argname="argument staging_stack_name_prefix", value=staging_stack_name_prefix, expected_type=type_hints["staging_stack_name_prefix"])
2871
2945
  self._values: typing.Dict[builtins.str, typing.Any] = {
2872
2946
  "app_id": app_id,
2947
+ "staging_bucket_encryption": staging_bucket_encryption,
2873
2948
  }
2874
2949
  if bootstrap_qualifier is not None:
2875
2950
  self._values["bootstrap_qualifier"] = bootstrap_qualifier
@@ -2885,8 +2960,6 @@ class DefaultResourcesOptions(AppStagingSynthesizerOptions, DefaultStagingStackO
2885
2960
  self._values["image_asset_publishing_role"] = image_asset_publishing_role
2886
2961
  if image_asset_version_count is not None:
2887
2962
  self._values["image_asset_version_count"] = image_asset_version_count
2888
- if staging_bucket_encryption is not None:
2889
- self._values["staging_bucket_encryption"] = staging_bucket_encryption
2890
2963
  if staging_bucket_name is not None:
2891
2964
  self._values["staging_bucket_name"] = staging_bucket_name
2892
2965
  if staging_stack_name_prefix is not None:
@@ -2939,6 +3012,27 @@ class DefaultResourcesOptions(AppStagingSynthesizerOptions, DefaultStagingStackO
2939
3012
  assert result is not None, "Required property 'app_id' is missing"
2940
3013
  return typing.cast(builtins.str, result)
2941
3014
 
3015
+ @builtins.property
3016
+ def staging_bucket_encryption(self) -> _aws_cdk_aws_s3_ceddda9d.BucketEncryption:
3017
+ '''(experimental) Encryption type for staging bucket.
3018
+
3019
+ In future versions of this package, the default will be BucketEncryption.S3_MANAGED.
3020
+
3021
+ In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost
3022
+ $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module
3023
+ we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3
3024
+ managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.
3025
+
3026
+ If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to
3027
+ BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to
3028
+ BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
3029
+
3030
+ :stability: experimental
3031
+ '''
3032
+ result = self._values.get("staging_bucket_encryption")
3033
+ assert result is not None, "Required property 'staging_bucket_encryption' is missing"
3034
+ return typing.cast(_aws_cdk_aws_s3_ceddda9d.BucketEncryption, result)
3035
+
2942
3036
  @builtins.property
2943
3037
  def auto_delete_staging_assets(self) -> typing.Optional[builtins.bool]:
2944
3038
  '''(experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories.
@@ -3011,19 +3105,6 @@ class DefaultResourcesOptions(AppStagingSynthesizerOptions, DefaultStagingStackO
3011
3105
  result = self._values.get("image_asset_version_count")
3012
3106
  return typing.cast(typing.Optional[jsii.Number], result)
3013
3107
 
3014
- @builtins.property
3015
- def staging_bucket_encryption(
3016
- self,
3017
- ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption]:
3018
- '''(experimental) Encryption type for staging bucket.
3019
-
3020
- :default: - s3.BucketEncryption.KMS
3021
-
3022
- :stability: experimental
3023
- '''
3024
- result = self._values.get("staging_bucket_encryption")
3025
- return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption], result)
3026
-
3027
3108
  @builtins.property
3028
3109
  def staging_bucket_name(self) -> typing.Optional[builtins.str]:
3029
3110
  '''(experimental) Explicit name for the staging bucket.
@@ -3074,7 +3155,9 @@ class DefaultStagingStack(
3074
3155
 
3075
3156
  Example::
3076
3157
 
3077
- default_staging_stack = DefaultStagingStack.factory(app_id="my-app-id")
3158
+ from aws_cdk.aws_s3 import BucketEncryption
3159
+
3160
+ default_staging_stack = DefaultStagingStack.factory(app_id="my-app-id", staging_bucket_encryption=BucketEncryption.S3_MANAGED)
3078
3161
  '''
3079
3162
 
3080
3163
  def __init__(
@@ -3085,12 +3168,12 @@ class DefaultStagingStack(
3085
3168
  qualifier: builtins.str,
3086
3169
  deploy_role_arn: typing.Optional[builtins.str] = None,
3087
3170
  app_id: builtins.str,
3171
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
3088
3172
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
3089
3173
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
3090
3174
  file_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3091
3175
  image_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3092
3176
  image_asset_version_count: typing.Optional[jsii.Number] = None,
3093
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
3094
3177
  staging_bucket_name: typing.Optional[builtins.str] = None,
3095
3178
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
3096
3179
  analytics_reporting: typing.Optional[builtins.bool] = None,
@@ -3110,12 +3193,12 @@ class DefaultStagingStack(
3110
3193
  :param qualifier: (experimental) The qualifier used to specialize strings. Shouldn't be necessary but who knows what people might do.
3111
3194
  :param deploy_role_arn: (experimental) The ARN of the deploy action role, if given. This role will need permissions to read from to the staging resources. Default: - The CLI credentials are assumed, no additional permissions are granted.
3112
3195
  :param app_id: (experimental) A unique identifier for the application that the staging stack belongs to. This identifier will be used in the name of staging resources created for this application, and should be unique across CDK apps. The identifier should include lowercase characters and dashes ('-') only and have a maximum of 20 characters.
3196
+ :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. In future versions of this package, the default will be BucketEncryption.S3_MANAGED. In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3 managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required. If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
3113
3197
  :param auto_delete_staging_assets: (experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories. Default: true
3114
3198
  :param deploy_time_file_asset_lifetime: (experimental) The lifetime for deploy time file assets. Assets that are only necessary at deployment time (for instance, CloudFormation templates and Lambda source code bundles) will be automatically deleted after this many days. Assets that may be read from the staging bucket during your application's run time will not be deleted. Set this to the length of time you wish to be able to roll back to previous versions of your application without having to do a new ``cdk synth`` and re-upload of assets. Default: - Duration.days(30)
3115
3199
  :param file_asset_publishing_role: (experimental) Pass in an existing role to be used as the file publishing role. Default: - a new role will be created
3116
3200
  :param image_asset_publishing_role: (experimental) Pass in an existing role to be used as the image publishing role. Default: - a new role will be created
3117
3201
  :param image_asset_version_count: (experimental) The maximum number of image versions to store in a repository. Previous versions of an image can be stored for rollback purposes. Once a repository has more than 3 image versions stored, the oldest version will be discarded. This allows for sensible garbage collection while maintaining a few previous versions for rollback scenarios. Default: - up to 3 versions stored
3118
- :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. Default: - s3.BucketEncryption.KMS
3119
3202
  :param staging_bucket_name: (experimental) Explicit name for the staging bucket. Default: - a well-known name unique to this app/env.
3120
3203
  :param staging_stack_name_prefix: (experimental) Specify a custom prefix to be used as the staging stack name and construct ID. The prefix will be appended before the appId, which is required to be part of the stack name and construct ID to ensure uniqueness. Default: 'StagingStack'
3121
3204
  :param analytics_reporting: Include runtime versioning information in this Stack. Default: ``analyticsReporting`` setting of containing ``App``, or value of 'aws:cdk:version-reporting' context key
@@ -3139,12 +3222,12 @@ class DefaultStagingStack(
3139
3222
  qualifier=qualifier,
3140
3223
  deploy_role_arn=deploy_role_arn,
3141
3224
  app_id=app_id,
3225
+ staging_bucket_encryption=staging_bucket_encryption,
3142
3226
  auto_delete_staging_assets=auto_delete_staging_assets,
3143
3227
  deploy_time_file_asset_lifetime=deploy_time_file_asset_lifetime,
3144
3228
  file_asset_publishing_role=file_asset_publishing_role,
3145
3229
  image_asset_publishing_role=image_asset_publishing_role,
3146
3230
  image_asset_version_count=image_asset_version_count,
3147
- staging_bucket_encryption=staging_bucket_encryption,
3148
3231
  staging_bucket_name=staging_bucket_name,
3149
3232
  staging_stack_name_prefix=staging_stack_name_prefix,
3150
3233
  analytics_reporting=analytics_reporting,
@@ -3167,24 +3250,24 @@ class DefaultStagingStack(
3167
3250
  cls,
3168
3251
  *,
3169
3252
  app_id: builtins.str,
3253
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
3170
3254
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
3171
3255
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
3172
3256
  file_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3173
3257
  image_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3174
3258
  image_asset_version_count: typing.Optional[jsii.Number] = None,
3175
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
3176
3259
  staging_bucket_name: typing.Optional[builtins.str] = None,
3177
3260
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
3178
3261
  ) -> IStagingResourcesFactory:
3179
3262
  '''(experimental) Return a factory that will create DefaultStagingStacks.
3180
3263
 
3181
3264
  :param app_id: (experimental) A unique identifier for the application that the staging stack belongs to. This identifier will be used in the name of staging resources created for this application, and should be unique across CDK apps. The identifier should include lowercase characters and dashes ('-') only and have a maximum of 20 characters.
3265
+ :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. In future versions of this package, the default will be BucketEncryption.S3_MANAGED. In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3 managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required. If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to BucketEncryption.KMS. If you are creating a new staging bucket, you can set this property to BucketEncryption.S3_MANAGED to avoid the cost of a KMS key.
3182
3266
  :param auto_delete_staging_assets: (experimental) Auto deletes objects in the staging S3 bucket and images in the staging ECR repositories. Default: true
3183
3267
  :param deploy_time_file_asset_lifetime: (experimental) The lifetime for deploy time file assets. Assets that are only necessary at deployment time (for instance, CloudFormation templates and Lambda source code bundles) will be automatically deleted after this many days. Assets that may be read from the staging bucket during your application's run time will not be deleted. Set this to the length of time you wish to be able to roll back to previous versions of your application without having to do a new ``cdk synth`` and re-upload of assets. Default: - Duration.days(30)
3184
3268
  :param file_asset_publishing_role: (experimental) Pass in an existing role to be used as the file publishing role. Default: - a new role will be created
3185
3269
  :param image_asset_publishing_role: (experimental) Pass in an existing role to be used as the image publishing role. Default: - a new role will be created
3186
3270
  :param image_asset_version_count: (experimental) The maximum number of image versions to store in a repository. Previous versions of an image can be stored for rollback purposes. Once a repository has more than 3 image versions stored, the oldest version will be discarded. This allows for sensible garbage collection while maintaining a few previous versions for rollback scenarios. Default: - up to 3 versions stored
3187
- :param staging_bucket_encryption: (experimental) Encryption type for staging bucket. Default: - s3.BucketEncryption.KMS
3188
3271
  :param staging_bucket_name: (experimental) Explicit name for the staging bucket. Default: - a well-known name unique to this app/env.
3189
3272
  :param staging_stack_name_prefix: (experimental) Specify a custom prefix to be used as the staging stack name and construct ID. The prefix will be appended before the appId, which is required to be part of the stack name and construct ID to ensure uniqueness. Default: 'StagingStack'
3190
3273
 
@@ -3192,12 +3275,12 @@ class DefaultStagingStack(
3192
3275
  '''
3193
3276
  options = DefaultStagingStackOptions(
3194
3277
  app_id=app_id,
3278
+ staging_bucket_encryption=staging_bucket_encryption,
3195
3279
  auto_delete_staging_assets=auto_delete_staging_assets,
3196
3280
  deploy_time_file_asset_lifetime=deploy_time_file_asset_lifetime,
3197
3281
  file_asset_publishing_role=file_asset_publishing_role,
3198
3282
  image_asset_publishing_role=image_asset_publishing_role,
3199
3283
  image_asset_version_count=image_asset_version_count,
3200
- staging_bucket_encryption=staging_bucket_encryption,
3201
3284
  staging_bucket_name=staging_bucket_name,
3202
3285
  staging_stack_name_prefix=staging_stack_name_prefix,
3203
3286
  )
@@ -3418,12 +3501,12 @@ def _typecheckingstub__04df2201aac14a17d1f202664f0ecfab35edb0a3e63061b1cb8c73c36
3418
3501
  def _typecheckingstub__09dbc6ce5bcfd58fa48337caac574e10727d4bf9a43dc89866fbe7541b026219(
3419
3502
  *,
3420
3503
  app_id: builtins.str,
3504
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
3421
3505
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
3422
3506
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
3423
3507
  file_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3424
3508
  image_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3425
3509
  image_asset_version_count: typing.Optional[jsii.Number] = None,
3426
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
3427
3510
  staging_bucket_name: typing.Optional[builtins.str] = None,
3428
3511
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
3429
3512
  ) -> None:
@@ -3433,12 +3516,12 @@ def _typecheckingstub__09dbc6ce5bcfd58fa48337caac574e10727d4bf9a43dc89866fbe7541
3433
3516
  def _typecheckingstub__ac9f132bcac8375ac08c16bf3c9bb7407b641e71cfd23cea8b50befa3cf79bbf(
3434
3517
  *,
3435
3518
  app_id: builtins.str,
3519
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
3436
3520
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
3437
3521
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
3438
3522
  file_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3439
3523
  image_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3440
3524
  image_asset_version_count: typing.Optional[jsii.Number] = None,
3441
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
3442
3525
  staging_bucket_name: typing.Optional[builtins.str] = None,
3443
3526
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
3444
3527
  analytics_reporting: typing.Optional[builtins.bool] = None,
@@ -3515,12 +3598,12 @@ def _typecheckingstub__29102b1165011d046c95963e887fe565a9300d7ed93d8499af73ef05f
3515
3598
  bootstrap_qualifier: typing.Optional[builtins.str] = None,
3516
3599
  deployment_identities: typing.Optional[DeploymentIdentities] = None,
3517
3600
  app_id: builtins.str,
3601
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
3518
3602
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
3519
3603
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
3520
3604
  file_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3521
3605
  image_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3522
3606
  image_asset_version_count: typing.Optional[jsii.Number] = None,
3523
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
3524
3607
  staging_bucket_name: typing.Optional[builtins.str] = None,
3525
3608
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
3526
3609
  ) -> None:
@@ -3534,12 +3617,12 @@ def _typecheckingstub__ca741a4572a1f95a8d82e9d029388b8a2d72acacb69715277b6a785b4
3534
3617
  qualifier: builtins.str,
3535
3618
  deploy_role_arn: typing.Optional[builtins.str] = None,
3536
3619
  app_id: builtins.str,
3620
+ staging_bucket_encryption: _aws_cdk_aws_s3_ceddda9d.BucketEncryption,
3537
3621
  auto_delete_staging_assets: typing.Optional[builtins.bool] = None,
3538
3622
  deploy_time_file_asset_lifetime: typing.Optional[_aws_cdk_ceddda9d.Duration] = None,
3539
3623
  file_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3540
3624
  image_asset_publishing_role: typing.Optional[BootstrapRole] = None,
3541
3625
  image_asset_version_count: typing.Optional[jsii.Number] = None,
3542
- staging_bucket_encryption: typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketEncryption] = None,
3543
3626
  staging_bucket_name: typing.Optional[builtins.str] = None,
3544
3627
  staging_stack_name_prefix: typing.Optional[builtins.str] = None,
3545
3628
  analytics_reporting: typing.Optional[builtins.bool] = None,
@@ -15,9 +15,9 @@ import constructs._jsii
15
15
 
16
16
  __jsii_assembly__ = jsii.JSIIAssembly.load(
17
17
  "@aws-cdk/app-staging-synthesizer-alpha",
18
- "2.127.0-alpha.0",
18
+ "2.128.0-alpha.0",
19
19
  __name__[0:-6],
20
- "app-staging-synthesizer-alpha@2.127.0-alpha.0.jsii.tgz",
20
+ "app-staging-synthesizer-alpha@2.128.0-alpha.0.jsii.tgz",
21
21
  )
22
22
 
23
23
  __all__ = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aws-cdk.app-staging-synthesizer-alpha
3
- Version: 2.127.0a0
3
+ Version: 2.128.0a0
4
4
  Summary: Cdk synthesizer for with app-scoped staging stack
5
5
  Home-page: https://github.com/aws/aws-cdk
6
6
  Author: Amazon Web Services
@@ -23,7 +23,7 @@ Requires-Python: ~=3.8
23
23
  Description-Content-Type: text/markdown
24
24
  License-File: LICENSE
25
25
  License-File: NOTICE
26
- Requires-Dist: aws-cdk-lib <3.0.0,>=2.127.0
26
+ Requires-Dist: aws-cdk-lib <3.0.0,>=2.128.0
27
27
  Requires-Dist: constructs <11.0.0,>=10.0.0
28
28
  Requires-Dist: jsii <2.0.0,>=1.94.0
29
29
  Requires-Dist: publication >=0.0.3
@@ -62,9 +62,13 @@ are as follows:
62
62
  To get started, update your CDK App with a new `defaultStackSynthesizer`:
63
63
 
64
64
  ```python
65
+ from aws_cdk.aws_s3 import BucketEncryption
66
+
67
+
65
68
  app = App(
66
69
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
67
- app_id="my-app-id"
70
+ app_id="my-app-id", # put a unique id here
71
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED
68
72
  )
69
73
  )
70
74
  ```
@@ -124,9 +128,13 @@ synthesizer will create a new Staging Stack in each environment the CDK App is d
124
128
  its staging resources. To use this kind of synthesizer, use `AppStagingSynthesizer.defaultResources()`.
125
129
 
126
130
  ```python
131
+ from aws_cdk.aws_s3 import BucketEncryption
132
+
133
+
127
134
  app = App(
128
135
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
129
136
  app_id="my-app-id",
137
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
130
138
 
131
139
  # The following line is optional. By default it is assumed you have bootstrapped in the same
132
140
  # region(s) as the stack(s) you are deploying.
@@ -147,8 +155,14 @@ source code. As part of the `DefaultStagingStack`, an S3 bucket and IAM role wil
147
155
  used to upload the asset to S3.
148
156
 
149
157
  ```python
158
+ from aws_cdk.aws_s3 import BucketEncryption
159
+
160
+
150
161
  app = App(
151
- default_stack_synthesizer=AppStagingSynthesizer.default_resources(app_id="my-app-id")
162
+ default_stack_synthesizer=AppStagingSynthesizer.default_resources(
163
+ app_id="my-app-id",
164
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED
165
+ )
152
166
  )
153
167
 
154
168
  stack = Stack(app, "my-stack")
@@ -168,9 +182,13 @@ You can customize some or all of the roles you'd like to use in the synthesizer
168
182
  if all you need is to supply custom roles (and not change anything else in the `DefaultStagingStack`):
169
183
 
170
184
  ```python
185
+ from aws_cdk.aws_s3 import BucketEncryption
186
+
187
+
171
188
  app = App(
172
189
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
173
190
  app_id="my-app-id",
191
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
174
192
  deployment_identities=DeploymentIdentities.specify_roles(
175
193
  cloud_formation_execution_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Execute"),
176
194
  deployment_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/Deploy"),
@@ -188,9 +206,13 @@ and `CloudFormationExecutionRole` in the
188
206
  [bootstrap template](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk/lib/api/bootstrap/bootstrap-template.yaml).
189
207
 
190
208
  ```python
209
+ from aws_cdk.aws_s3 import BucketEncryption
210
+
211
+
191
212
  app = App(
192
213
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
193
214
  app_id="my-app-id",
215
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
194
216
  deployment_identities=DeploymentIdentities.cli_credentials()
195
217
  )
196
218
  )
@@ -201,9 +223,13 @@ assumable by the deployment role. You can also specify an existing IAM role for
201
223
  `fileAssetPublishingRole` or `imageAssetPublishingRole`:
202
224
 
203
225
  ```python
226
+ from aws_cdk.aws_s3 import BucketEncryption
227
+
228
+
204
229
  app = App(
205
230
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
206
231
  app_id="my-app-id",
232
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
207
233
  file_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/S3Access"),
208
234
  image_asset_publishing_role=BootstrapRole.from_role_arn("arn:aws:iam::123456789012:role/ECRAccess")
209
235
  )
@@ -255,9 +281,13 @@ to a previous version of an application just by doing a CloudFormation deploymen
255
281
  template, without rebuilding and republishing assets.
256
282
 
257
283
  ```python
284
+ from aws_cdk.aws_s3 import BucketEncryption
285
+
286
+
258
287
  app = App(
259
288
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
260
289
  app_id="my-app-id",
290
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
261
291
  deploy_time_file_asset_lifetime=Duration.days(100)
262
292
  )
263
293
  )
@@ -273,9 +303,13 @@ purged.
273
303
  To change the number of revisions stored, use `imageAssetVersionCount`:
274
304
 
275
305
  ```python
306
+ from aws_cdk.aws_s3 import BucketEncryption
307
+
308
+
276
309
  app = App(
277
310
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
278
311
  app_id="my-app-id",
312
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
279
313
  image_asset_version_count=10
280
314
  )
281
315
  )
@@ -289,9 +323,13 @@ or `emptyOnDelete` turned on. This creates custom resources under the hood to fa
289
323
  cleanup. To turn this off, specify `autoDeleteStagingAssets: false`.
290
324
 
291
325
  ```python
326
+ from aws_cdk.aws_s3 import BucketEncryption
327
+
328
+
292
329
  app = App(
293
330
  default_stack_synthesizer=AppStagingSynthesizer.default_resources(
294
331
  app_id="my-app-id",
332
+ staging_bucket_encryption=BucketEncryption.S3_MANAGED,
295
333
  auto_delete_staging_assets=False
296
334
  )
297
335
  )
@@ -299,20 +337,20 @@ app = App(
299
337
 
300
338
  ### Staging Bucket Encryption
301
339
 
302
- By default, the staging resources will be stored in an S3 Bucket with KMS encryption. To use
303
- SSE-S3, set `stagingBucketEncryption` to `BucketEncryption.S3_MANAGED`.
340
+ You must explicitly specify the encryption type for the staging bucket via the `stagingBucketEncryption` property. In
341
+ future versions of this package, the default will be `BucketEncryption.S3_MANAGED`.
304
342
 
305
- ```python
306
- from aws_cdk.aws_s3 import BucketEncryption
343
+ In previous versions of this package, the default was to use KMS encryption for the staging bucket. KMS keys cost
344
+ $1/month, which could result in unexpected costs for users who are not aware of this. As we stabilize this module
345
+ we intend to make the default S3-managed encryption, which is free. However, the migration path from KMS to S3
346
+ managed encryption for existing buckets is not straightforward. Therefore, for now, this property is required.
307
347
 
348
+ If you have an existing staging bucket encrypted with a KMS key, you will likely want to set this property to
349
+ `BucketEncryption.KMS`. If you are creating a new staging bucket, you can set this property to
350
+ `BucketEncryption.S3_MANAGED` to avoid the cost of a KMS key.
308
351
 
309
- app = App(
310
- default_stack_synthesizer=AppStagingSynthesizer.default_resources(
311
- app_id="my-app-id",
312
- staging_bucket_encryption=BucketEncryption.S3_MANAGED
313
- )
314
- )
315
- ```
352
+ You can learn more about choosing a bucket encryption type in the
353
+ [S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/serv-side-encryption.html).
316
354
 
317
355
  ## Using a Custom Staging Stack per Environment
318
356
 
@@ -0,0 +1,10 @@
1
+ aws_cdk/app_staging_synthesizer_alpha/__init__.py,sha256=kFCznCuIjDOVk7yC5LIAnBoCu8eHyyAYnf4o78JUapE,202849
2
+ aws_cdk/app_staging_synthesizer_alpha/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
+ aws_cdk/app_staging_synthesizer_alpha/_jsii/__init__.py,sha256=Xw1Rz3P2zjd-avTwEKChq9msRBP-3BbCLr3t_7W-I4E,467
4
+ aws_cdk/app_staging_synthesizer_alpha/_jsii/app-staging-synthesizer-alpha@2.128.0-alpha.0.jsii.tgz,sha256=aoEYAaTs-GP_jljjK2CSo7sFOWenZEPAaJgQhPsx0LM,86369
5
+ aws_cdk.app_staging_synthesizer_alpha-2.128.0a0.dist-info/LICENSE,sha256=kEDF86xJUQh1E9M7UPKKbHepBEdFxIUyoGfTwQB7zKg,11391
6
+ aws_cdk.app_staging_synthesizer_alpha-2.128.0a0.dist-info/METADATA,sha256=DHnhmQtrDoRchob74MPoJ0ZlGCjRckdVlDMLXRoGLIU,18264
7
+ aws_cdk.app_staging_synthesizer_alpha-2.128.0a0.dist-info/NOTICE,sha256=dXf56qvx2VDNCaqiRscOD2IH5GbmqbnKRzroZCeLtaQ,113
8
+ aws_cdk.app_staging_synthesizer_alpha-2.128.0a0.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
9
+ aws_cdk.app_staging_synthesizer_alpha-2.128.0a0.dist-info/top_level.txt,sha256=1TALAKbuUGsMSrfKWEf268lySCmcqSEO6cDYe_XlLHM,8
10
+ aws_cdk.app_staging_synthesizer_alpha-2.128.0a0.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- aws_cdk/app_staging_synthesizer_alpha/__init__.py,sha256=mFtbGMo-lHavtSCugmjasUbxo1rJvE5ZkouqlqLTIKY,193413
2
- aws_cdk/app_staging_synthesizer_alpha/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
- aws_cdk/app_staging_synthesizer_alpha/_jsii/__init__.py,sha256=zFAxTozFAJQlVAbtBOmUaYsGCqPQx3nEaOqTc4Ycez4,467
4
- aws_cdk/app_staging_synthesizer_alpha/_jsii/app-staging-synthesizer-alpha@2.127.0-alpha.0.jsii.tgz,sha256=9_FVQU5ZixM0N1TzaapMXfkpC0gMyutW1jrSJaAvu30,84762
5
- aws_cdk.app_staging_synthesizer_alpha-2.127.0a0.dist-info/LICENSE,sha256=kEDF86xJUQh1E9M7UPKKbHepBEdFxIUyoGfTwQB7zKg,11391
6
- aws_cdk.app_staging_synthesizer_alpha-2.127.0a0.dist-info/METADATA,sha256=ycTeA5OiqLzABgN-IWdYkDWIm1iaAAY2a34Jpo1ZS_k,16562
7
- aws_cdk.app_staging_synthesizer_alpha-2.127.0a0.dist-info/NOTICE,sha256=dXf56qvx2VDNCaqiRscOD2IH5GbmqbnKRzroZCeLtaQ,113
8
- aws_cdk.app_staging_synthesizer_alpha-2.127.0a0.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
9
- aws_cdk.app_staging_synthesizer_alpha-2.127.0a0.dist-info/top_level.txt,sha256=1TALAKbuUGsMSrfKWEf268lySCmcqSEO6cDYe_XlLHM,8
10
- aws_cdk.app_staging_synthesizer_alpha-2.127.0a0.dist-info/RECORD,,