aws-cdk-lib 2.204.0__py3-none-any.whl → 2.205.0__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-lib might be problematic. Click here for more details.

Files changed (48) hide show
  1. aws_cdk/__init__.py +170 -92
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.204.0.jsii.tgz → aws-cdk-lib@2.205.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_aiops/__init__.py +89 -39
  5. aws_cdk/aws_applicationautoscaling/__init__.py +2 -2
  6. aws_cdk/aws_arczonalshift/__init__.py +4 -1
  7. aws_cdk/aws_b2bi/__init__.py +32 -16
  8. aws_cdk/aws_bedrock/__init__.py +198 -10
  9. aws_cdk/aws_cassandra/__init__.py +156 -0
  10. aws_cdk/aws_cloudformation/__init__.py +74 -72
  11. aws_cdk/aws_cloudfront/__init__.py +1181 -485
  12. aws_cdk/aws_cloudfront_origins/__init__.py +26 -21
  13. aws_cdk/aws_cloudwatch/__init__.py +61 -0
  14. aws_cdk/aws_codebuild/__init__.py +216 -36
  15. aws_cdk/aws_datasync/__init__.py +2 -2
  16. aws_cdk/aws_docdb/__init__.py +78 -0
  17. aws_cdk/aws_dynamodb/__init__.py +207 -35
  18. aws_cdk/aws_ec2/__init__.py +32 -30
  19. aws_cdk/aws_ecs/__init__.py +12 -19
  20. aws_cdk/aws_emrserverless/__init__.py +5 -5
  21. aws_cdk/aws_events/__init__.py +58 -3
  22. aws_cdk/aws_events_targets/__init__.py +7 -2
  23. aws_cdk/aws_evs/__init__.py +7 -7
  24. aws_cdk/aws_fsx/__init__.py +138 -78
  25. aws_cdk/aws_gamelift/__init__.py +19 -0
  26. aws_cdk/aws_glue/__init__.py +3 -3
  27. aws_cdk/aws_iot/__init__.py +1 -1
  28. aws_cdk/aws_kinesis/__init__.py +67 -13
  29. aws_cdk/aws_kinesisfirehose/__init__.py +28 -1
  30. aws_cdk/aws_lex/__init__.py +36 -19
  31. aws_cdk/aws_neptune/__init__.py +12 -12
  32. aws_cdk/aws_odb/__init__.py +4049 -0
  33. aws_cdk/aws_omics/__init__.py +1 -1
  34. aws_cdk/aws_qbusiness/__init__.py +471 -4
  35. aws_cdk/aws_quicksight/__init__.py +185 -16
  36. aws_cdk/aws_rds/__init__.py +169 -17
  37. aws_cdk/aws_redshiftserverless/__init__.py +72 -45
  38. aws_cdk/aws_route53/__init__.py +41 -19
  39. aws_cdk/aws_s3tables/__init__.py +1005 -0
  40. aws_cdk/aws_sagemaker/__init__.py +20 -0
  41. aws_cdk/aws_synthetics/__init__.py +141 -37
  42. aws_cdk/aws_transfer/__init__.py +23 -1
  43. {aws_cdk_lib-2.204.0.dist-info → aws_cdk_lib-2.205.0.dist-info}/METADATA +1 -1
  44. {aws_cdk_lib-2.204.0.dist-info → aws_cdk_lib-2.205.0.dist-info}/RECORD +48 -47
  45. {aws_cdk_lib-2.204.0.dist-info → aws_cdk_lib-2.205.0.dist-info}/LICENSE +0 -0
  46. {aws_cdk_lib-2.204.0.dist-info → aws_cdk_lib-2.205.0.dist-info}/NOTICE +0 -0
  47. {aws_cdk_lib-2.204.0.dist-info → aws_cdk_lib-2.205.0.dist-info}/WHEEL +0 -0
  48. {aws_cdk_lib-2.204.0.dist-info → aws_cdk_lib-2.205.0.dist-info}/top_level.txt +0 -0
