aws-solutions-constructs.aws-lambda-transcribe 2.95.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.
@@ -0,0 +1,654 @@
1
+ r'''
2
+ # aws-lambda-transcribe module
3
+
4
+ <!--BEGIN STABILITY BANNER-->---
5
+
6
+
7
+ ![Stability: Experimental](https://img.shields.io/badge/stability-Experimental-important.svg?style=for-the-badge)
8
+
9
+ ---
10
+ <!--END STABILITY BANNER-->
11
+
12
+ | **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
13
+ |:-------------|:-------------|
14
+
15
+ <div style="height:8px"></div>
16
+
17
+ | **Language** | **Package** |
18
+ |:-------------|-----------------|
19
+ |![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_lambda_transcribe`|
20
+ |![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-lambda-transcribe`|
21
+ |![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.lambdatranscribe`|
22
+
23
+ ## Overview
24
+
25
+ This AWS Solutions Construct implements an AWS Lambda function connected to Amazon S3 buckets for use with Amazon Transcribe.
26
+
27
+ Here is a minimal deployable pattern definition:
28
+
29
+ Typescript
30
+
31
+ ```python
32
+ import { Construct } from 'constructs';
33
+ import { Stack, StackProps } from 'aws-cdk-lib';
34
+ import { LambdaToTranscribe } from '@aws-solutions-constructs/aws-lambda-transcribe';
35
+ import * as lambda from 'aws-cdk-lib/aws-lambda';
36
+
37
+ new LambdaToTranscribe(this, 'LambdaToTranscribePattern', {
38
+ lambdaFunctionProps: {
39
+ runtime: lambda.Runtime.NODEJS_20_X,
40
+ handler: 'index.handler',
41
+ code: lambda.Code.fromAsset(`lambda`)
42
+ }
43
+ });
44
+ ```
45
+
46
+ Python
47
+
48
+ ```python
49
+ from aws_solutions_constructs.aws_lambda_transcribe import LambdaToTranscribe
50
+ from aws_cdk import (
51
+ aws_lambda as _lambda,
52
+ Stack
53
+ )
54
+ from constructs import Construct
55
+
56
+ LambdaToTranscribe(self, 'LambdaToTranscribePattern',
57
+ lambda_function_props=_lambda.FunctionProps(
58
+ code=_lambda.Code.from_asset('lambda'),
59
+ runtime=_lambda.Runtime.PYTHON_3_11,
60
+ handler='index.handler'
61
+ )
62
+ )
63
+ ```
64
+
65
+ Java
66
+
67
+ ```java
68
+ import software.constructs.Construct;
69
+
70
+ import software.amazon.awscdk.Stack;
71
+ import software.amazon.awscdk.StackProps;
72
+ import software.amazon.awscdk.services.lambda.*;
73
+ import software.amazon.awscdk.services.lambda.Runtime;
74
+ import software.amazon.awsconstructs.services.lambdatranscribe.*;
75
+
76
+ new LambdaToTranscribe(this, "LambdaToTranscribePattern", new LambdaToTranscribeProps.Builder()
77
+ .lambdaFunctionProps(new FunctionProps.Builder()
78
+ .runtime(Runtime.NODEJS_20_X)
79
+ .code(Code.fromAsset("lambda"))
80
+ .handler("index.handler")
81
+ .build())
82
+ .build());
83
+ ```
84
+
85
+ ## Pattern Construct Props
86
+
87
+ | **Name** | **Type** | **Description** |
88
+ |:-------------|:----------------|-----------------|
89
+ |existingLambdaObj?|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.|
90
+ |lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.FunctionProps.html)|Optional user provided props to override the default props for the Lambda function.|
91
+ |existingSourceBucketObj?|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html)|Existing instance of S3 Bucket object for source audio files.|
92
+ |sourceBucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.BucketProps.html)|Optional user provided props to override the default props for the source S3 Bucket.|
93
+ |existingDestinationBucketObj?|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html)|Existing instance of S3 Bucket object for transcription results.|
94
+ |destinationBucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.BucketProps.html)|Optional user provided props to override the default props for the destination S3 Bucket.|
95
+ |useSameBucket?|`boolean`|Whether to use the same S3 bucket for both source and destination files. Default: false|
96
+
97
+ ## Pattern Properties
98
+
99
+ | **Name** | **Type** | **Description** |
100
+ |:-------------|:----------------|-----------------|
101
+ |lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of the Lambda function created by the pattern.|
102
+ |sourceBucket?|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html)|Returns an instance of the source S3 bucket created by the pattern.|
103
+ |destinationBucket?|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html)|Returns an instance of the destination S3 bucket created by the pattern.|
104
+
105
+ ## Default settings
106
+
107
+ Out of the box implementation of the Construct without any override will set the following defaults:
108
+
109
+ ### AWS Lambda Function
110
+
111
+ * Configure limited privilege access IAM role for Lambda function
112
+ * Enable reusing connections with Keep-Alive for NodeJs Lambda function
113
+ * Enable X-Ray Tracing
114
+ * Set Environment Variables
115
+
116
+ * SOURCE_BUCKET_NAME
117
+ * DESTINATION_BUCKET_NAME
118
+ * AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
119
+ * Grant permissions to use Amazon Transcribe service, write to source bucket, and read from destination bucket
120
+
121
+ ### Amazon S3 Buckets
122
+
123
+ * Configure Access logging for both S3 Buckets
124
+ * Enable server-side encryption for both S3 Buckets using AWS managed KMS Key
125
+ * Enforce encryption of data in transit
126
+ * Turn on the versioning for both S3 Buckets
127
+ * Don't allow public access for both S3 Buckets
128
+ * Retain the S3 Buckets when deleting the CloudFormation stack
129
+
130
+ ### Amazon Transcribe Service
131
+
132
+ * The Transcribe service will have read access to the source bucket and write permissions to the destination bucket
133
+ * Lambda function will have permissions to start transcription jobs, get job status, and list transcription jobs
134
+
135
+ ## Architecture
136
+
137
+ ![Architecture Diagram](architecture.png)
138
+
139
+ ---
140
+
141
+
142
+ © Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
143
+ '''
144
+ from pkgutil import extend_path
145
+ __path__ = extend_path(__path__, __name__)
146
+
147
+ import abc
148
+ import builtins
149
+ import datetime
150
+ import enum
151
+ import typing
152
+
153
+ import jsii
154
+ import publication
155
+ import typing_extensions
156
+
157
+ import typeguard
158
+ from importlib.metadata import version as _metadata_package_version
159
+ TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
160
+
161
+ def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
162
+ if TYPEGUARD_MAJOR_VERSION <= 2:
163
+ return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
164
+ else:
165
+ if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
166
+ pass
167
+ else:
168
+ if TYPEGUARD_MAJOR_VERSION == 3:
169
+ typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
170
+ typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
171
+ else:
172
+ typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
173
+
174
+ from ._jsii import *
175
+
176
+ import aws_cdk.aws_ec2 as _aws_cdk_aws_ec2_ceddda9d
177
+ import aws_cdk.aws_lambda as _aws_cdk_aws_lambda_ceddda9d
178
+ import aws_cdk.aws_s3 as _aws_cdk_aws_s3_ceddda9d
179
+ import constructs as _constructs_77d1e7e8
180
+
181
+
182
+ class LambdaToTranscribe(
183
+ _constructs_77d1e7e8.Construct,
184
+ metaclass=jsii.JSIIMeta,
185
+ jsii_type="@aws-solutions-constructs/aws-lambda-transcribe.LambdaToTranscribe",
186
+ ):
187
+ '''
188
+ :summary: The LambdaToTranscribe class.
189
+ '''
190
+
191
+ def __init__(
192
+ self,
193
+ scope: _constructs_77d1e7e8.Construct,
194
+ id: builtins.str,
195
+ *,
196
+ deploy_vpc: typing.Optional[builtins.bool] = None,
197
+ destination_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
198
+ destination_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
199
+ destination_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
200
+ existing_destination_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
201
+ existing_lambda_obj: typing.Optional[_aws_cdk_aws_lambda_ceddda9d.Function] = None,
202
+ existing_source_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
203
+ existing_vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
204
+ lambda_function_props: typing.Optional[typing.Union[_aws_cdk_aws_lambda_ceddda9d.FunctionProps, typing.Dict[builtins.str, typing.Any]]] = None,
205
+ log_destination_s3_access_logs: typing.Optional[builtins.bool] = None,
206
+ log_source_s3_access_logs: typing.Optional[builtins.bool] = None,
207
+ source_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
208
+ source_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
209
+ source_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
210
+ use_same_bucket: typing.Optional[builtins.bool] = None,
211
+ vpc_props: typing.Optional[typing.Union[_aws_cdk_aws_ec2_ceddda9d.VpcProps, typing.Dict[builtins.str, typing.Any]]] = None,
212
+ ) -> None:
213
+ '''
214
+ :param scope: - represents the scope for all the resources.
215
+ :param id: - this is a a scope-unique id.
216
+ :param deploy_vpc: Whether to deploy a new VPC. Default: - false
217
+ :param destination_bucket_environment_variable_name: Optional Name for the Lambda function environment variable set to the name of the destination bucket. Default: - DESTINATION_BUCKET_NAME
218
+ :param destination_bucket_props: Optional user provided props to override the default props for the destination S3 Bucket. Default: - Default props are used
219
+ :param destination_logging_bucket_props: Optional user provided props to override the default props for the destination S3 Logging Bucket. Default: - Default props are used
220
+ :param existing_destination_bucket_obj: Existing instance of S3 Bucket object for transcription results, providing both this and ``destinationBucketProps`` will cause an error. Default: - None
221
+ :param existing_lambda_obj: Existing instance of Lambda Function object, providing both this and ``lambdaFunctionProps`` will cause an error. Default: - None
222
+ :param existing_source_bucket_obj: Existing instance of S3 Bucket object for source audio files, providing both this and ``sourceBucketProps`` will cause an error. Default: - None
223
+ :param existing_vpc: An existing VPC for the construct to use (construct will NOT create a new VPC in this case).
224
+ :param lambda_function_props: Optional user provided props to override the default props for the Lambda function. Default: - Default properties are used.
225
+ :param log_destination_s3_access_logs: Whether to turn on Access Logs for the destination S3 bucket with the associated storage costs. Enabling Access Logging is a best practice. Default: - true
226
+ :param log_source_s3_access_logs: Whether to turn on Access Logs for the source S3 bucket with the associated storage costs. Enabling Access Logging is a best practice. Default: - true
227
+ :param source_bucket_environment_variable_name: Optional Name for the Lambda function environment variable set to the name of the source bucket. Default: - SOURCE_BUCKET_NAME
228
+ :param source_bucket_props: Optional user provided props to override the default props for the source S3 Bucket. Default: - Default props are used
229
+ :param source_logging_bucket_props: Optional user provided props to override the default props for the source S3 Logging Bucket. Default: - Default props are used
230
+ :param use_same_bucket: Whether to use the same S3 bucket for both source and destination files. Default: - false
231
+ :param vpc_props: Properties to override default properties if deployVpc is true.
232
+
233
+ :access: public
234
+ :summary: Constructs a new instance of the LambdaToTranscribe class.
235
+ '''
236
+ if __debug__:
237
+ type_hints = typing.get_type_hints(_typecheckingstub__bb0670a21928ee2853f7f2fe6000bf5d058c4375bd032f00f8ca27e78c1b1c70)
238
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
239
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
240
+ props = LambdaToTranscribeProps(
241
+ deploy_vpc=deploy_vpc,
242
+ destination_bucket_environment_variable_name=destination_bucket_environment_variable_name,
243
+ destination_bucket_props=destination_bucket_props,
244
+ destination_logging_bucket_props=destination_logging_bucket_props,
245
+ existing_destination_bucket_obj=existing_destination_bucket_obj,
246
+ existing_lambda_obj=existing_lambda_obj,
247
+ existing_source_bucket_obj=existing_source_bucket_obj,
248
+ existing_vpc=existing_vpc,
249
+ lambda_function_props=lambda_function_props,
250
+ log_destination_s3_access_logs=log_destination_s3_access_logs,
251
+ log_source_s3_access_logs=log_source_s3_access_logs,
252
+ source_bucket_environment_variable_name=source_bucket_environment_variable_name,
253
+ source_bucket_props=source_bucket_props,
254
+ source_logging_bucket_props=source_logging_bucket_props,
255
+ use_same_bucket=use_same_bucket,
256
+ vpc_props=vpc_props,
257
+ )
258
+
259
+ jsii.create(self.__class__, self, [scope, id, props])
260
+
261
+ @builtins.property
262
+ @jsii.member(jsii_name="destinationBucketInterface")
263
+ def destination_bucket_interface(self) -> _aws_cdk_aws_s3_ceddda9d.IBucket:
264
+ return typing.cast(_aws_cdk_aws_s3_ceddda9d.IBucket, jsii.get(self, "destinationBucketInterface"))
265
+
266
+ @builtins.property
267
+ @jsii.member(jsii_name="lambdaFunction")
268
+ def lambda_function(self) -> _aws_cdk_aws_lambda_ceddda9d.Function:
269
+ return typing.cast(_aws_cdk_aws_lambda_ceddda9d.Function, jsii.get(self, "lambdaFunction"))
270
+
271
+ @builtins.property
272
+ @jsii.member(jsii_name="sourceBucketInterface")
273
+ def source_bucket_interface(self) -> _aws_cdk_aws_s3_ceddda9d.IBucket:
274
+ return typing.cast(_aws_cdk_aws_s3_ceddda9d.IBucket, jsii.get(self, "sourceBucketInterface"))
275
+
276
+ @builtins.property
277
+ @jsii.member(jsii_name="destinationBucket")
278
+ def destination_bucket(self) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.Bucket]:
279
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.Bucket], jsii.get(self, "destinationBucket"))
280
+
281
+ @builtins.property
282
+ @jsii.member(jsii_name="destinationLoggingBucket")
283
+ def destination_logging_bucket(
284
+ self,
285
+ ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.Bucket]:
286
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.Bucket], jsii.get(self, "destinationLoggingBucket"))
287
+
288
+ @builtins.property
289
+ @jsii.member(jsii_name="sourceBucket")
290
+ def source_bucket(self) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.Bucket]:
291
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.Bucket], jsii.get(self, "sourceBucket"))
292
+
293
+ @builtins.property
294
+ @jsii.member(jsii_name="sourceLoggingBucket")
295
+ def source_logging_bucket(self) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.Bucket]:
296
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.Bucket], jsii.get(self, "sourceLoggingBucket"))
297
+
298
+ @builtins.property
299
+ @jsii.member(jsii_name="vpc")
300
+ def vpc(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc]:
301
+ return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc], jsii.get(self, "vpc"))
302
+
303
+
304
+ @jsii.data_type(
305
+ jsii_type="@aws-solutions-constructs/aws-lambda-transcribe.LambdaToTranscribeProps",
306
+ jsii_struct_bases=[],
307
+ name_mapping={
308
+ "deploy_vpc": "deployVpc",
309
+ "destination_bucket_environment_variable_name": "destinationBucketEnvironmentVariableName",
310
+ "destination_bucket_props": "destinationBucketProps",
311
+ "destination_logging_bucket_props": "destinationLoggingBucketProps",
312
+ "existing_destination_bucket_obj": "existingDestinationBucketObj",
313
+ "existing_lambda_obj": "existingLambdaObj",
314
+ "existing_source_bucket_obj": "existingSourceBucketObj",
315
+ "existing_vpc": "existingVpc",
316
+ "lambda_function_props": "lambdaFunctionProps",
317
+ "log_destination_s3_access_logs": "logDestinationS3AccessLogs",
318
+ "log_source_s3_access_logs": "logSourceS3AccessLogs",
319
+ "source_bucket_environment_variable_name": "sourceBucketEnvironmentVariableName",
320
+ "source_bucket_props": "sourceBucketProps",
321
+ "source_logging_bucket_props": "sourceLoggingBucketProps",
322
+ "use_same_bucket": "useSameBucket",
323
+ "vpc_props": "vpcProps",
324
+ },
325
+ )
326
+ class LambdaToTranscribeProps:
327
+ def __init__(
328
+ self,
329
+ *,
330
+ deploy_vpc: typing.Optional[builtins.bool] = None,
331
+ destination_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
332
+ destination_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
333
+ destination_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
334
+ existing_destination_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
335
+ existing_lambda_obj: typing.Optional[_aws_cdk_aws_lambda_ceddda9d.Function] = None,
336
+ existing_source_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
337
+ existing_vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
338
+ lambda_function_props: typing.Optional[typing.Union[_aws_cdk_aws_lambda_ceddda9d.FunctionProps, typing.Dict[builtins.str, typing.Any]]] = None,
339
+ log_destination_s3_access_logs: typing.Optional[builtins.bool] = None,
340
+ log_source_s3_access_logs: typing.Optional[builtins.bool] = None,
341
+ source_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
342
+ source_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
343
+ source_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
344
+ use_same_bucket: typing.Optional[builtins.bool] = None,
345
+ vpc_props: typing.Optional[typing.Union[_aws_cdk_aws_ec2_ceddda9d.VpcProps, typing.Dict[builtins.str, typing.Any]]] = None,
346
+ ) -> None:
347
+ '''
348
+ :param deploy_vpc: Whether to deploy a new VPC. Default: - false
349
+ :param destination_bucket_environment_variable_name: Optional Name for the Lambda function environment variable set to the name of the destination bucket. Default: - DESTINATION_BUCKET_NAME
350
+ :param destination_bucket_props: Optional user provided props to override the default props for the destination S3 Bucket. Default: - Default props are used
351
+ :param destination_logging_bucket_props: Optional user provided props to override the default props for the destination S3 Logging Bucket. Default: - Default props are used
352
+ :param existing_destination_bucket_obj: Existing instance of S3 Bucket object for transcription results, providing both this and ``destinationBucketProps`` will cause an error. Default: - None
353
+ :param existing_lambda_obj: Existing instance of Lambda Function object, providing both this and ``lambdaFunctionProps`` will cause an error. Default: - None
354
+ :param existing_source_bucket_obj: Existing instance of S3 Bucket object for source audio files, providing both this and ``sourceBucketProps`` will cause an error. Default: - None
355
+ :param existing_vpc: An existing VPC for the construct to use (construct will NOT create a new VPC in this case).
356
+ :param lambda_function_props: Optional user provided props to override the default props for the Lambda function. Default: - Default properties are used.
357
+ :param log_destination_s3_access_logs: Whether to turn on Access Logs for the destination S3 bucket with the associated storage costs. Enabling Access Logging is a best practice. Default: - true
358
+ :param log_source_s3_access_logs: Whether to turn on Access Logs for the source S3 bucket with the associated storage costs. Enabling Access Logging is a best practice. Default: - true
359
+ :param source_bucket_environment_variable_name: Optional Name for the Lambda function environment variable set to the name of the source bucket. Default: - SOURCE_BUCKET_NAME
360
+ :param source_bucket_props: Optional user provided props to override the default props for the source S3 Bucket. Default: - Default props are used
361
+ :param source_logging_bucket_props: Optional user provided props to override the default props for the source S3 Logging Bucket. Default: - Default props are used
362
+ :param use_same_bucket: Whether to use the same S3 bucket for both source and destination files. Default: - false
363
+ :param vpc_props: Properties to override default properties if deployVpc is true.
364
+
365
+ :summary: The properties for the LambdaToTranscribe class.
366
+ '''
367
+ if isinstance(destination_bucket_props, dict):
368
+ destination_bucket_props = _aws_cdk_aws_s3_ceddda9d.BucketProps(**destination_bucket_props)
369
+ if isinstance(destination_logging_bucket_props, dict):
370
+ destination_logging_bucket_props = _aws_cdk_aws_s3_ceddda9d.BucketProps(**destination_logging_bucket_props)
371
+ if isinstance(lambda_function_props, dict):
372
+ lambda_function_props = _aws_cdk_aws_lambda_ceddda9d.FunctionProps(**lambda_function_props)
373
+ if isinstance(source_bucket_props, dict):
374
+ source_bucket_props = _aws_cdk_aws_s3_ceddda9d.BucketProps(**source_bucket_props)
375
+ if isinstance(source_logging_bucket_props, dict):
376
+ source_logging_bucket_props = _aws_cdk_aws_s3_ceddda9d.BucketProps(**source_logging_bucket_props)
377
+ if isinstance(vpc_props, dict):
378
+ vpc_props = _aws_cdk_aws_ec2_ceddda9d.VpcProps(**vpc_props)
379
+ if __debug__:
380
+ type_hints = typing.get_type_hints(_typecheckingstub__0231621833b3a9d9d0f5a4a367f1d87af322de6fa51cc5ff03818555bd27958f)
381
+ check_type(argname="argument deploy_vpc", value=deploy_vpc, expected_type=type_hints["deploy_vpc"])
382
+ check_type(argname="argument destination_bucket_environment_variable_name", value=destination_bucket_environment_variable_name, expected_type=type_hints["destination_bucket_environment_variable_name"])
383
+ check_type(argname="argument destination_bucket_props", value=destination_bucket_props, expected_type=type_hints["destination_bucket_props"])
384
+ check_type(argname="argument destination_logging_bucket_props", value=destination_logging_bucket_props, expected_type=type_hints["destination_logging_bucket_props"])
385
+ check_type(argname="argument existing_destination_bucket_obj", value=existing_destination_bucket_obj, expected_type=type_hints["existing_destination_bucket_obj"])
386
+ check_type(argname="argument existing_lambda_obj", value=existing_lambda_obj, expected_type=type_hints["existing_lambda_obj"])
387
+ check_type(argname="argument existing_source_bucket_obj", value=existing_source_bucket_obj, expected_type=type_hints["existing_source_bucket_obj"])
388
+ check_type(argname="argument existing_vpc", value=existing_vpc, expected_type=type_hints["existing_vpc"])
389
+ check_type(argname="argument lambda_function_props", value=lambda_function_props, expected_type=type_hints["lambda_function_props"])
390
+ check_type(argname="argument log_destination_s3_access_logs", value=log_destination_s3_access_logs, expected_type=type_hints["log_destination_s3_access_logs"])
391
+ check_type(argname="argument log_source_s3_access_logs", value=log_source_s3_access_logs, expected_type=type_hints["log_source_s3_access_logs"])
392
+ check_type(argname="argument source_bucket_environment_variable_name", value=source_bucket_environment_variable_name, expected_type=type_hints["source_bucket_environment_variable_name"])
393
+ check_type(argname="argument source_bucket_props", value=source_bucket_props, expected_type=type_hints["source_bucket_props"])
394
+ check_type(argname="argument source_logging_bucket_props", value=source_logging_bucket_props, expected_type=type_hints["source_logging_bucket_props"])
395
+ check_type(argname="argument use_same_bucket", value=use_same_bucket, expected_type=type_hints["use_same_bucket"])
396
+ check_type(argname="argument vpc_props", value=vpc_props, expected_type=type_hints["vpc_props"])
397
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
398
+ if deploy_vpc is not None:
399
+ self._values["deploy_vpc"] = deploy_vpc
400
+ if destination_bucket_environment_variable_name is not None:
401
+ self._values["destination_bucket_environment_variable_name"] = destination_bucket_environment_variable_name
402
+ if destination_bucket_props is not None:
403
+ self._values["destination_bucket_props"] = destination_bucket_props
404
+ if destination_logging_bucket_props is not None:
405
+ self._values["destination_logging_bucket_props"] = destination_logging_bucket_props
406
+ if existing_destination_bucket_obj is not None:
407
+ self._values["existing_destination_bucket_obj"] = existing_destination_bucket_obj
408
+ if existing_lambda_obj is not None:
409
+ self._values["existing_lambda_obj"] = existing_lambda_obj
410
+ if existing_source_bucket_obj is not None:
411
+ self._values["existing_source_bucket_obj"] = existing_source_bucket_obj
412
+ if existing_vpc is not None:
413
+ self._values["existing_vpc"] = existing_vpc
414
+ if lambda_function_props is not None:
415
+ self._values["lambda_function_props"] = lambda_function_props
416
+ if log_destination_s3_access_logs is not None:
417
+ self._values["log_destination_s3_access_logs"] = log_destination_s3_access_logs
418
+ if log_source_s3_access_logs is not None:
419
+ self._values["log_source_s3_access_logs"] = log_source_s3_access_logs
420
+ if source_bucket_environment_variable_name is not None:
421
+ self._values["source_bucket_environment_variable_name"] = source_bucket_environment_variable_name
422
+ if source_bucket_props is not None:
423
+ self._values["source_bucket_props"] = source_bucket_props
424
+ if source_logging_bucket_props is not None:
425
+ self._values["source_logging_bucket_props"] = source_logging_bucket_props
426
+ if use_same_bucket is not None:
427
+ self._values["use_same_bucket"] = use_same_bucket
428
+ if vpc_props is not None:
429
+ self._values["vpc_props"] = vpc_props
430
+
431
+ @builtins.property
432
+ def deploy_vpc(self) -> typing.Optional[builtins.bool]:
433
+ '''Whether to deploy a new VPC.
434
+
435
+ :default: - false
436
+ '''
437
+ result = self._values.get("deploy_vpc")
438
+ return typing.cast(typing.Optional[builtins.bool], result)
439
+
440
+ @builtins.property
441
+ def destination_bucket_environment_variable_name(
442
+ self,
443
+ ) -> typing.Optional[builtins.str]:
444
+ '''Optional Name for the Lambda function environment variable set to the name of the destination bucket.
445
+
446
+ :default: - DESTINATION_BUCKET_NAME
447
+ '''
448
+ result = self._values.get("destination_bucket_environment_variable_name")
449
+ return typing.cast(typing.Optional[builtins.str], result)
450
+
451
+ @builtins.property
452
+ def destination_bucket_props(
453
+ self,
454
+ ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketProps]:
455
+ '''Optional user provided props to override the default props for the destination S3 Bucket.
456
+
457
+ :default: - Default props are used
458
+ '''
459
+ result = self._values.get("destination_bucket_props")
460
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketProps], result)
461
+
462
+ @builtins.property
463
+ def destination_logging_bucket_props(
464
+ self,
465
+ ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketProps]:
466
+ '''Optional user provided props to override the default props for the destination S3 Logging Bucket.
467
+
468
+ :default: - Default props are used
469
+ '''
470
+ result = self._values.get("destination_logging_bucket_props")
471
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketProps], result)
472
+
473
+ @builtins.property
474
+ def existing_destination_bucket_obj(
475
+ self,
476
+ ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket]:
477
+ '''Existing instance of S3 Bucket object for transcription results, providing both this and ``destinationBucketProps`` will cause an error.
478
+
479
+ :default: - None
480
+ '''
481
+ result = self._values.get("existing_destination_bucket_obj")
482
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket], result)
483
+
484
+ @builtins.property
485
+ def existing_lambda_obj(
486
+ self,
487
+ ) -> typing.Optional[_aws_cdk_aws_lambda_ceddda9d.Function]:
488
+ '''Existing instance of Lambda Function object, providing both this and ``lambdaFunctionProps`` will cause an error.
489
+
490
+ :default: - None
491
+ '''
492
+ result = self._values.get("existing_lambda_obj")
493
+ return typing.cast(typing.Optional[_aws_cdk_aws_lambda_ceddda9d.Function], result)
494
+
495
+ @builtins.property
496
+ def existing_source_bucket_obj(
497
+ self,
498
+ ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket]:
499
+ '''Existing instance of S3 Bucket object for source audio files, providing both this and ``sourceBucketProps`` will cause an error.
500
+
501
+ :default: - None
502
+ '''
503
+ result = self._values.get("existing_source_bucket_obj")
504
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket], result)
505
+
506
+ @builtins.property
507
+ def existing_vpc(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc]:
508
+ '''An existing VPC for the construct to use (construct will NOT create a new VPC in this case).'''
509
+ result = self._values.get("existing_vpc")
510
+ return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc], result)
511
+
512
+ @builtins.property
513
+ def lambda_function_props(
514
+ self,
515
+ ) -> typing.Optional[_aws_cdk_aws_lambda_ceddda9d.FunctionProps]:
516
+ '''Optional user provided props to override the default props for the Lambda function.
517
+
518
+ :default: - Default properties are used.
519
+ '''
520
+ result = self._values.get("lambda_function_props")
521
+ return typing.cast(typing.Optional[_aws_cdk_aws_lambda_ceddda9d.FunctionProps], result)
522
+
523
+ @builtins.property
524
+ def log_destination_s3_access_logs(self) -> typing.Optional[builtins.bool]:
525
+ '''Whether to turn on Access Logs for the destination S3 bucket with the associated storage costs.
526
+
527
+ Enabling Access Logging is a best practice.
528
+
529
+ :default: - true
530
+ '''
531
+ result = self._values.get("log_destination_s3_access_logs")
532
+ return typing.cast(typing.Optional[builtins.bool], result)
533
+
534
+ @builtins.property
535
+ def log_source_s3_access_logs(self) -> typing.Optional[builtins.bool]:
536
+ '''Whether to turn on Access Logs for the source S3 bucket with the associated storage costs.
537
+
538
+ Enabling Access Logging is a best practice.
539
+
540
+ :default: - true
541
+ '''
542
+ result = self._values.get("log_source_s3_access_logs")
543
+ return typing.cast(typing.Optional[builtins.bool], result)
544
+
545
+ @builtins.property
546
+ def source_bucket_environment_variable_name(self) -> typing.Optional[builtins.str]:
547
+ '''Optional Name for the Lambda function environment variable set to the name of the source bucket.
548
+
549
+ :default: - SOURCE_BUCKET_NAME
550
+ '''
551
+ result = self._values.get("source_bucket_environment_variable_name")
552
+ return typing.cast(typing.Optional[builtins.str], result)
553
+
554
+ @builtins.property
555
+ def source_bucket_props(
556
+ self,
557
+ ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketProps]:
558
+ '''Optional user provided props to override the default props for the source S3 Bucket.
559
+
560
+ :default: - Default props are used
561
+ '''
562
+ result = self._values.get("source_bucket_props")
563
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketProps], result)
564
+
565
+ @builtins.property
566
+ def source_logging_bucket_props(
567
+ self,
568
+ ) -> typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketProps]:
569
+ '''Optional user provided props to override the default props for the source S3 Logging Bucket.
570
+
571
+ :default: - Default props are used
572
+ '''
573
+ result = self._values.get("source_logging_bucket_props")
574
+ return typing.cast(typing.Optional[_aws_cdk_aws_s3_ceddda9d.BucketProps], result)
575
+
576
+ @builtins.property
577
+ def use_same_bucket(self) -> typing.Optional[builtins.bool]:
578
+ '''Whether to use the same S3 bucket for both source and destination files.
579
+
580
+ :default: - false
581
+ '''
582
+ result = self._values.get("use_same_bucket")
583
+ return typing.cast(typing.Optional[builtins.bool], result)
584
+
585
+ @builtins.property
586
+ def vpc_props(self) -> typing.Optional[_aws_cdk_aws_ec2_ceddda9d.VpcProps]:
587
+ '''Properties to override default properties if deployVpc is true.'''
588
+ result = self._values.get("vpc_props")
589
+ return typing.cast(typing.Optional[_aws_cdk_aws_ec2_ceddda9d.VpcProps], result)
590
+
591
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
592
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
593
+
594
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
595
+ return not (rhs == self)
596
+
597
+ def __repr__(self) -> str:
598
+ return "LambdaToTranscribeProps(%s)" % ", ".join(
599
+ k + "=" + repr(v) for k, v in self._values.items()
600
+ )
601
+
602
+
603
+ __all__ = [
604
+ "LambdaToTranscribe",
605
+ "LambdaToTranscribeProps",
606
+ ]
607
+
608
+ publication.publish()
609
+
610
+ def _typecheckingstub__bb0670a21928ee2853f7f2fe6000bf5d058c4375bd032f00f8ca27e78c1b1c70(
611
+ scope: _constructs_77d1e7e8.Construct,
612
+ id: builtins.str,
613
+ *,
614
+ deploy_vpc: typing.Optional[builtins.bool] = None,
615
+ destination_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
616
+ destination_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
617
+ destination_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
618
+ existing_destination_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
619
+ existing_lambda_obj: typing.Optional[_aws_cdk_aws_lambda_ceddda9d.Function] = None,
620
+ existing_source_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
621
+ existing_vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
622
+ lambda_function_props: typing.Optional[typing.Union[_aws_cdk_aws_lambda_ceddda9d.FunctionProps, typing.Dict[builtins.str, typing.Any]]] = None,
623
+ log_destination_s3_access_logs: typing.Optional[builtins.bool] = None,
624
+ log_source_s3_access_logs: typing.Optional[builtins.bool] = None,
625
+ source_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
626
+ source_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
627
+ source_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
628
+ use_same_bucket: typing.Optional[builtins.bool] = None,
629
+ vpc_props: typing.Optional[typing.Union[_aws_cdk_aws_ec2_ceddda9d.VpcProps, typing.Dict[builtins.str, typing.Any]]] = None,
630
+ ) -> None:
631
+ """Type checking stubs"""
632
+ pass
633
+
634
+ def _typecheckingstub__0231621833b3a9d9d0f5a4a367f1d87af322de6fa51cc5ff03818555bd27958f(
635
+ *,
636
+ deploy_vpc: typing.Optional[builtins.bool] = None,
637
+ destination_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
638
+ destination_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
639
+ destination_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
640
+ existing_destination_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
641
+ existing_lambda_obj: typing.Optional[_aws_cdk_aws_lambda_ceddda9d.Function] = None,
642
+ existing_source_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
643
+ existing_vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
644
+ lambda_function_props: typing.Optional[typing.Union[_aws_cdk_aws_lambda_ceddda9d.FunctionProps, typing.Dict[builtins.str, typing.Any]]] = None,
645
+ log_destination_s3_access_logs: typing.Optional[builtins.bool] = None,
646
+ log_source_s3_access_logs: typing.Optional[builtins.bool] = None,
647
+ source_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
648
+ source_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
649
+ source_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
650
+ use_same_bucket: typing.Optional[builtins.bool] = None,
651
+ vpc_props: typing.Optional[typing.Union[_aws_cdk_aws_ec2_ceddda9d.VpcProps, typing.Dict[builtins.str, typing.Any]]] = None,
652
+ ) -> None:
653
+ """Type checking stubs"""
654
+ pass
@@ -0,0 +1,46 @@
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 aws_solutions_constructs.core._jsii
33
+ import constructs._jsii
34
+
35
+ __jsii_assembly__ = jsii.JSIIAssembly.load(
36
+ "@aws-solutions-constructs/aws-lambda-transcribe",
37
+ "2.95.0",
38
+ __name__[0:-6],
39
+ "aws-lambda-transcribe@2.95.0.jsii.tgz",
40
+ )
41
+
42
+ __all__ = [
43
+ "__jsii_assembly__",
44
+ ]
45
+
46
+ publication.publish()
@@ -0,0 +1,73 @@
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, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+
37
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
38
+
39
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
40
+
41
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
42
+
43
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
56
+
57
+ APPENDIX: How to apply the Apache License to your work.
58
+
59
+ To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
60
+
61
+ Copyright [yyyy] [name of copyright owner]
62
+
63
+ Licensed under the Apache License, Version 2.0 (the "License");
64
+ you may not use this file except in compliance with the License.
65
+ You may obtain a copy of the License at
66
+
67
+ http://www.apache.org/licenses/LICENSE-2.0
68
+
69
+ Unless required by applicable law or agreed to in writing, software
70
+ distributed under the License is distributed on an "AS IS" BASIS,
71
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
72
+ See the License for the specific language governing permissions and
73
+ limitations under the License.
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.1
2
+ Name: aws-solutions-constructs.aws-lambda-transcribe
3
+ Version: 2.95.0
4
+ Summary: CDK constructs for defining an interaction between an AWS Lambda function and Amazon Transcribe with S3 buckets.
5
+ Home-page: https://github.com/awslabs/aws-solutions-constructs.git
6
+ Author: Amazon Web Services
7
+ License: Apache-2.0
8
+ Project-URL: Source, https://github.com/awslabs/aws-solutions-constructs.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: License :: OSI Approved
18
+ Requires-Python: ~=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: aws-cdk-lib <3.0.0,>=2.223.0
22
+ Requires-Dist: aws-solutions-constructs.core ==2.95.0
23
+ Requires-Dist: constructs <11.0.0,>=10.0.0
24
+ Requires-Dist: jsii <2.0.0,>=1.119.0
25
+ Requires-Dist: publication >=0.0.3
26
+ Requires-Dist: typeguard <4.3.0,>=2.13.3
27
+
28
+ # aws-lambda-transcribe module
29
+
30
+ <!--BEGIN STABILITY BANNER-->---
31
+
32
+
33
+ ![Stability: Experimental](https://img.shields.io/badge/stability-Experimental-important.svg?style=for-the-badge)
34
+
35
+ ---
36
+ <!--END STABILITY BANNER-->
37
+
38
+ | **Reference Documentation**:| <span style="font-weight: normal">https://docs.aws.amazon.com/solutions/latest/constructs/</span>|
39
+ |:-------------|:-------------|
40
+
41
+ <div style="height:8px"></div>
42
+
43
+ | **Language** | **Package** |
44
+ |:-------------|-----------------|
45
+ |![Python Logo](https://docs.aws.amazon.com/cdk/api/latest/img/python32.png) Python|`aws_solutions_constructs.aws_lambda_transcribe`|
46
+ |![Typescript Logo](https://docs.aws.amazon.com/cdk/api/latest/img/typescript32.png) Typescript|`@aws-solutions-constructs/aws-lambda-transcribe`|
47
+ |![Java Logo](https://docs.aws.amazon.com/cdk/api/latest/img/java32.png) Java|`software.amazon.awsconstructs.services.lambdatranscribe`|
48
+
49
+ ## Overview
50
+
51
+ This AWS Solutions Construct implements an AWS Lambda function connected to Amazon S3 buckets for use with Amazon Transcribe.
52
+
53
+ Here is a minimal deployable pattern definition:
54
+
55
+ Typescript
56
+
57
+ ```python
58
+ import { Construct } from 'constructs';
59
+ import { Stack, StackProps } from 'aws-cdk-lib';
60
+ import { LambdaToTranscribe } from '@aws-solutions-constructs/aws-lambda-transcribe';
61
+ import * as lambda from 'aws-cdk-lib/aws-lambda';
62
+
63
+ new LambdaToTranscribe(this, 'LambdaToTranscribePattern', {
64
+ lambdaFunctionProps: {
65
+ runtime: lambda.Runtime.NODEJS_20_X,
66
+ handler: 'index.handler',
67
+ code: lambda.Code.fromAsset(`lambda`)
68
+ }
69
+ });
70
+ ```
71
+
72
+ Python
73
+
74
+ ```python
75
+ from aws_solutions_constructs.aws_lambda_transcribe import LambdaToTranscribe
76
+ from aws_cdk import (
77
+ aws_lambda as _lambda,
78
+ Stack
79
+ )
80
+ from constructs import Construct
81
+
82
+ LambdaToTranscribe(self, 'LambdaToTranscribePattern',
83
+ lambda_function_props=_lambda.FunctionProps(
84
+ code=_lambda.Code.from_asset('lambda'),
85
+ runtime=_lambda.Runtime.PYTHON_3_11,
86
+ handler='index.handler'
87
+ )
88
+ )
89
+ ```
90
+
91
+ Java
92
+
93
+ ```java
94
+ import software.constructs.Construct;
95
+
96
+ import software.amazon.awscdk.Stack;
97
+ import software.amazon.awscdk.StackProps;
98
+ import software.amazon.awscdk.services.lambda.*;
99
+ import software.amazon.awscdk.services.lambda.Runtime;
100
+ import software.amazon.awsconstructs.services.lambdatranscribe.*;
101
+
102
+ new LambdaToTranscribe(this, "LambdaToTranscribePattern", new LambdaToTranscribeProps.Builder()
103
+ .lambdaFunctionProps(new FunctionProps.Builder()
104
+ .runtime(Runtime.NODEJS_20_X)
105
+ .code(Code.fromAsset("lambda"))
106
+ .handler("index.handler")
107
+ .build())
108
+ .build());
109
+ ```
110
+
111
+ ## Pattern Construct Props
112
+
113
+ | **Name** | **Type** | **Description** |
114
+ |:-------------|:----------------|-----------------|
115
+ |existingLambdaObj?|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Existing instance of Lambda Function object, providing both this and `lambdaFunctionProps` will cause an error.|
116
+ |lambdaFunctionProps?|[`lambda.FunctionProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.FunctionProps.html)|Optional user provided props to override the default props for the Lambda function.|
117
+ |existingSourceBucketObj?|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html)|Existing instance of S3 Bucket object for source audio files.|
118
+ |sourceBucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.BucketProps.html)|Optional user provided props to override the default props for the source S3 Bucket.|
119
+ |existingDestinationBucketObj?|[`s3.IBucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.IBucket.html)|Existing instance of S3 Bucket object for transcription results.|
120
+ |destinationBucketProps?|[`s3.BucketProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.BucketProps.html)|Optional user provided props to override the default props for the destination S3 Bucket.|
121
+ |useSameBucket?|`boolean`|Whether to use the same S3 bucket for both source and destination files. Default: false|
122
+
123
+ ## Pattern Properties
124
+
125
+ | **Name** | **Type** | **Description** |
126
+ |:-------------|:----------------|-----------------|
127
+ |lambdaFunction|[`lambda.Function`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html)|Returns an instance of the Lambda function created by the pattern.|
128
+ |sourceBucket?|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html)|Returns an instance of the source S3 bucket created by the pattern.|
129
+ |destinationBucket?|[`s3.Bucket`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Bucket.html)|Returns an instance of the destination S3 bucket created by the pattern.|
130
+
131
+ ## Default settings
132
+
133
+ Out of the box implementation of the Construct without any override will set the following defaults:
134
+
135
+ ### AWS Lambda Function
136
+
137
+ * Configure limited privilege access IAM role for Lambda function
138
+ * Enable reusing connections with Keep-Alive for NodeJs Lambda function
139
+ * Enable X-Ray Tracing
140
+ * Set Environment Variables
141
+
142
+ * SOURCE_BUCKET_NAME
143
+ * DESTINATION_BUCKET_NAME
144
+ * AWS_NODEJS_CONNECTION_REUSE_ENABLED (for Node 10.x and higher functions)
145
+ * Grant permissions to use Amazon Transcribe service, write to source bucket, and read from destination bucket
146
+
147
+ ### Amazon S3 Buckets
148
+
149
+ * Configure Access logging for both S3 Buckets
150
+ * Enable server-side encryption for both S3 Buckets using AWS managed KMS Key
151
+ * Enforce encryption of data in transit
152
+ * Turn on the versioning for both S3 Buckets
153
+ * Don't allow public access for both S3 Buckets
154
+ * Retain the S3 Buckets when deleting the CloudFormation stack
155
+
156
+ ### Amazon Transcribe Service
157
+
158
+ * The Transcribe service will have read access to the source bucket and write permissions to the destination bucket
159
+ * Lambda function will have permissions to start transcription jobs, get job status, and list transcription jobs
160
+
161
+ ## Architecture
162
+
163
+ ![Architecture Diagram](architecture.png)
164
+
165
+ ---
166
+
167
+
168
+ © Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -0,0 +1,9 @@
1
+ aws_solutions_constructs/aws_lambda_transcribe/__init__.py,sha256=Tx_ZdKxtkYxX7zceDVsJy2AjRh6tCAXiBO7G2Vt3btI,38077
2
+ aws_solutions_constructs/aws_lambda_transcribe/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
+ aws_solutions_constructs/aws_lambda_transcribe/_jsii/__init__.py,sha256=xQaxOIlSmT00eXWVUjDn-11JevEp6qbH0c3fGGTYGtg,1537
4
+ aws_solutions_constructs/aws_lambda_transcribe/_jsii/aws-lambda-transcribe@2.95.0.jsii.tgz,sha256=FI2t6BKFfoHoQ_84k1dmt4cYVHmV6WPrlNH9zmUjigw,72040
5
+ aws_solutions_constructs_aws_lambda_transcribe-2.95.0.dist-info/LICENSE,sha256=wnT4A3LZDAEpNzcPDh8VCH0i4wjvmLJ86l3A0tCINmw,10279
6
+ aws_solutions_constructs_aws_lambda_transcribe-2.95.0.dist-info/METADATA,sha256=As0sxb4BTCF8mBDeybbbZKA2iODhLgruPhX_lcsSoT4,7319
7
+ aws_solutions_constructs_aws_lambda_transcribe-2.95.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
8
+ aws_solutions_constructs_aws_lambda_transcribe-2.95.0.dist-info/top_level.txt,sha256=hi3us_KW7V1ocfOqVsNq1o3w552jCEgu_KsCckqYWsg,25
9
+ aws_solutions_constructs_aws_lambda_transcribe-2.95.0.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
+
@@ -0,0 +1 @@
1
+ aws_solutions_constructs