aws-cdk.aws-s3objectlambda-alpha 2.229.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.
@@ -0,0 +1,808 @@
1
+ r'''
2
+ # AWS::S3ObjectLambda Construct Library
3
+
4
+ <!--BEGIN STABILITY BANNER-->---
5
+
6
+
7
+ ![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
8
+
9
+ > The APIs of higher level constructs in this module are experimental and under active development.
10
+ > They are subject to non-backward compatible changes or removal in any future version. These are
11
+ > not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
12
+ > announced in the release notes. This means that while you may use them, you may need to update
13
+ > your source code when upgrading to a newer version of this package.
14
+
15
+ ---
16
+ <!--END STABILITY BANNER-->
17
+
18
+ This construct library allows you to define S3 object lambda access points.
19
+
20
+ ```python
21
+ import aws_cdk.aws_lambda as lambda_
22
+ import aws_cdk.aws_s3 as s3
23
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
24
+ import aws_cdk as cdk
25
+
26
+ stack = cdk.Stack()
27
+ bucket = s3.Bucket(stack, "MyBucket")
28
+ handler = lambda_.Function(stack, "MyFunction",
29
+ runtime=lambda_.Runtime.NODEJS_LATEST,
30
+ handler="index.handler",
31
+ code=lambda_.Code.from_asset("lambda.zip")
32
+ )
33
+ s3objectlambda.AccessPoint(stack, "MyObjectLambda",
34
+ bucket=bucket,
35
+ handler=handler,
36
+ access_point_name="my-access-point",
37
+ payload={
38
+ "prop": "value"
39
+ }
40
+ )
41
+ ```
42
+
43
+ ## Handling range and part number requests
44
+
45
+ Lambdas are currently limited to only transforming `GetObject` requests. However, they can additionally support `GetObject-Range` and `GetObject-PartNumber` requests, which needs to be specified in the access point configuration:
46
+
47
+ ```python
48
+ import aws_cdk.aws_lambda as lambda_
49
+ import aws_cdk.aws_s3 as s3
50
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
51
+ import aws_cdk as cdk
52
+
53
+ stack = cdk.Stack()
54
+ bucket = s3.Bucket(stack, "MyBucket")
55
+ handler = lambda_.Function(stack, "MyFunction",
56
+ runtime=lambda_.Runtime.NODEJS_LATEST,
57
+ handler="index.handler",
58
+ code=lambda_.Code.from_asset("lambda.zip")
59
+ )
60
+ s3objectlambda.AccessPoint(stack, "MyObjectLambda",
61
+ bucket=bucket,
62
+ handler=handler,
63
+ access_point_name="my-access-point",
64
+ supports_get_object_range=True,
65
+ supports_get_object_part_number=True
66
+ )
67
+ ```
68
+
69
+ ## Pass additional data to Lambda function
70
+
71
+ You can specify an additional object that provides supplemental data to the Lambda function used to transform objects. The data is delivered as a JSON payload to the Lambda:
72
+
73
+ ```python
74
+ import aws_cdk.aws_lambda as lambda_
75
+ import aws_cdk.aws_s3 as s3
76
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
77
+ import aws_cdk as cdk
78
+
79
+ stack = cdk.Stack()
80
+ bucket = s3.Bucket(stack, "MyBucket")
81
+ handler = lambda_.Function(stack, "MyFunction",
82
+ runtime=lambda_.Runtime.NODEJS_LATEST,
83
+ handler="index.handler",
84
+ code=lambda_.Code.from_asset("lambda.zip")
85
+ )
86
+ s3objectlambda.AccessPoint(stack, "MyObjectLambda",
87
+ bucket=bucket,
88
+ handler=handler,
89
+ access_point_name="my-access-point",
90
+ payload={
91
+ "prop": "value"
92
+ }
93
+ )
94
+ ```
95
+
96
+ ## Accessing the S3 AccessPoint ARN
97
+
98
+ If you need access to the s3 accesspoint, you can get its ARN like so:
99
+
100
+ ```python
101
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
102
+
103
+ # access_point: s3objectlambda.AccessPoint
104
+ s3_access_point_arn = access_point.s3_access_point_arn
105
+ ```
106
+
107
+ This is only supported for AccessPoints created in the stack - currently you're unable to get the S3 AccessPoint ARN for imported AccessPoints. To do that you'd have to know the S3 bucket name beforehand.
108
+ '''
109
+ from pkgutil import extend_path
110
+ __path__ = extend_path(__path__, __name__)
111
+
112
+ import abc
113
+ import builtins
114
+ import datetime
115
+ import enum
116
+ import typing
117
+
118
+ import jsii
119
+ import publication
120
+ import typing_extensions
121
+
122
+ import typeguard
123
+ from importlib.metadata import version as _metadata_package_version
124
+ TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
125
+
126
+ def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
127
+ if TYPEGUARD_MAJOR_VERSION <= 2:
128
+ return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
129
+ else:
130
+ if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
131
+ pass
132
+ else:
133
+ if TYPEGUARD_MAJOR_VERSION == 3:
134
+ typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
135
+ typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
136
+ else:
137
+ typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
138
+
139
+ from ._jsii import *
140
+
141
+ import aws_cdk as _aws_cdk_ceddda9d
142
+ import aws_cdk.aws_lambda as _aws_cdk_aws_lambda_ceddda9d
143
+ import aws_cdk.aws_s3 as _aws_cdk_aws_s3_ceddda9d
144
+ import aws_cdk.interfaces.aws_s3 as _aws_cdk_interfaces_aws_s3_ceddda9d
145
+ import constructs as _constructs_77d1e7e8
146
+
147
+
148
+ @jsii.data_type(
149
+ jsii_type="@aws-cdk/aws-s3objectlambda-alpha.AccessPointAttributes",
150
+ jsii_struct_bases=[],
151
+ name_mapping={
152
+ "access_point_arn": "accessPointArn",
153
+ "access_point_creation_date": "accessPointCreationDate",
154
+ },
155
+ )
156
+ class AccessPointAttributes:
157
+ def __init__(
158
+ self,
159
+ *,
160
+ access_point_arn: builtins.str,
161
+ access_point_creation_date: builtins.str,
162
+ ) -> None:
163
+ '''(experimental) The access point resource attributes.
164
+
165
+ :param access_point_arn: (experimental) The ARN of the access point.
166
+ :param access_point_creation_date: (experimental) The creation data of the access point.
167
+
168
+ :stability: experimental
169
+ :exampleMetadata: fixture=_generated
170
+
171
+ Example::
172
+
173
+ # The code below shows an example of how to instantiate this type.
174
+ # The values are placeholders you should change.
175
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda_alpha
176
+
177
+ access_point_attributes = s3objectlambda_alpha.AccessPointAttributes(
178
+ access_point_arn="accessPointArn",
179
+ access_point_creation_date="accessPointCreationDate"
180
+ )
181
+ '''
182
+ if __debug__:
183
+ type_hints = typing.get_type_hints(_typecheckingstub__0230e1b13ccb26118a2d6924aa169bbf363d9012ac28ab92e5bdece75adeba54)
184
+ check_type(argname="argument access_point_arn", value=access_point_arn, expected_type=type_hints["access_point_arn"])
185
+ check_type(argname="argument access_point_creation_date", value=access_point_creation_date, expected_type=type_hints["access_point_creation_date"])
186
+ self._values: typing.Dict[builtins.str, typing.Any] = {
187
+ "access_point_arn": access_point_arn,
188
+ "access_point_creation_date": access_point_creation_date,
189
+ }
190
+
191
+ @builtins.property
192
+ def access_point_arn(self) -> builtins.str:
193
+ '''(experimental) The ARN of the access point.
194
+
195
+ :stability: experimental
196
+ '''
197
+ result = self._values.get("access_point_arn")
198
+ assert result is not None, "Required property 'access_point_arn' is missing"
199
+ return typing.cast(builtins.str, result)
200
+
201
+ @builtins.property
202
+ def access_point_creation_date(self) -> builtins.str:
203
+ '''(experimental) The creation data of the access point.
204
+
205
+ :stability: experimental
206
+ '''
207
+ result = self._values.get("access_point_creation_date")
208
+ assert result is not None, "Required property 'access_point_creation_date' is missing"
209
+ return typing.cast(builtins.str, result)
210
+
211
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
212
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
213
+
214
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
215
+ return not (rhs == self)
216
+
217
+ def __repr__(self) -> str:
218
+ return "AccessPointAttributes(%s)" % ", ".join(
219
+ k + "=" + repr(v) for k, v in self._values.items()
220
+ )
221
+
222
+
223
+ @jsii.data_type(
224
+ jsii_type="@aws-cdk/aws-s3objectlambda-alpha.AccessPointProps",
225
+ jsii_struct_bases=[],
226
+ name_mapping={
227
+ "bucket": "bucket",
228
+ "handler": "handler",
229
+ "access_point_name": "accessPointName",
230
+ "cloud_watch_metrics_enabled": "cloudWatchMetricsEnabled",
231
+ "payload": "payload",
232
+ "supports_get_object_part_number": "supportsGetObjectPartNumber",
233
+ "supports_get_object_range": "supportsGetObjectRange",
234
+ },
235
+ )
236
+ class AccessPointProps:
237
+ def __init__(
238
+ self,
239
+ *,
240
+ bucket: _aws_cdk_interfaces_aws_s3_ceddda9d.IBucketRef,
241
+ handler: _aws_cdk_aws_lambda_ceddda9d.IFunction,
242
+ access_point_name: typing.Optional[builtins.str] = None,
243
+ cloud_watch_metrics_enabled: typing.Optional[builtins.bool] = None,
244
+ payload: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
245
+ supports_get_object_part_number: typing.Optional[builtins.bool] = None,
246
+ supports_get_object_range: typing.Optional[builtins.bool] = None,
247
+ ) -> None:
248
+ '''(experimental) The S3 object lambda access point configuration.
249
+
250
+ :param bucket: (experimental) The bucket to which this access point belongs.
251
+ :param handler: (experimental) The Lambda function used to transform objects.
252
+ :param access_point_name: (experimental) The name of the S3 object lambda access point. Default: a unique name will be generated
253
+ :param cloud_watch_metrics_enabled: (experimental) Whether CloudWatch metrics are enabled for the access point. Default: false
254
+ :param payload: (experimental) Additional JSON that provides supplemental data passed to the Lambda function on every request. Default: - No data.
255
+ :param supports_get_object_part_number: (experimental) Whether the Lambda function can process ``GetObject-PartNumber`` requests. Default: false
256
+ :param supports_get_object_range: (experimental) Whether the Lambda function can process ``GetObject-Range`` requests. Default: false
257
+
258
+ :stability: experimental
259
+ :exampleMetadata: infused
260
+
261
+ Example::
262
+
263
+ import aws_cdk.aws_lambda as lambda_
264
+ import aws_cdk.aws_s3 as s3
265
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
266
+ import aws_cdk as cdk
267
+
268
+ stack = cdk.Stack()
269
+ bucket = s3.Bucket(stack, "MyBucket")
270
+ handler = lambda_.Function(stack, "MyFunction",
271
+ runtime=lambda_.Runtime.NODEJS_LATEST,
272
+ handler="index.handler",
273
+ code=lambda_.Code.from_asset("lambda.zip")
274
+ )
275
+ s3objectlambda.AccessPoint(stack, "MyObjectLambda",
276
+ bucket=bucket,
277
+ handler=handler,
278
+ access_point_name="my-access-point",
279
+ payload={
280
+ "prop": "value"
281
+ }
282
+ )
283
+ '''
284
+ if __debug__:
285
+ type_hints = typing.get_type_hints(_typecheckingstub__7361024364627526d9d95a93129e98a3630928fbfc60102de59d835f2e578216)
286
+ check_type(argname="argument bucket", value=bucket, expected_type=type_hints["bucket"])
287
+ check_type(argname="argument handler", value=handler, expected_type=type_hints["handler"])
288
+ check_type(argname="argument access_point_name", value=access_point_name, expected_type=type_hints["access_point_name"])
289
+ check_type(argname="argument cloud_watch_metrics_enabled", value=cloud_watch_metrics_enabled, expected_type=type_hints["cloud_watch_metrics_enabled"])
290
+ check_type(argname="argument payload", value=payload, expected_type=type_hints["payload"])
291
+ check_type(argname="argument supports_get_object_part_number", value=supports_get_object_part_number, expected_type=type_hints["supports_get_object_part_number"])
292
+ check_type(argname="argument supports_get_object_range", value=supports_get_object_range, expected_type=type_hints["supports_get_object_range"])
293
+ self._values: typing.Dict[builtins.str, typing.Any] = {
294
+ "bucket": bucket,
295
+ "handler": handler,
296
+ }
297
+ if access_point_name is not None:
298
+ self._values["access_point_name"] = access_point_name
299
+ if cloud_watch_metrics_enabled is not None:
300
+ self._values["cloud_watch_metrics_enabled"] = cloud_watch_metrics_enabled
301
+ if payload is not None:
302
+ self._values["payload"] = payload
303
+ if supports_get_object_part_number is not None:
304
+ self._values["supports_get_object_part_number"] = supports_get_object_part_number
305
+ if supports_get_object_range is not None:
306
+ self._values["supports_get_object_range"] = supports_get_object_range
307
+
308
+ @builtins.property
309
+ def bucket(self) -> _aws_cdk_interfaces_aws_s3_ceddda9d.IBucketRef:
310
+ '''(experimental) The bucket to which this access point belongs.
311
+
312
+ :stability: experimental
313
+ '''
314
+ result = self._values.get("bucket")
315
+ assert result is not None, "Required property 'bucket' is missing"
316
+ return typing.cast(_aws_cdk_interfaces_aws_s3_ceddda9d.IBucketRef, result)
317
+
318
+ @builtins.property
319
+ def handler(self) -> _aws_cdk_aws_lambda_ceddda9d.IFunction:
320
+ '''(experimental) The Lambda function used to transform objects.
321
+
322
+ :stability: experimental
323
+ '''
324
+ result = self._values.get("handler")
325
+ assert result is not None, "Required property 'handler' is missing"
326
+ return typing.cast(_aws_cdk_aws_lambda_ceddda9d.IFunction, result)
327
+
328
+ @builtins.property
329
+ def access_point_name(self) -> typing.Optional[builtins.str]:
330
+ '''(experimental) The name of the S3 object lambda access point.
331
+
332
+ :default: a unique name will be generated
333
+
334
+ :stability: experimental
335
+ '''
336
+ result = self._values.get("access_point_name")
337
+ return typing.cast(typing.Optional[builtins.str], result)
338
+
339
+ @builtins.property
340
+ def cloud_watch_metrics_enabled(self) -> typing.Optional[builtins.bool]:
341
+ '''(experimental) Whether CloudWatch metrics are enabled for the access point.
342
+
343
+ :default: false
344
+
345
+ :stability: experimental
346
+ '''
347
+ result = self._values.get("cloud_watch_metrics_enabled")
348
+ return typing.cast(typing.Optional[builtins.bool], result)
349
+
350
+ @builtins.property
351
+ def payload(self) -> typing.Optional[typing.Mapping[builtins.str, typing.Any]]:
352
+ '''(experimental) Additional JSON that provides supplemental data passed to the Lambda function on every request.
353
+
354
+ :default: - No data.
355
+
356
+ :stability: experimental
357
+ '''
358
+ result = self._values.get("payload")
359
+ return typing.cast(typing.Optional[typing.Mapping[builtins.str, typing.Any]], result)
360
+
361
+ @builtins.property
362
+ def supports_get_object_part_number(self) -> typing.Optional[builtins.bool]:
363
+ '''(experimental) Whether the Lambda function can process ``GetObject-PartNumber`` requests.
364
+
365
+ :default: false
366
+
367
+ :stability: experimental
368
+ '''
369
+ result = self._values.get("supports_get_object_part_number")
370
+ return typing.cast(typing.Optional[builtins.bool], result)
371
+
372
+ @builtins.property
373
+ def supports_get_object_range(self) -> typing.Optional[builtins.bool]:
374
+ '''(experimental) Whether the Lambda function can process ``GetObject-Range`` requests.
375
+
376
+ :default: false
377
+
378
+ :stability: experimental
379
+ '''
380
+ result = self._values.get("supports_get_object_range")
381
+ return typing.cast(typing.Optional[builtins.bool], result)
382
+
383
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
384
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
385
+
386
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
387
+ return not (rhs == self)
388
+
389
+ def __repr__(self) -> str:
390
+ return "AccessPointProps(%s)" % ", ".join(
391
+ k + "=" + repr(v) for k, v in self._values.items()
392
+ )
393
+
394
+
395
+ @jsii.interface(jsii_type="@aws-cdk/aws-s3objectlambda-alpha.IAccessPoint")
396
+ class IAccessPoint(_aws_cdk_ceddda9d.IResource, typing_extensions.Protocol):
397
+ '''(experimental) The interface that represents the AccessPoint resource.
398
+
399
+ :stability: experimental
400
+ '''
401
+
402
+ @builtins.property
403
+ @jsii.member(jsii_name="accessPointArn")
404
+ def access_point_arn(self) -> builtins.str:
405
+ '''(experimental) The ARN of the access point.
406
+
407
+ :stability: experimental
408
+ :attribute: true
409
+ '''
410
+ ...
411
+
412
+ @builtins.property
413
+ @jsii.member(jsii_name="accessPointCreationDate")
414
+ def access_point_creation_date(self) -> builtins.str:
415
+ '''(experimental) The creation data of the access point.
416
+
417
+ :stability: experimental
418
+ :attribute: true
419
+ '''
420
+ ...
421
+
422
+ @builtins.property
423
+ @jsii.member(jsii_name="domainName")
424
+ def domain_name(self) -> builtins.str:
425
+ '''(experimental) The IPv4 DNS name of the access point.
426
+
427
+ :stability: experimental
428
+ '''
429
+ ...
430
+
431
+ @builtins.property
432
+ @jsii.member(jsii_name="regionalDomainName")
433
+ def regional_domain_name(self) -> builtins.str:
434
+ '''(experimental) The regional domain name of the access point.
435
+
436
+ :stability: experimental
437
+ '''
438
+ ...
439
+
440
+ @jsii.member(jsii_name="virtualHostedUrlForObject")
441
+ def virtual_hosted_url_for_object(
442
+ self,
443
+ key: typing.Optional[builtins.str] = None,
444
+ *,
445
+ regional: typing.Optional[builtins.bool] = None,
446
+ ) -> builtins.str:
447
+ '''(experimental) The virtual hosted-style URL of an S3 object through this access point.
448
+
449
+ Specify ``regional: false`` at the options for non-regional URL.
450
+
451
+ :param key: The S3 key of the object. If not specified, the URL of the bucket is returned.
452
+ :param regional: Specifies the URL includes the region. Default: - true
453
+
454
+ :return: an ObjectS3Url token
455
+
456
+ :stability: experimental
457
+ '''
458
+ ...
459
+
460
+
461
+ class _IAccessPointProxy(
462
+ jsii.proxy_for(_aws_cdk_ceddda9d.IResource), # type: ignore[misc]
463
+ ):
464
+ '''(experimental) The interface that represents the AccessPoint resource.
465
+
466
+ :stability: experimental
467
+ '''
468
+
469
+ __jsii_type__: typing.ClassVar[str] = "@aws-cdk/aws-s3objectlambda-alpha.IAccessPoint"
470
+
471
+ @builtins.property
472
+ @jsii.member(jsii_name="accessPointArn")
473
+ def access_point_arn(self) -> builtins.str:
474
+ '''(experimental) The ARN of the access point.
475
+
476
+ :stability: experimental
477
+ :attribute: true
478
+ '''
479
+ return typing.cast(builtins.str, jsii.get(self, "accessPointArn"))
480
+
481
+ @builtins.property
482
+ @jsii.member(jsii_name="accessPointCreationDate")
483
+ def access_point_creation_date(self) -> builtins.str:
484
+ '''(experimental) The creation data of the access point.
485
+
486
+ :stability: experimental
487
+ :attribute: true
488
+ '''
489
+ return typing.cast(builtins.str, jsii.get(self, "accessPointCreationDate"))
490
+
491
+ @builtins.property
492
+ @jsii.member(jsii_name="domainName")
493
+ def domain_name(self) -> builtins.str:
494
+ '''(experimental) The IPv4 DNS name of the access point.
495
+
496
+ :stability: experimental
497
+ '''
498
+ return typing.cast(builtins.str, jsii.get(self, "domainName"))
499
+
500
+ @builtins.property
501
+ @jsii.member(jsii_name="regionalDomainName")
502
+ def regional_domain_name(self) -> builtins.str:
503
+ '''(experimental) The regional domain name of the access point.
504
+
505
+ :stability: experimental
506
+ '''
507
+ return typing.cast(builtins.str, jsii.get(self, "regionalDomainName"))
508
+
509
+ @jsii.member(jsii_name="virtualHostedUrlForObject")
510
+ def virtual_hosted_url_for_object(
511
+ self,
512
+ key: typing.Optional[builtins.str] = None,
513
+ *,
514
+ regional: typing.Optional[builtins.bool] = None,
515
+ ) -> builtins.str:
516
+ '''(experimental) The virtual hosted-style URL of an S3 object through this access point.
517
+
518
+ Specify ``regional: false`` at the options for non-regional URL.
519
+
520
+ :param key: The S3 key of the object. If not specified, the URL of the bucket is returned.
521
+ :param regional: Specifies the URL includes the region. Default: - true
522
+
523
+ :return: an ObjectS3Url token
524
+
525
+ :stability: experimental
526
+ '''
527
+ if __debug__:
528
+ type_hints = typing.get_type_hints(_typecheckingstub__67fface5f7e916cc919d9842615bb749d04e349ffaff48f6b7ee7f5062839d51)
529
+ check_type(argname="argument key", value=key, expected_type=type_hints["key"])
530
+ options = _aws_cdk_aws_s3_ceddda9d.VirtualHostedStyleUrlOptions(
531
+ regional=regional
532
+ )
533
+
534
+ return typing.cast(builtins.str, jsii.invoke(self, "virtualHostedUrlForObject", [key, options]))
535
+
536
+ # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
537
+ typing.cast(typing.Any, IAccessPoint).__jsii_proxy_class__ = lambda : _IAccessPointProxy
538
+
539
+
540
+ @jsii.implements(IAccessPoint)
541
+ class AccessPoint(
542
+ _aws_cdk_ceddda9d.Resource,
543
+ metaclass=jsii.JSIIMeta,
544
+ jsii_type="@aws-cdk/aws-s3objectlambda-alpha.AccessPoint",
545
+ ):
546
+ '''(experimental) An S3 object lambda access point for intercepting and transforming ``GetObject`` requests.
547
+
548
+ :stability: experimental
549
+ :exampleMetadata: infused
550
+
551
+ Example::
552
+
553
+ import aws_cdk.aws_lambda as lambda_
554
+ import aws_cdk.aws_s3 as s3
555
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
556
+ import aws_cdk as cdk
557
+
558
+ stack = cdk.Stack()
559
+ bucket = s3.Bucket(stack, "MyBucket")
560
+ handler = lambda_.Function(stack, "MyFunction",
561
+ runtime=lambda_.Runtime.NODEJS_LATEST,
562
+ handler="index.handler",
563
+ code=lambda_.Code.from_asset("lambda.zip")
564
+ )
565
+ s3objectlambda.AccessPoint(stack, "MyObjectLambda",
566
+ bucket=bucket,
567
+ handler=handler,
568
+ access_point_name="my-access-point",
569
+ payload={
570
+ "prop": "value"
571
+ }
572
+ )
573
+ '''
574
+
575
+ def __init__(
576
+ self,
577
+ scope: _constructs_77d1e7e8.Construct,
578
+ id: builtins.str,
579
+ *,
580
+ bucket: _aws_cdk_interfaces_aws_s3_ceddda9d.IBucketRef,
581
+ handler: _aws_cdk_aws_lambda_ceddda9d.IFunction,
582
+ access_point_name: typing.Optional[builtins.str] = None,
583
+ cloud_watch_metrics_enabled: typing.Optional[builtins.bool] = None,
584
+ payload: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
585
+ supports_get_object_part_number: typing.Optional[builtins.bool] = None,
586
+ supports_get_object_range: typing.Optional[builtins.bool] = None,
587
+ ) -> None:
588
+ '''
589
+ :param scope: -
590
+ :param id: -
591
+ :param bucket: (experimental) The bucket to which this access point belongs.
592
+ :param handler: (experimental) The Lambda function used to transform objects.
593
+ :param access_point_name: (experimental) The name of the S3 object lambda access point. Default: a unique name will be generated
594
+ :param cloud_watch_metrics_enabled: (experimental) Whether CloudWatch metrics are enabled for the access point. Default: false
595
+ :param payload: (experimental) Additional JSON that provides supplemental data passed to the Lambda function on every request. Default: - No data.
596
+ :param supports_get_object_part_number: (experimental) Whether the Lambda function can process ``GetObject-PartNumber`` requests. Default: false
597
+ :param supports_get_object_range: (experimental) Whether the Lambda function can process ``GetObject-Range`` requests. Default: false
598
+
599
+ :stability: experimental
600
+ '''
601
+ if __debug__:
602
+ type_hints = typing.get_type_hints(_typecheckingstub__67d3988c298656f8a20bc1bb8831c927675995c72e2536eb9a5a54701a50604d)
603
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
604
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
605
+ props = AccessPointProps(
606
+ bucket=bucket,
607
+ handler=handler,
608
+ access_point_name=access_point_name,
609
+ cloud_watch_metrics_enabled=cloud_watch_metrics_enabled,
610
+ payload=payload,
611
+ supports_get_object_part_number=supports_get_object_part_number,
612
+ supports_get_object_range=supports_get_object_range,
613
+ )
614
+
615
+ jsii.create(self.__class__, self, [scope, id, props])
616
+
617
+ @jsii.member(jsii_name="fromAccessPointAttributes")
618
+ @builtins.classmethod
619
+ def from_access_point_attributes(
620
+ cls,
621
+ scope: _constructs_77d1e7e8.Construct,
622
+ id: builtins.str,
623
+ *,
624
+ access_point_arn: builtins.str,
625
+ access_point_creation_date: builtins.str,
626
+ ) -> IAccessPoint:
627
+ '''(experimental) Reference an existing AccessPoint defined outside of the CDK code.
628
+
629
+ :param scope: -
630
+ :param id: -
631
+ :param access_point_arn: (experimental) The ARN of the access point.
632
+ :param access_point_creation_date: (experimental) The creation data of the access point.
633
+
634
+ :stability: experimental
635
+ '''
636
+ if __debug__:
637
+ type_hints = typing.get_type_hints(_typecheckingstub__3f7a575152ecb79f8c1a581a6380dd1d19647cb5400ed33bf474e24ba006eec2)
638
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
639
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
640
+ attrs = AccessPointAttributes(
641
+ access_point_arn=access_point_arn,
642
+ access_point_creation_date=access_point_creation_date,
643
+ )
644
+
645
+ return typing.cast(IAccessPoint, jsii.sinvoke(cls, "fromAccessPointAttributes", [scope, id, attrs]))
646
+
647
+ @jsii.member(jsii_name="virtualHostedUrlForObject")
648
+ def virtual_hosted_url_for_object(
649
+ self,
650
+ key: typing.Optional[builtins.str] = None,
651
+ *,
652
+ regional: typing.Optional[builtins.bool] = None,
653
+ ) -> builtins.str:
654
+ '''(experimental) Implement the ``IAccessPoint.virtualHostedUrlForObject`` method.
655
+
656
+ :param key: -
657
+ :param regional: Specifies the URL includes the region. Default: - true
658
+
659
+ :stability: experimental
660
+ '''
661
+ if __debug__:
662
+ type_hints = typing.get_type_hints(_typecheckingstub__09c101e5c7a6e056b459659f7b32d595e1b600b7f62871dd6060de26251f9f04)
663
+ check_type(argname="argument key", value=key, expected_type=type_hints["key"])
664
+ options = _aws_cdk_aws_s3_ceddda9d.VirtualHostedStyleUrlOptions(
665
+ regional=regional
666
+ )
667
+
668
+ return typing.cast(builtins.str, jsii.invoke(self, "virtualHostedUrlForObject", [key, options]))
669
+
670
+ @jsii.python.classproperty
671
+ @jsii.member(jsii_name="PROPERTY_INJECTION_ID")
672
+ def PROPERTY_INJECTION_ID(cls) -> builtins.str:
673
+ '''(experimental) Uniquely identifies this class.
674
+
675
+ :stability: experimental
676
+ '''
677
+ return typing.cast(builtins.str, jsii.sget(cls, "PROPERTY_INJECTION_ID"))
678
+
679
+ @builtins.property
680
+ @jsii.member(jsii_name="accessPointArn")
681
+ def access_point_arn(self) -> builtins.str:
682
+ '''(experimental) The ARN of the access point.
683
+
684
+ :stability: experimental
685
+ :attribute: true
686
+ '''
687
+ return typing.cast(builtins.str, jsii.get(self, "accessPointArn"))
688
+
689
+ @builtins.property
690
+ @jsii.member(jsii_name="accessPointCreationDate")
691
+ def access_point_creation_date(self) -> builtins.str:
692
+ '''(experimental) The creation data of the access point.
693
+
694
+ :stability: experimental
695
+ :attribute: true
696
+ '''
697
+ return typing.cast(builtins.str, jsii.get(self, "accessPointCreationDate"))
698
+
699
+ @builtins.property
700
+ @jsii.member(jsii_name="accessPointName")
701
+ def access_point_name(self) -> builtins.str:
702
+ '''(experimental) The ARN of the access point.
703
+
704
+ :stability: experimental
705
+ '''
706
+ return typing.cast(builtins.str, jsii.get(self, "accessPointName"))
707
+
708
+ @builtins.property
709
+ @jsii.member(jsii_name="domainName")
710
+ def domain_name(self) -> builtins.str:
711
+ '''(experimental) Implement the ``IAccessPoint.domainName`` field.
712
+
713
+ :stability: experimental
714
+ '''
715
+ return typing.cast(builtins.str, jsii.get(self, "domainName"))
716
+
717
+ @builtins.property
718
+ @jsii.member(jsii_name="regionalDomainName")
719
+ def regional_domain_name(self) -> builtins.str:
720
+ '''(experimental) Implement the ``IAccessPoint.regionalDomainName`` field.
721
+
722
+ :stability: experimental
723
+ '''
724
+ return typing.cast(builtins.str, jsii.get(self, "regionalDomainName"))
725
+
726
+ @builtins.property
727
+ @jsii.member(jsii_name="s3AccessPointArn")
728
+ def s3_access_point_arn(self) -> builtins.str:
729
+ '''(experimental) The ARN of the S3 access point.
730
+
731
+ :stability: experimental
732
+ '''
733
+ return typing.cast(builtins.str, jsii.get(self, "s3AccessPointArn"))
734
+
735
+
736
+ __all__ = [
737
+ "AccessPoint",
738
+ "AccessPointAttributes",
739
+ "AccessPointProps",
740
+ "IAccessPoint",
741
+ ]
742
+
743
+ publication.publish()
744
+
745
+ def _typecheckingstub__0230e1b13ccb26118a2d6924aa169bbf363d9012ac28ab92e5bdece75adeba54(
746
+ *,
747
+ access_point_arn: builtins.str,
748
+ access_point_creation_date: builtins.str,
749
+ ) -> None:
750
+ """Type checking stubs"""
751
+ pass
752
+
753
+ def _typecheckingstub__7361024364627526d9d95a93129e98a3630928fbfc60102de59d835f2e578216(
754
+ *,
755
+ bucket: _aws_cdk_interfaces_aws_s3_ceddda9d.IBucketRef,
756
+ handler: _aws_cdk_aws_lambda_ceddda9d.IFunction,
757
+ access_point_name: typing.Optional[builtins.str] = None,
758
+ cloud_watch_metrics_enabled: typing.Optional[builtins.bool] = None,
759
+ payload: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
760
+ supports_get_object_part_number: typing.Optional[builtins.bool] = None,
761
+ supports_get_object_range: typing.Optional[builtins.bool] = None,
762
+ ) -> None:
763
+ """Type checking stubs"""
764
+ pass
765
+
766
+ def _typecheckingstub__67fface5f7e916cc919d9842615bb749d04e349ffaff48f6b7ee7f5062839d51(
767
+ key: typing.Optional[builtins.str] = None,
768
+ *,
769
+ regional: typing.Optional[builtins.bool] = None,
770
+ ) -> None:
771
+ """Type checking stubs"""
772
+ pass
773
+
774
+ def _typecheckingstub__67d3988c298656f8a20bc1bb8831c927675995c72e2536eb9a5a54701a50604d(
775
+ scope: _constructs_77d1e7e8.Construct,
776
+ id: builtins.str,
777
+ *,
778
+ bucket: _aws_cdk_interfaces_aws_s3_ceddda9d.IBucketRef,
779
+ handler: _aws_cdk_aws_lambda_ceddda9d.IFunction,
780
+ access_point_name: typing.Optional[builtins.str] = None,
781
+ cloud_watch_metrics_enabled: typing.Optional[builtins.bool] = None,
782
+ payload: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
783
+ supports_get_object_part_number: typing.Optional[builtins.bool] = None,
784
+ supports_get_object_range: typing.Optional[builtins.bool] = None,
785
+ ) -> None:
786
+ """Type checking stubs"""
787
+ pass
788
+
789
+ def _typecheckingstub__3f7a575152ecb79f8c1a581a6380dd1d19647cb5400ed33bf474e24ba006eec2(
790
+ scope: _constructs_77d1e7e8.Construct,
791
+ id: builtins.str,
792
+ *,
793
+ access_point_arn: builtins.str,
794
+ access_point_creation_date: builtins.str,
795
+ ) -> None:
796
+ """Type checking stubs"""
797
+ pass
798
+
799
+ def _typecheckingstub__09c101e5c7a6e056b459659f7b32d595e1b600b7f62871dd6060de26251f9f04(
800
+ key: typing.Optional[builtins.str] = None,
801
+ *,
802
+ regional: typing.Optional[builtins.bool] = None,
803
+ ) -> None:
804
+ """Type checking stubs"""
805
+ pass
806
+
807
+ for cls in [IAccessPoint]:
808
+ typing.cast(typing.Any, cls).__protocol_attrs__ = typing.cast(typing.Any, cls).__protocol_attrs__ - set(['__jsii_proxy_class__', '__jsii_type__'])
@@ -0,0 +1,45 @@
1
+ from pkgutil import extend_path
2
+ __path__ = extend_path(__path__, __name__)
3
+
4
+ import abc
5
+ import builtins
6
+ import datetime
7
+ import enum
8
+ import typing
9
+
10
+ import jsii
11
+ import publication
12
+ import typing_extensions
13
+
14
+ import typeguard
15
+ from importlib.metadata import version as _metadata_package_version
16
+ TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
17
+
18
+ def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
19
+ if TYPEGUARD_MAJOR_VERSION <= 2:
20
+ return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
21
+ else:
22
+ if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
23
+ pass
24
+ else:
25
+ if TYPEGUARD_MAJOR_VERSION == 3:
26
+ typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
27
+ typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
28
+ else:
29
+ typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
30
+
31
+ import aws_cdk._jsii
32
+ import constructs._jsii
33
+
34
+ __jsii_assembly__ = jsii.JSIIAssembly.load(
35
+ "@aws-cdk/aws-s3objectlambda-alpha",
36
+ "2.229.0-alpha.0",
37
+ __name__[0:-6],
38
+ "aws-s3objectlambda-alpha@2.229.0-alpha.0.jsii.tgz",
39
+ )
40
+
41
+ __all__ = [
42
+ "__jsii_assembly__",
43
+ ]
44
+
45
+ publication.publish()
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.1
2
+ Name: aws-cdk.aws-s3objectlambda-alpha
3
+ Version: 2.229.0a0
4
+ Summary: The CDK Construct Library for AWS::S3ObjectLambda
5
+ Home-page: https://github.com/aws/aws-cdk
6
+ Author: Amazon Web Services
7
+ License: Apache-2.0
8
+ Project-URL: Source, https://github.com/aws/aws-cdk.git
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: JavaScript
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Typing :: Typed
17
+ Classifier: Development Status :: 4 - Beta
18
+ Classifier: License :: OSI Approved
19
+ Classifier: Framework :: AWS CDK
20
+ Classifier: Framework :: AWS CDK :: 2
21
+ Requires-Python: ~=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ License-File: NOTICE
25
+ Requires-Dist: aws-cdk-lib <3.0.0,>=2.229.0
26
+ Requires-Dist: constructs <11.0.0,>=10.0.0
27
+ Requires-Dist: jsii <2.0.0,>=1.119.0
28
+ Requires-Dist: publication >=0.0.3
29
+ Requires-Dist: typeguard <4.3.0,>=2.13.3
30
+
31
+ # AWS::S3ObjectLambda Construct Library
32
+
33
+ <!--BEGIN STABILITY BANNER-->---
34
+
35
+
36
+ ![cdk-constructs: Experimental](https://img.shields.io/badge/cdk--constructs-experimental-important.svg?style=for-the-badge)
37
+
38
+ > The APIs of higher level constructs in this module are experimental and under active development.
39
+ > They are subject to non-backward compatible changes or removal in any future version. These are
40
+ > not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be
41
+ > announced in the release notes. This means that while you may use them, you may need to update
42
+ > your source code when upgrading to a newer version of this package.
43
+
44
+ ---
45
+ <!--END STABILITY BANNER-->
46
+
47
+ This construct library allows you to define S3 object lambda access points.
48
+
49
+ ```python
50
+ import aws_cdk.aws_lambda as lambda_
51
+ import aws_cdk.aws_s3 as s3
52
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
53
+ import aws_cdk as cdk
54
+
55
+ stack = cdk.Stack()
56
+ bucket = s3.Bucket(stack, "MyBucket")
57
+ handler = lambda_.Function(stack, "MyFunction",
58
+ runtime=lambda_.Runtime.NODEJS_LATEST,
59
+ handler="index.handler",
60
+ code=lambda_.Code.from_asset("lambda.zip")
61
+ )
62
+ s3objectlambda.AccessPoint(stack, "MyObjectLambda",
63
+ bucket=bucket,
64
+ handler=handler,
65
+ access_point_name="my-access-point",
66
+ payload={
67
+ "prop": "value"
68
+ }
69
+ )
70
+ ```
71
+
72
+ ## Handling range and part number requests
73
+
74
+ Lambdas are currently limited to only transforming `GetObject` requests. However, they can additionally support `GetObject-Range` and `GetObject-PartNumber` requests, which needs to be specified in the access point configuration:
75
+
76
+ ```python
77
+ import aws_cdk.aws_lambda as lambda_
78
+ import aws_cdk.aws_s3 as s3
79
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
80
+ import aws_cdk as cdk
81
+
82
+ stack = cdk.Stack()
83
+ bucket = s3.Bucket(stack, "MyBucket")
84
+ handler = lambda_.Function(stack, "MyFunction",
85
+ runtime=lambda_.Runtime.NODEJS_LATEST,
86
+ handler="index.handler",
87
+ code=lambda_.Code.from_asset("lambda.zip")
88
+ )
89
+ s3objectlambda.AccessPoint(stack, "MyObjectLambda",
90
+ bucket=bucket,
91
+ handler=handler,
92
+ access_point_name="my-access-point",
93
+ supports_get_object_range=True,
94
+ supports_get_object_part_number=True
95
+ )
96
+ ```
97
+
98
+ ## Pass additional data to Lambda function
99
+
100
+ You can specify an additional object that provides supplemental data to the Lambda function used to transform objects. The data is delivered as a JSON payload to the Lambda:
101
+
102
+ ```python
103
+ import aws_cdk.aws_lambda as lambda_
104
+ import aws_cdk.aws_s3 as s3
105
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
106
+ import aws_cdk as cdk
107
+
108
+ stack = cdk.Stack()
109
+ bucket = s3.Bucket(stack, "MyBucket")
110
+ handler = lambda_.Function(stack, "MyFunction",
111
+ runtime=lambda_.Runtime.NODEJS_LATEST,
112
+ handler="index.handler",
113
+ code=lambda_.Code.from_asset("lambda.zip")
114
+ )
115
+ s3objectlambda.AccessPoint(stack, "MyObjectLambda",
116
+ bucket=bucket,
117
+ handler=handler,
118
+ access_point_name="my-access-point",
119
+ payload={
120
+ "prop": "value"
121
+ }
122
+ )
123
+ ```
124
+
125
+ ## Accessing the S3 AccessPoint ARN
126
+
127
+ If you need access to the s3 accesspoint, you can get its ARN like so:
128
+
129
+ ```python
130
+ import aws_cdk.aws_s3objectlambda_alpha as s3objectlambda
131
+
132
+ # access_point: s3objectlambda.AccessPoint
133
+ s3_access_point_arn = access_point.s3_access_point_arn
134
+ ```
135
+
136
+ This is only supported for AccessPoints created in the stack - currently you're unable to get the S3 AccessPoint ARN for imported AccessPoints. To do that you'd have to know the S3 bucket name beforehand.
@@ -0,0 +1,2 @@
1
+ AWS Cloud Development Kit (AWS CDK)
2
+ Copyright 2018-2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -0,0 +1,10 @@
1
+ aws_cdk/aws_s3objectlambda_alpha/__init__.py,sha256=7HXXaOKPSFc7F5QXDFtgB46G1yy5lF1pBtCjNMZLOMI,31513
2
+ aws_cdk/aws_s3objectlambda_alpha/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
+ aws_cdk/aws_s3objectlambda_alpha/_jsii/__init__.py,sha256=_PosRz7zc_F2QiREqrixxAuTpHY9RsYFik_IV4tcV_g,1501
4
+ aws_cdk/aws_s3objectlambda_alpha/_jsii/aws-s3objectlambda-alpha@2.229.0-alpha.0.jsii.tgz,sha256=1qvoWKupT-vTwRt-zuMx1vfwcyIic-eEy6IVqm2mLTQ,39119
5
+ aws_cdk_aws_s3objectlambda_alpha-2.229.0a0.dist-info/LICENSE,sha256=y47tc38H0C4DpGljYUZDl8XxidQjNxxGLq-K4jwv6Xc,11391
6
+ aws_cdk_aws_s3objectlambda_alpha-2.229.0a0.dist-info/METADATA,sha256=MDvR3_RQUrnfuchYaLlrUO67Wuah8RIC_mmot8gz_W4,4607
7
+ aws_cdk_aws_s3objectlambda_alpha-2.229.0a0.dist-info/NOTICE,sha256=ZDV6_xBfMvhFtjjBh_f6lJjhZ2AEWWAGGkx2kLKHiuc,113
8
+ aws_cdk_aws_s3objectlambda_alpha-2.229.0a0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
9
+ aws_cdk_aws_s3objectlambda_alpha-2.229.0a0.dist-info/top_level.txt,sha256=1TALAKbuUGsMSrfKWEf268lySCmcqSEO6cDYe_XlLHM,8
10
+ aws_cdk_aws_s3objectlambda_alpha-2.229.0a0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.3.2)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+