@@ -2908,15 +2908,19 @@ class S3BucketOrigin(
2908
2908
 
2909
2909
  Example::
2910
2910
 
2911
- my_bucket = s3.Bucket(self, "myBucket")
2912
- s3_origin = origins.S3BucketOrigin.with_origin_access_control(my_bucket,
2913
- origin_access_levels=[cloudfront.AccessLevel.READ, cloudfront.AccessLevel.LIST]
2911
+ import aws_cdk.aws_kms as kms
2912
+
2913
+
2914
+ my_kms_key = kms.Key(self, "myKMSKey")
2915
+ my_bucket = s3.Bucket(self, "mySSEKMSEncryptedBucket",
2916
+ encryption=s3.BucketEncryption.KMS,
2917
+ encryption_key=my_kms_key,
2918
+ object_ownership=s3.ObjectOwnership.BUCKET_OWNER_ENFORCED
2914
2919
  )
2915
- cloudfront.Distribution(self, "distribution",
2920
+ cloudfront.Distribution(self, "myDist",
2916
2921
  default_behavior=cloudfront.BehaviorOptions(
2917
- origin=s3_origin
2918
- ),
2919
- default_root_object="index.html"
2922
+ origin=origins.S3BucketOrigin.with_origin_access_control(my_bucket)
2923
+ )
2920
2924
  )
2921
2925
  '''
2922
2926
 
@@ -3348,14 +3352,16 @@ class S3BucketOriginWithOACProps(S3BucketOriginBaseProps):
3348
3352
  Example::
3349
3353
 
3350
3354
  my_bucket = s3.Bucket(self, "myBucket")
3355
+ oac = cloudfront.S3OriginAccessControl(self, "MyOAC",
3356
+ signing=cloudfront.Signing.SIGV4_NO_OVERRIDE
3357
+ )
3351
3358
  s3_origin = origins.S3BucketOrigin.with_origin_access_control(my_bucket,
3352
- origin_access_levels=[cloudfront.AccessLevel.READ, cloudfront.AccessLevel.LIST]
3359
+ origin_access_control=oac
3353
3360
  )
3354
- cloudfront.Distribution(self, "distribution",
3361
+ cloudfront.Distribution(self, "myDist",
3355
3362
  default_behavior=cloudfront.BehaviorOptions(
3356
3363
  origin=s3_origin
3357
- ),
3358
- default_root_object="index.html"
3364
+ )
3359
3365
  )
3360
3366
  '''
3361
3367
  if __debug__:
@@ -3722,20 +3728,19 @@ class S3Origin(
3722
3728
 
3723
3729
  Example::
3724
3730
 
3725
- # Adding an existing Lambda@Edge function created in a different stack
3726
- # to a CloudFront distribution.
3727
3731
  # s3_bucket: s3.Bucket
3728
-
3729
- function_version = lambda_.Version.from_version_arn(self, "Version", "arn:aws:lambda:us-east-1:123456789012:function:functionName:1")
3730
-
3732
+ # Add a cloudfront Function to a Distribution
3733
+ cf_function = cloudfront.Function(self, "Function",
3734
+ code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }"),
3735
+ runtime=cloudfront.FunctionRuntime.JS_2_0
3736
+ )
3731
3737
  cloudfront.Distribution(self, "distro",
3732
3738
  default_behavior=cloudfront.BehaviorOptions(
3733
3739
  origin=origins.S3Origin(s3_bucket),
3734
- edge_lambdas=[cloudfront.EdgeLambda(
3735
- function_version=function_version,
3736
- event_type=cloudfront.LambdaEdgeEventType.VIEWER_REQUEST
3737
- )
3738
- ]
3740
+ function_associations=[cloudfront.FunctionAssociation(
3741
+ function=cf_function,
3742
+ event_type=cloudfront.FunctionEventType.VIEWER_REQUEST
3743
+ )]
3739
3744
  )
3740
3745
  )
3741
3746
  '''
@@ -872,6 +872,20 @@ dashboard.add_widgets(cloudwatch.LogQueryWidget(
872
872
  ))
873
873
  ```
874
874
 
875
+ Log Insights QL is the default query language. You may specify an [alternate query language: OpenSearch PPL or SQL](https://aws.amazon.com/blogs/aws/new-amazon-cloudwatch-and-amazon-opensearch-service-launch-an-integrated-analytics-experience/), if desired:
876
+
877
+ ```python
878
+ # dashboard: cloudwatch.Dashboard
879
+
880
+
881
+ dashboard.add_widgets(cloudwatch.LogQueryWidget(
882
+ log_group_names=["my-log-group"],
883
+ view=cloudwatch.LogQueryVisualizationType.TABLE,
884
+ query_string="SELECT count(*) as count FROM 'my-log-group'",
885
+ query_language=cloudwatch.LogQueryLanguage.SQL
886
+ ))
887
+ ```
888
+
875
889
  ### Custom widget
876
890
 
877
891
  A `CustomWidget` shows the result of an AWS Lambda function:
@@ -8624,6 +8638,33 @@ class LegendPosition(enum.Enum):
8624
8638
  '''Add shading below the annotation.'''
8625
8639
 
8626
8640
 
8641
+ @jsii.enum(jsii_type="aws-cdk-lib.aws_cloudwatch.LogQueryLanguage")
8642
+ class LogQueryLanguage(enum.Enum):
8643
+ '''Logs Query Language.
8644
+
8645
+ :exampleMetadata: infused
8646
+
8647
+ Example::
8648
+
8649
+ # dashboard: cloudwatch.Dashboard
8650
+
8651
+
8652
+ dashboard.add_widgets(cloudwatch.LogQueryWidget(
8653
+ log_group_names=["my-log-group"],
8654
+ view=cloudwatch.LogQueryVisualizationType.TABLE,
8655
+ query_string="SELECT count(*) as count FROM 'my-log-group'",
8656
+ query_language=cloudwatch.LogQueryLanguage.SQL
8657
+ ))
8658
+ '''
8659
+
8660
+ LOGS_INSIGHTS = "LOGS_INSIGHTS"
8661
+ '''Logs Insights QL.'''
8662
+ SQL = "SQL"
8663
+ '''OpenSearch SQL.'''
8664
+ PPL = "PPL"
8665
+ '''OpenSearch PPL.'''
8666
+
8667
+
8627
8668
  @jsii.enum(jsii_type="aws-cdk-lib.aws_cloudwatch.LogQueryVisualizationType")
8628
8669
  class LogQueryVisualizationType(enum.Enum):
8629
8670
  '''Types of view.
@@ -8663,6 +8704,7 @@ class LogQueryVisualizationType(enum.Enum):
8663
8704
  "log_group_names": "logGroupNames",
8664
8705
  "account_id": "accountId",
8665
8706
  "height": "height",
8707
+ "query_language": "queryLanguage",
8666
8708
  "query_lines": "queryLines",
8667
8709
  "query_string": "queryString",
8668
8710
  "region": "region",
@@ -8678,6 +8720,7 @@ class LogQueryWidgetProps:
8678
8720
  log_group_names: typing.Sequence[builtins.str],
8679
8721
  account_id: typing.Optional[builtins.str] = None,
8680
8722
  height: typing.Optional[jsii.Number] = None,
8723
+ query_language: typing.Optional[LogQueryLanguage] = None,
8681
8724
  query_lines: typing.Optional[typing.Sequence[builtins.str]] = None,
8682
8725
  query_string: typing.Optional[builtins.str] = None,
8683
8726
  region: typing.Optional[builtins.str] = None,
@@ -8690,6 +8733,7 @@ class LogQueryWidgetProps:
8690
8733
  :param log_group_names: Names of log groups to query.
8691
8734
  :param account_id: The AWS account ID where the log groups are located. This enables cross-account functionality for CloudWatch dashboards. Before using this feature, ensure that proper cross-account sharing is configured between the monitoring account and source account. For more information, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html Default: - Current account
8692
8735
  :param height: Height of the widget. Default: 6
8736
+ :param query_language: The query language to use for the query. Default: LogQueryLanguage.LOGS_INSIGHTS
8693
8737
  :param query_lines: A sequence of lines to use to build the query. The query will be built by joining the lines together using ``\\n|``. Default: - Exactly one of ``queryString``, ``queryLines`` is required.
8694
8738
  :param query_string: Full query string for log insights. Be sure to prepend every new line with a newline and pipe character (``\\n|``). Default: - Exactly one of ``queryString``, ``queryLines`` is required.
8695
8739
  :param region: The region the metrics of this widget should be taken from. Default: Current region
@@ -8717,6 +8761,7 @@ class LogQueryWidgetProps:
8717
8761
  check_type(argname="argument log_group_names", value=log_group_names, expected_type=type_hints["log_group_names"])
8718
8762
  check_type(argname="argument account_id", value=account_id, expected_type=type_hints["account_id"])
8719
8763
  check_type(argname="argument height", value=height, expected_type=type_hints["height"])
8764
+ check_type(argname="argument query_language", value=query_language, expected_type=type_hints["query_language"])
8720
8765
  check_type(argname="argument query_lines", value=query_lines, expected_type=type_hints["query_lines"])
8721
8766
  check_type(argname="argument query_string", value=query_string, expected_type=type_hints["query_string"])
8722
8767
  check_type(argname="argument region", value=region, expected_type=type_hints["region"])
@@ -8730,6 +8775,8 @@ class LogQueryWidgetProps:
8730
8775
  self._values["account_id"] = account_id
8731
8776
  if height is not None:
8732
8777
  self._values["height"] = height
8778
+ if query_language is not None:
8779
+ self._values["query_language"] = query_language
8733
8780
  if query_lines is not None:
8734
8781
  self._values["query_lines"] = query_lines
8735
8782
  if query_string is not None:
@@ -8775,6 +8822,15 @@ class LogQueryWidgetProps:
8775
8822
  result = self._values.get("height")
8776
8823
  return typing.cast(typing.Optional[jsii.Number], result)
8777
8824
 
8825
+ @builtins.property
8826
+ def query_language(self) -> typing.Optional[LogQueryLanguage]:
8827
+ '''The query language to use for the query.
8828
+
8829
+ :default: LogQueryLanguage.LOGS_INSIGHTS
8830
+ '''
8831
+ result = self._values.get("query_language")
8832
+ return typing.cast(typing.Optional[LogQueryLanguage], result)
8833
+
8778
8834
  @builtins.property
8779
8835
  def query_lines(self) -> typing.Optional[typing.List[builtins.str]]:
8780
8836
  '''A sequence of lines to use to build the query.
@@ -15168,6 +15224,7 @@ class LogQueryWidget(
15168
15224
  log_group_names: typing.Sequence[builtins.str],
15169
15225
  account_id: typing.Optional[builtins.str] = None,
15170
15226
  height: typing.Optional[jsii.Number] = None,
15227
+ query_language: typing.Optional[LogQueryLanguage] = None,
15171
15228
  query_lines: typing.Optional[typing.Sequence[builtins.str]] = None,
15172
15229
  query_string: typing.Optional[builtins.str] = None,
15173
15230
  region: typing.Optional[builtins.str] = None,
@@ -15179,6 +15236,7 @@ class LogQueryWidget(
15179
15236
  :param log_group_names: Names of log groups to query.
15180
15237
  :param account_id: The AWS account ID where the log groups are located. This enables cross-account functionality for CloudWatch dashboards. Before using this feature, ensure that proper cross-account sharing is configured between the monitoring account and source account. For more information, see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html Default: - Current account
15181
15238
  :param height: Height of the widget. Default: 6
15239
+ :param query_language: The query language to use for the query. Default: LogQueryLanguage.LOGS_INSIGHTS
15182
15240
  :param query_lines: A sequence of lines to use to build the query. The query will be built by joining the lines together using ``\\n|``. Default: - Exactly one of ``queryString``, ``queryLines`` is required.
15183
15241
  :param query_string: Full query string for log insights. Be sure to prepend every new line with a newline and pipe character (``\\n|``). Default: - Exactly one of ``queryString``, ``queryLines`` is required.
15184
15242
  :param region: The region the metrics of this widget should be taken from. Default: Current region
@@ -15190,6 +15248,7 @@ class LogQueryWidget(
15190
15248
  log_group_names=log_group_names,
15191
15249
  account_id=account_id,
15192
15250
  height=height,
15251
+ query_language=query_language,
15193
15252
  query_lines=query_lines,
15194
15253
  query_string=query_string,
15195
15254
  region=region,
@@ -16232,6 +16291,7 @@ __all__ = [
16232
16291
  "IVariable",
16233
16292
  "IWidget",
16234
16293
  "LegendPosition",
16294
+ "LogQueryLanguage",
16235
16295
  "LogQueryVisualizationType",
16236
16296
  "LogQueryWidget",
16237
16297
  "LogQueryWidgetProps",
@@ -17266,6 +17326,7 @@ def _typecheckingstub__b7d4a308b1274696259a35b14b5ae833f34881f95eaba521bb47a74b3
17266
17326
  log_group_names: typing.Sequence[builtins.str],
17267
17327
  account_id: typing.Optional[builtins.str] = None,
17268
17328
  height: typing.Optional[jsii.Number] = None,
17329
+ query_language: typing.Optional[LogQueryLanguage] = None,
17269
17330
  query_lines: typing.Optional[typing.Sequence[builtins.str]] = None,
17270
17331
  query_string: typing.Optional[builtins.str] = None,
17271
17332
  region: typing.Optional[builtins.str] = None,
@@ -261,9 +261,72 @@ codebuild.Project(self, "Project",
261
261
  )
262
262
  ```
263
263
 
264
- Note that two different CodeBuild Projects using the same S3 bucket will *not*
265
- share their cache: each Project will get a unique file in the S3 bucket to store
266
- the cache in.
264
+ If you want to [share the same cache between multiple projects](https://docs.aws.amazon.com/codebuild/latest/userguide/caching-s3.html#caching-s3-sharing), you must must do the following:
265
+
266
+ * Use the same `cacheNamespace`.
267
+ * Specify the same cache key.
268
+ * Define identical cache paths.
269
+ * Use the same Amazon S3 buckets and `pathPrefix` if set.
270
+
271
+ ```python
272
+ # source_bucket: s3.Bucket
273
+ # my_caching_bucket: s3.Bucket
274
+
275
+
276
+ codebuild.Project(self, "ProjectA",
277
+ source=codebuild.Source.s3(
278
+ bucket=source_bucket,
279
+ path="path/to/source-a.zip"
280
+ ),
281
+ # configure the same bucket and path prefix
282
+ cache=codebuild.Cache.bucket(my_caching_bucket,
283
+ prefix="cache",
284
+ # use the same cache namespace
285
+ cache_namespace="cache-namespace"
286
+ ),
287
+ build_spec=codebuild.BuildSpec.from_object({
288
+ "version": "0.2",
289
+ "phases": {
290
+ "build": {
291
+ "commands": ["..."]
292
+ }
293
+ },
294
+ # specify the same cache key and paths
295
+ "cache": {
296
+ "key": "unique-key",
297
+ "paths": ["/root/cachedir/**/*"
298
+ ]
299
+ }
300
+ })
301
+ )
302
+
303
+ codebuild.Project(self, "ProjectB",
304
+ source=codebuild.Source.s3(
305
+ bucket=source_bucket,
306
+ path="path/to/source-b.zip"
307
+ ),
308
+ # configure the same bucket and path prefix
309
+ cache=codebuild.Cache.bucket(my_caching_bucket,
310
+ prefix="cache",
311
+ # use the same cache namespace
312
+ cache_namespace="cache-namespace"
313
+ ),
314
+ build_spec=codebuild.BuildSpec.from_object({
315
+ "version": "0.2",
316
+ "phases": {
317
+ "build": {
318
+ "commands": ["..."]
319
+ }
320
+ },
321
+ # specify the same cache key and paths
322
+ "cache": {
323
+ "key": "unique-key",
324
+ "paths": ["/root/cachedir/**/*"
325
+ ]
326
+ }
327
+ })
328
+ )
329
+ ```
267
330
 
268
331
  ### Local Caching
269
332
 
@@ -1463,32 +1526,104 @@ class BitBucketSourceCredentialsProps:
1463
1526
  @jsii.data_type(
1464
1527
  jsii_type="aws-cdk-lib.aws_codebuild.BucketCacheOptions",
1465
1528
  jsii_struct_bases=[],
1466
- name_mapping={"prefix": "prefix"},
1529
+ name_mapping={"cache_namespace": "cacheNamespace", "prefix": "prefix"},
1467
1530
  )
1468
1531
  class BucketCacheOptions:
1469
- def __init__(self, *, prefix: typing.Optional[builtins.str] = None) -> None:
1532
+ def __init__(
1533
+ self,
1534
+ *,
1535
+ cache_namespace: typing.Optional[builtins.str] = None,
1536
+ prefix: typing.Optional[builtins.str] = None,
1537
+ ) -> None:
1470
1538
  '''
1539
+ :param cache_namespace: Defines the scope of the cache. You can use this namespace to share a cache across multiple projects. Default: undefined - No cache namespace, which means that the cache is not shared across multiple projects.
1471
1540
  :param prefix: The prefix to use to store the cache in the bucket.
1472
1541
 
1473
- :exampleMetadata: fixture=_generated
1542
+ :exampleMetadata: infused
1474
1543
 
1475
1544
  Example::
1476
1545
 
1477
- # The code below shows an example of how to instantiate this type.
1478
- # The values are placeholders you should change.
1479
- from aws_cdk import aws_codebuild as codebuild
1546
+ # source_bucket: s3.Bucket
1547
+ # my_caching_bucket: s3.Bucket
1548
+
1480
1549
 
1481
- bucket_cache_options = codebuild.BucketCacheOptions(
1482
- prefix="prefix"
1550
+ codebuild.Project(self, "ProjectA",
1551
+ source=codebuild.Source.s3(
1552
+ bucket=source_bucket,
1553
+ path="path/to/source-a.zip"
1554
+ ),
1555
+ # configure the same bucket and path prefix
1556
+ cache=codebuild.Cache.bucket(my_caching_bucket,
1557
+ prefix="cache",
1558
+ # use the same cache namespace
1559
+ cache_namespace="cache-namespace"
1560
+ ),
1561
+ build_spec=codebuild.BuildSpec.from_object({
1562
+ "version": "0.2",
1563
+ "phases": {
1564
+ "build": {
1565
+ "commands": ["..."]
1566
+ }
1567
+ },
1568
+ # specify the same cache key and paths
1569
+ "cache": {
1570
+ "key": "unique-key",
1571
+ "paths": ["/root/cachedir/**/*"
1572
+ ]
1573
+ }
1574
+ })
1575
+ )
1576
+
1577
+ codebuild.Project(self, "ProjectB",
1578
+ source=codebuild.Source.s3(
1579
+ bucket=source_bucket,
1580
+ path="path/to/source-b.zip"
1581
+ ),
1582
+ # configure the same bucket and path prefix
1583
+ cache=codebuild.Cache.bucket(my_caching_bucket,
1584
+ prefix="cache",
1585
+ # use the same cache namespace
1586
+ cache_namespace="cache-namespace"
1587
+ ),
1588
+ build_spec=codebuild.BuildSpec.from_object({
1589
+ "version": "0.2",
1590
+ "phases": {
1591
+ "build": {
1592
+ "commands": ["..."]
1593
+ }
1594
+ },
1595
+ # specify the same cache key and paths
1596
+ "cache": {
1597
+ "key": "unique-key",
1598
+ "paths": ["/root/cachedir/**/*"
1599
+ ]
1600
+ }
1601
+ })
1483
1602
  )
1484
1603
  '''
1485
1604
  if __debug__:
1486
1605
  type_hints = typing.get_type_hints(_typecheckingstub__0964d02b7c6a99cc65ab53a8ae83bdb47d0901ee8a6f094b815d479e0fd8cb10)
1606
+ check_type(argname="argument cache_namespace", value=cache_namespace, expected_type=type_hints["cache_namespace"])
1487
1607
  check_type(argname="argument prefix", value=prefix, expected_type=type_hints["prefix"])
1488
1608
  self._values: typing.Dict[builtins.str, typing.Any] = {}
1609
+ if cache_namespace is not None:
1610
+ self._values["cache_namespace"] = cache_namespace
1489
1611
  if prefix is not None:
1490
1612
  self._values["prefix"] = prefix
1491
1613
 
1614
+ @builtins.property
1615
+ def cache_namespace(self) -> typing.Optional[builtins.str]:
1616
+ '''Defines the scope of the cache.
1617
+
1618
+ You can use this namespace to share a cache across multiple projects.
1619
+
1620
+ :default: undefined - No cache namespace, which means that the cache is not shared across multiple projects.
1621
+
1622
+ :see: https://docs.aws.amazon.com/codebuild/latest/userguide/caching-s3.html#caching-s3-sharing
1623
+ '''
1624
+ result = self._values.get("cache_namespace")
1625
+ return typing.cast(typing.Optional[builtins.str], result)
1626
+
1492
1627
  @builtins.property
1493
1628
  def prefix(self) -> typing.Optional[builtins.str]:
1494
1629
  '''The prefix to use to store the cache in the bucket.'''
@@ -2103,31 +2238,53 @@ class Cache(
2103
2238
 
2104
2239
  Example::
2105
2240
 
2106
- # my_caching_bucket: s3.Bucket
2241
+ # vpc: ec2.Vpc
2242
+ # my_security_group: ec2.SecurityGroup
2107
2243
 
2244
+ pipelines.CodeBuildStep("Synth",
2245
+ # ...standard ShellStep props...
2246
+ commands=[],
2247
+ env={},
2108
2248
 
2109
- codebuild.Project(self, "Project",
2110
- source=codebuild.Source.bit_bucket(
2111
- owner="awslabs",
2112
- repo="aws-cdk"
2249
+ # If you are using a CodeBuildStep explicitly, set the 'cdk.out' directory
2250
+ # to be the synth step's output.
2251
+ primary_output_directory="cdk.out",
2252
+
2253
+ # Control the name of the project
2254
+ project_name="MyProject",
2255
+
2256
+ # Control parts of the BuildSpec other than the regular 'build' and 'install' commands
2257
+ partial_build_spec=codebuild.BuildSpec.from_object({
2258
+ "version": "0.2"
2259
+ }),
2260
+
2261
+ # Control the build environment
2262
+ build_environment=codebuild.BuildEnvironment(
2263
+ compute_type=codebuild.ComputeType.LARGE,
2264
+ privileged=True
2113
2265
  ),
2266
+ timeout=Duration.minutes(90),
2267
+ file_system_locations=[
2268
+ codebuild.FileSystemLocation.efs(
2269
+ identifier="myidentifier2",
2270
+ location="myclodation.mydnsroot.com:/loc",
2271
+ mount_point="/media",
2272
+ mount_options="opts"
2273
+ )
2274
+ ],
2114
2275
 
2115
- cache=codebuild.Cache.bucket(my_caching_bucket),
2276
+ # Control Elastic Network Interface creation
2277
+ vpc=vpc,
2278
+ subnet_selection=ec2.SubnetSelection(subnet_type=ec2.SubnetType.PRIVATE_WITH_EGRESS),
2279
+ security_groups=[my_security_group],
2116
2280
 
2117
- # BuildSpec with a 'cache' section necessary for S3 caching. This can
2118
- # also come from 'buildspec.yml' in your source.
2119
- build_spec=codebuild.BuildSpec.from_object({
2120
- "version": "0.2",
2121
- "phases": {
2122
- "build": {
2123
- "commands": ["..."]
2124
- }
2125
- },
2126
- "cache": {
2127
- "paths": ["/root/cachedir/**/*"
2128
- ]
2129
- }
2130
- })
2281
+ # Control caching
2282
+ cache=codebuild.Cache.bucket(s3.Bucket(self, "Cache")),
2283
+
2284
+ # Additional policy statements for the execution role
2285
+ role_policy_statements=[
2286
+ iam.PolicyStatement()
2287
+ ]
2131
2288
  )
2132
2289
  '''
2133
2290
 
@@ -2140,17 +2297,19 @@ class Cache(
2140
2297
  cls,
2141
2298
  bucket: _IBucket_42e086fd,
2142
2299
  *,
2300
+ cache_namespace: typing.Optional[builtins.str] = None,
2143
2301
  prefix: typing.Optional[builtins.str] = None,
2144
2302
  ) -> "Cache":
2145
2303
  '''Create an S3 caching strategy.
2146
2304
 
2147
2305
  :param bucket: the S3 bucket to use for caching.
2306
+ :param cache_namespace: Defines the scope of the cache. You can use this namespace to share a cache across multiple projects. Default: undefined - No cache namespace, which means that the cache is not shared across multiple projects.
2148
2307
  :param prefix: The prefix to use to store the cache in the bucket.
2149
2308
  '''
2150
2309
  if __debug__:
2151
2310
  type_hints = typing.get_type_hints(_typecheckingstub__17e53da7d0dcdb63a4024e7a2681ef7faa68be13f710db0f237c0a06196e2279)
2152
2311
  check_type(argname="argument bucket", value=bucket, expected_type=type_hints["bucket"])
2153
- options = BucketCacheOptions(prefix=prefix)
2312
+ options = BucketCacheOptions(cache_namespace=cache_namespace, prefix=prefix)
2154
2313
 
2155
2314
  return typing.cast("Cache", jsii.sinvoke(cls, "bucket", [bucket, options]))
2156
2315
 
@@ -16207,12 +16366,31 @@ class Source(
16207
16366
 
16208
16367
  Example::
16209
16368
 
16210
- project = codebuild.Project(self, "MyProject",
16211
- build_spec=codebuild.BuildSpec.from_source_filename("my-buildspec.yml"),
16212
- source=codebuild.Source.git_hub(
16369
+ # my_caching_bucket: s3.Bucket
16370
+
16371
+
16372
+ codebuild.Project(self, "Project",
16373
+ source=codebuild.Source.bit_bucket(
16213
16374
  owner="awslabs",
16214
16375
  repo="aws-cdk"
16215
- )
16376
+ ),
16377
+
16378
+ cache=codebuild.Cache.bucket(my_caching_bucket),
16379
+
16380
+ # BuildSpec with a 'cache' section necessary for S3 caching. This can
16381
+ # also come from 'buildspec.yml' in your source.
16382
+ build_spec=codebuild.BuildSpec.from_object({
16383
+ "version": "0.2",
16384
+ "phases": {
16385
+ "build": {
16386
+ "commands": ["..."]
16387
+ }
16388
+ },
16389
+ "cache": {
16390
+ "paths": ["/root/cachedir/**/*"
16391
+ ]
16392
+ }
16393
+ })
16216
16394
  )
16217
16395
  '''
16218
16396
 
@@ -18923,6 +19101,7 @@ def _typecheckingstub__ebef68770fb5be7ec641650b4d069caf22f7652724d683d64610af210
18923
19101
 
18924
19102
  def _typecheckingstub__0964d02b7c6a99cc65ab53a8ae83bdb47d0901ee8a6f094b815d479e0fd8cb10(
18925
19103
  *,
19104
+ cache_namespace: typing.Optional[builtins.str] = None,
18926
19105
  prefix: typing.Optional[builtins.str] = None,
18927
19106
  ) -> None:
18928
19107
  """Type checking stubs"""
@@ -18989,6 +19168,7 @@ def _typecheckingstub__4da3d788faa6a5e8ccf7b7a0f950b8fdc88fa2e5bd876f8b662b8fce2
18989
19168
  def _typecheckingstub__17e53da7d0dcdb63a4024e7a2681ef7faa68be13f710db0f237c0a06196e2279(
18990
19169
  bucket: _IBucket_42e086fd,
18991
19170
  *,
19171
+ cache_namespace: typing.Optional[builtins.str] = None,
18992
19172
  prefix: typing.Optional[builtins.str] = None,
18993
19173
  ) -> None:
18994
19174
  """Type checking stubs"""
@@ -1552,7 +1552,7 @@ class CfnLocationEFS(
1552
1552
  '''The subnet and security groups that AWS DataSync uses to connect to one of your Amazon EFS file system's `mount targets <https://docs.aws.amazon.com/efs/latest/ug/accessing-fs.html>`_ .
1553
1553
 
1554
1554
  :param security_group_arns: Specifies the Amazon Resource Names (ARNs) of the security groups associated with an Amazon EFS file system's mount target.
1555
- :param subnet_arn: Specifies the ARN of a subnet where DataSync creates the `network interfaces <https://docs.aws.amazon.com/datasync/latest/userguide/datasync-network.html#required-network-interfaces>`_ for managing traffic during your transfer. The subnet must be located: - In the same virtual private cloud (VPC) as the Amazon EFS file system. - In the same Availability Zone as at least one mount target for the Amazon EFS file system. .. epigraph:: You don't need to specify a subnet that includes a file system mount target.
1555
+ :param subnet_arn: Specifies the ARN of a subnet where DataSync creates the `network interfaces <https://docs.aws.amazon.com/datasync/latest/userguide/datasync-network.html#required-network-interfaces.html>`_ for managing traffic during your transfer. The subnet must be located: - In the same virtual private cloud (VPC) as the Amazon EFS file system. - In the same Availability Zone as at least one mount target for the Amazon EFS file system. .. epigraph:: You don't need to specify a subnet that includes a file system mount target.
1556
1556
 
1557
1557
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datasync-locationefs-ec2config.html
1558
1558
  :exampleMetadata: fixture=_generated
@@ -1589,7 +1589,7 @@ class CfnLocationEFS(
1589
1589
 
1590
1590
  @builtins.property
1591
1591
  def subnet_arn(self) -> builtins.str:
1592
- '''Specifies the ARN of a subnet where DataSync creates the `network interfaces <https://docs.aws.amazon.com/datasync/latest/userguide/datasync-network.html#required-network-interfaces>`_ for managing traffic during your transfer.
1592
+ '''Specifies the ARN of a subnet where DataSync creates the `network interfaces <https://docs.aws.amazon.com/datasync/latest/userguide/datasync-network.html#required-network-interfaces.html>`_ for managing traffic during your transfer.
1593
1593
 
1594
1594
  The subnet must be located:
1595
1595