aws-solutions-constructs.aws-lambda-comprehend 2.104.0__tar.gz

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.
Files changed (16) hide show
  1. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/LICENSE +73 -0
  2. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/MANIFEST.in +1 -0
  3. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/PKG-INFO +28 -0
  4. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/README.md +1 -0
  5. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/pyproject.toml +9 -0
  6. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/setup.cfg +4 -0
  7. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/setup.py +64 -0
  8. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/src/aws_solutions_constructs/aws_lambda_comprehend/__init__.py +710 -0
  9. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/src/aws_solutions_constructs/aws_lambda_comprehend/_jsii/__init__.py +46 -0
  10. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/src/aws_solutions_constructs/aws_lambda_comprehend/_jsii/aws-lambda-comprehend@2.104.0.jsii.tgz +0 -0
  11. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/src/aws_solutions_constructs/aws_lambda_comprehend/py.typed +1 -0
  12. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/PKG-INFO +28 -0
  13. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/SOURCES.txt +14 -0
  14. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/dependency_links.txt +1 -0
  15. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/requires.txt +6 -0
  16. aws_solutions_constructs_aws_lambda_comprehend-2.104.0/src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/top_level.txt +1 -0
@@ -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 @@
1
+ include pyproject.toml
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.1
2
+ Name: aws-solutions-constructs.aws-lambda-comprehend
3
+ Version: 2.104.0
4
+ Summary: CDK constructs for defining an interaction between an AWS Lambda function and Amazon Comprehend natural language processing service with optional S3 buckets for asynchronous analysis jobs.
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.266.0
22
+ Requires-Dist: aws-solutions-constructs.core==2.104.0
23
+ Requires-Dist: constructs<11.0.0,>=10.0.0
24
+ Requires-Dist: jsii<2.0.0,>=1.126.0
25
+ Requires-Dist: publication>=0.0.3
26
+ Requires-Dist: typeguard==2.13.3
27
+
28
+ Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-lambda-comprehend/README.adoc)
@@ -0,0 +1 @@
1
+ Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-lambda-comprehend/README.adoc)
@@ -0,0 +1,9 @@
1
+ [build-system]
2
+ requires = ["setuptools~=75.3.2", "build~=1.3.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [tool.pyright]
6
+ defineConstant = { DEBUG = true }
7
+ pythonVersion = "3.9"
8
+ pythonPlatform = "All"
9
+ reportSelfClsParameterName = false
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,64 @@
1
+ import json
2
+ import setuptools
3
+
4
+ kwargs = json.loads(
5
+ """
6
+ {
7
+ "name": "aws-solutions-constructs.aws-lambda-comprehend",
8
+ "version": "2.104.0",
9
+ "description": "CDK constructs for defining an interaction between an AWS Lambda function and Amazon Comprehend natural language processing service with optional S3 buckets for asynchronous analysis jobs.",
10
+ "license": "Apache-2.0",
11
+ "url": "https://github.com/awslabs/aws-solutions-constructs.git",
12
+ "long_description_content_type": "text/markdown",
13
+ "author": "Amazon Web Services",
14
+ "bdist_wheel": {
15
+ "universal": true
16
+ },
17
+ "project_urls": {
18
+ "Source": "https://github.com/awslabs/aws-solutions-constructs.git"
19
+ },
20
+ "package_dir": {
21
+ "": "src"
22
+ },
23
+ "packages": [
24
+ "aws_solutions_constructs.aws_lambda_comprehend",
25
+ "aws_solutions_constructs.aws_lambda_comprehend._jsii"
26
+ ],
27
+ "package_data": {
28
+ "aws_solutions_constructs.aws_lambda_comprehend._jsii": [
29
+ "aws-lambda-comprehend@2.104.0.jsii.tgz"
30
+ ],
31
+ "aws_solutions_constructs.aws_lambda_comprehend": [
32
+ "py.typed"
33
+ ]
34
+ },
35
+ "python_requires": "~=3.9",
36
+ "install_requires": [
37
+ "aws-cdk-lib>=2.266.0, <3.0.0",
38
+ "aws-solutions-constructs.core==2.104.0",
39
+ "constructs>=10.0.0, <11.0.0",
40
+ "jsii>=1.126.0, <2.0.0",
41
+ "publication>=0.0.3",
42
+ "typeguard==2.13.3"
43
+ ],
44
+ "classifiers": [
45
+ "Intended Audience :: Developers",
46
+ "Operating System :: OS Independent",
47
+ "Programming Language :: JavaScript",
48
+ "Programming Language :: Python :: 3 :: Only",
49
+ "Programming Language :: Python :: 3.9",
50
+ "Programming Language :: Python :: 3.10",
51
+ "Programming Language :: Python :: 3.11",
52
+ "Typing :: Typed",
53
+ "License :: OSI Approved"
54
+ ],
55
+ "scripts": []
56
+ }
57
+ """
58
+ )
59
+
60
+ with open("README.md", encoding="utf8") as fp:
61
+ kwargs["long_description"] = fp.read()
62
+
63
+
64
+ setuptools.setup(**kwargs)
@@ -0,0 +1,710 @@
1
+ r'''
2
+ Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-lambda-comprehend/README.adoc)
3
+ '''
4
+ from pkgutil import extend_path
5
+ __path__ = extend_path(__path__, __name__)
6
+
7
+ import abc
8
+ import builtins
9
+ import datetime
10
+ import enum
11
+ import typing
12
+
13
+ import jsii
14
+ import publication
15
+ import typing_extensions
16
+
17
+ import typeguard
18
+ from importlib.metadata import version as _metadata_package_version
19
+ TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])
20
+
21
+ def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any:
22
+ if TYPEGUARD_MAJOR_VERSION <= 2:
23
+ return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore
24
+ else:
25
+ if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]
26
+ pass
27
+ else:
28
+ if TYPEGUARD_MAJOR_VERSION == 3:
29
+ typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore
30
+ typeguard.check_type(value=value, expected_type=expected_type) # type:ignore
31
+ else:
32
+ typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
33
+
34
+ from ._jsii import *
35
+
36
+ import aws_cdk.aws_ec2 as _aws_cdk_aws_ec2_ceddda9d
37
+ import aws_cdk.aws_iam as _aws_cdk_aws_iam_ceddda9d
38
+ import aws_cdk.aws_lambda as _aws_cdk_aws_lambda_ceddda9d
39
+ import aws_cdk.aws_s3 as _aws_cdk_aws_s3_ceddda9d
40
+ import aws_solutions_constructs.core as _aws_solutions_constructs_core_ac4f6ab9
41
+ import constructs as _constructs_77d1e7e8
42
+
43
+
44
+ @jsii.enum(
45
+ jsii_type="@aws-solutions-constructs/aws-lambda-comprehend.ComprehendAnalysisType"
46
+ )
47
+ class ComprehendAnalysisType(enum.Enum):
48
+ '''The Amazon Comprehend analysis families a Lambda function may use.'''
49
+
50
+ DOMINANT_LANGUAGE = "DOMINANT_LANGUAGE"
51
+ ENTITIES = "ENTITIES"
52
+ KEY_PHRASES = "KEY_PHRASES"
53
+ SENTIMENT = "SENTIMENT"
54
+ TARGETED_SENTIMENT = "TARGETED_SENTIMENT"
55
+ SYNTAX = "SYNTAX"
56
+ PII = "PII"
57
+
58
+
59
+ @jsii.enum(
60
+ jsii_type="@aws-solutions-constructs/aws-lambda-comprehend.ComprehendUseCase"
61
+ )
62
+ class ComprehendUseCase(enum.Enum):
63
+ '''The Amazon Comprehend processing modes a Lambda function may use.
64
+
65
+ The actions granted to the
66
+ function are the cross product of the selected use cases and the selected analysis types.
67
+ '''
68
+
69
+ SINGLE_DOCUMENT_SYNC = "SINGLE_DOCUMENT_SYNC"
70
+ MULTI_DOCUMENT_SYNC = "MULTI_DOCUMENT_SYNC"
71
+ ASYNC_BATCH = "ASYNC_BATCH"
72
+
73
+
74
+ class LambdaToComprehend(
75
+ _constructs_77d1e7e8.Construct,
76
+ metaclass=jsii.JSIIMeta,
77
+ jsii_type="@aws-solutions-constructs/aws-lambda-comprehend.LambdaToComprehend",
78
+ ):
79
+ '''
80
+ :summary: The LambdaToComprehend class.
81
+ '''
82
+
83
+ def __init__(
84
+ self,
85
+ scope: "_constructs_77d1e7e8.Construct",
86
+ id: builtins.str,
87
+ *,
88
+ additional_permissions: typing.Optional[typing.Sequence[builtins.str]] = None,
89
+ analysis_types: typing.Optional[typing.Sequence["_aws_solutions_constructs_core_ac4f6ab9.ComprehendAnalysisType"]] = None,
90
+ comprehend_use_cases: typing.Optional[typing.Sequence["_aws_solutions_constructs_core_ac4f6ab9.ComprehendUseCase"]] = None,
91
+ data_access_role_arn_environment_variable_name: typing.Optional[builtins.str] = None,
92
+ deploy_vpc: typing.Optional[builtins.bool] = None,
93
+ destination_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
94
+ destination_bucket_props: typing.Optional[typing.Union["_aws_cdk_aws_s3_ceddda9d.BucketProps", typing.Dict[builtins.str, typing.Any]]] = None,
95
+ destination_logging_bucket_props: typing.Optional[typing.Union["_aws_cdk_aws_s3_ceddda9d.BucketProps", typing.Dict[builtins.str, typing.Any]]] = None,
96
+ existing_destination_bucket_obj: typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"] = None,
97
+ existing_lambda_obj: typing.Optional["_aws_cdk_aws_lambda_ceddda9d.Function"] = None,
98
+ existing_source_bucket_obj: typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"] = None,
99
+ existing_vpc: typing.Optional["_aws_cdk_aws_ec2_ceddda9d.IVpc"] = None,
100
+ lambda_function_props: typing.Optional[typing.Union["_aws_cdk_aws_lambda_ceddda9d.FunctionProps", typing.Dict[builtins.str, typing.Any]]] = None,
101
+ log_destination_s3_access_logs: typing.Optional[builtins.bool] = None,
102
+ log_source_s3_access_logs: typing.Optional[builtins.bool] = None,
103
+ source_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
104
+ source_bucket_props: typing.Optional[typing.Union["_aws_cdk_aws_s3_ceddda9d.BucketProps", typing.Dict[builtins.str, typing.Any]]] = None,
105
+ source_logging_bucket_props: typing.Optional[typing.Union["_aws_cdk_aws_s3_ceddda9d.BucketProps", typing.Dict[builtins.str, typing.Any]]] = None,
106
+ use_same_bucket: typing.Optional[builtins.bool] = None,
107
+ vpc_props: typing.Any = None,
108
+ ) -> None:
109
+ '''
110
+ :param scope: - represents the scope for all the resources.
111
+ :param id: - this is a a scope-unique id.
112
+ :param additional_permissions: Optional array of additional IAM permissions to grant to the Lambda function for Amazon Comprehend. This is intended for use with Comprehend actions and will assign a resource of '*' - permissions for other services with specific resources should add the permission using Function.addToRolePolicy(). Default: - None
113
+ :param analysis_types: The Amazon Comprehend analysis families the Lambda function will use. The IAM policy granted to the Lambda function is the cross product of comprehendUseCases and analysisTypes. Default: - All analysis types
114
+ :param comprehend_use_cases: The Amazon Comprehend processing modes the Lambda function will use. Selecting ASYNC_BATCH causes source and destination S3 buckets and a Comprehend data access role to be created. Default: - [ComprehendUseCase.SINGLE_DOCUMENT_SYNC, ComprehendUseCase.MULTI_DOCUMENT_SYNC]
115
+ :param data_access_role_arn_environment_variable_name: Optional Name for the Lambda function environment variable set to the ARN of the IAM role used for asynchronous analysis jobs. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - DATA_ACCESS_ROLE_ARN
116
+ :param deploy_vpc: Whether to create a new VPC based on ``vpcProps`` into which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern. Default: - false
117
+ :param destination_bucket_environment_variable_name: Optional Name for the Lambda function environment variable set to the name of the destination bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - DESTINATION_BUCKET_NAME
118
+ :param destination_bucket_props: Optional user provided props to override the default props for the destination S3 Bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - Default props are used
119
+ :param destination_logging_bucket_props: Optional user provided props to override the default props for the destination S3 Logging Bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - Default props are used
120
+ :param existing_destination_bucket_obj: Existing instance of S3 Bucket object for analysis results. If this is provided, then also providing destinationBucketProps causes an error. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - None
121
+ :param existing_lambda_obj: Optional - instance of an existing Lambda Function object, providing both this and ``lambdaFunctionProps`` will cause an error. Default: - None
122
+ :param existing_source_bucket_obj: Existing instance of S3 Bucket object for source documents. If this is provided, then also providing sourceBucketProps causes an error. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - None
123
+ :param existing_vpc: An optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for Amazon Comprehend. If comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH, a Gateway Endpoint for Amazon S3 will also be created. If an existing VPC is provided, the ``deployVpc`` property cannot be ``true``. This uses ``ec2.IVpc`` to allow clients to supply VPCs that exist outside the stack using the ``ec2.Vpc.fromLookup()`` method. Default: - None
124
+ :param lambda_function_props: Optional - user provided props to override the default props for the Lambda function. Providing both this and ``existingLambdaObj`` causes an error. Default: - Default properties are used.
125
+ :param log_destination_s3_access_logs: Whether to turn on Access Logging for the destination S3 bucket. Creates an S3 bucket with associated storage costs for the logs. Enabling Access Logging is a best practice. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - true
126
+ :param log_source_s3_access_logs: Whether to turn on Access Logging for the source S3 bucket. Creates an S3 bucket with associated storage costs for the logs. Enabling Access Logging is a best practice. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - true
127
+ :param source_bucket_environment_variable_name: Optional Name for the Lambda function environment variable set to the name of the source bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - SOURCE_BUCKET_NAME
128
+ :param source_bucket_props: Optional user provided props to override the default props for the source S3 Bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - Default props are used
129
+ :param source_logging_bucket_props: Optional user provided props to override the default props for the source S3 Logging Bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - Default props are used
130
+ :param use_same_bucket: Whether to use the same S3 bucket for both source documents and analysis results. When true, only the source bucket will be created and used for both purposes. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - false
131
+ :param vpc_props: Optional user provided properties to override the default properties for the new VPC. ``enableDnsHostnames``, ``enableDnsSupport``, ``natGateways`` and ``subnetConfiguration`` are set by the pattern, so any values for those properties supplied here will be overridden. If ``deployVpc`` is not ``true`` then this property will be ignored. Default: - None
132
+
133
+ :access: public
134
+ :summary: Constructs a new instance of the LambdaToComprehend class.
135
+ '''
136
+ if __debug__:
137
+ type_hints = typing.get_type_hints(_typecheckingstub__c5e759944011144ff103652395955fb586d2e15bd8368c961cad81c9785d327b)
138
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
139
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
140
+ props = LambdaToComprehendProps(
141
+ additional_permissions=additional_permissions,
142
+ analysis_types=analysis_types,
143
+ comprehend_use_cases=comprehend_use_cases,
144
+ data_access_role_arn_environment_variable_name=data_access_role_arn_environment_variable_name,
145
+ deploy_vpc=deploy_vpc,
146
+ destination_bucket_environment_variable_name=destination_bucket_environment_variable_name,
147
+ destination_bucket_props=destination_bucket_props,
148
+ destination_logging_bucket_props=destination_logging_bucket_props,
149
+ existing_destination_bucket_obj=existing_destination_bucket_obj,
150
+ existing_lambda_obj=existing_lambda_obj,
151
+ existing_source_bucket_obj=existing_source_bucket_obj,
152
+ existing_vpc=existing_vpc,
153
+ lambda_function_props=lambda_function_props,
154
+ log_destination_s3_access_logs=log_destination_s3_access_logs,
155
+ log_source_s3_access_logs=log_source_s3_access_logs,
156
+ source_bucket_environment_variable_name=source_bucket_environment_variable_name,
157
+ source_bucket_props=source_bucket_props,
158
+ source_logging_bucket_props=source_logging_bucket_props,
159
+ use_same_bucket=use_same_bucket,
160
+ vpc_props=vpc_props,
161
+ )
162
+
163
+ jsii.create(self.__class__, self, [scope, id, props])
164
+
165
+ @builtins.property
166
+ @jsii.member(jsii_name="lambdaFunction")
167
+ def lambda_function(self) -> "_aws_cdk_aws_lambda_ceddda9d.Function":
168
+ return typing.cast("_aws_cdk_aws_lambda_ceddda9d.Function", jsii.get(self, "lambdaFunction"))
169
+
170
+ @builtins.property
171
+ @jsii.member(jsii_name="dataAccessRole")
172
+ def data_access_role(self) -> typing.Optional["_aws_cdk_aws_iam_ceddda9d.Role"]:
173
+ return typing.cast(typing.Optional["_aws_cdk_aws_iam_ceddda9d.Role"], jsii.get(self, "dataAccessRole"))
174
+
175
+ @builtins.property
176
+ @jsii.member(jsii_name="destinationBucket")
177
+ def destination_bucket(self) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.Bucket"]:
178
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.Bucket"], jsii.get(self, "destinationBucket"))
179
+
180
+ @builtins.property
181
+ @jsii.member(jsii_name="destinationBucketInterface")
182
+ def destination_bucket_interface(
183
+ self,
184
+ ) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"]:
185
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"], jsii.get(self, "destinationBucketInterface"))
186
+
187
+ @builtins.property
188
+ @jsii.member(jsii_name="destinationLoggingBucket")
189
+ def destination_logging_bucket(
190
+ self,
191
+ ) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.Bucket"]:
192
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.Bucket"], jsii.get(self, "destinationLoggingBucket"))
193
+
194
+ @builtins.property
195
+ @jsii.member(jsii_name="sourceBucket")
196
+ def source_bucket(self) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.Bucket"]:
197
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.Bucket"], jsii.get(self, "sourceBucket"))
198
+
199
+ @builtins.property
200
+ @jsii.member(jsii_name="sourceBucketInterface")
201
+ def source_bucket_interface(
202
+ self,
203
+ ) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"]:
204
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"], jsii.get(self, "sourceBucketInterface"))
205
+
206
+ @builtins.property
207
+ @jsii.member(jsii_name="sourceLoggingBucket")
208
+ def source_logging_bucket(
209
+ self,
210
+ ) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.Bucket"]:
211
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.Bucket"], jsii.get(self, "sourceLoggingBucket"))
212
+
213
+ @builtins.property
214
+ @jsii.member(jsii_name="vpc")
215
+ def vpc(self) -> typing.Optional["_aws_cdk_aws_ec2_ceddda9d.IVpc"]:
216
+ return typing.cast(typing.Optional["_aws_cdk_aws_ec2_ceddda9d.IVpc"], jsii.get(self, "vpc"))
217
+
218
+
219
+ @jsii.data_type(
220
+ jsii_type="@aws-solutions-constructs/aws-lambda-comprehend.LambdaToComprehendProps",
221
+ jsii_struct_bases=[],
222
+ name_mapping={
223
+ "additional_permissions": "additionalPermissions",
224
+ "analysis_types": "analysisTypes",
225
+ "comprehend_use_cases": "comprehendUseCases",
226
+ "data_access_role_arn_environment_variable_name": "dataAccessRoleArnEnvironmentVariableName",
227
+ "deploy_vpc": "deployVpc",
228
+ "destination_bucket_environment_variable_name": "destinationBucketEnvironmentVariableName",
229
+ "destination_bucket_props": "destinationBucketProps",
230
+ "destination_logging_bucket_props": "destinationLoggingBucketProps",
231
+ "existing_destination_bucket_obj": "existingDestinationBucketObj",
232
+ "existing_lambda_obj": "existingLambdaObj",
233
+ "existing_source_bucket_obj": "existingSourceBucketObj",
234
+ "existing_vpc": "existingVpc",
235
+ "lambda_function_props": "lambdaFunctionProps",
236
+ "log_destination_s3_access_logs": "logDestinationS3AccessLogs",
237
+ "log_source_s3_access_logs": "logSourceS3AccessLogs",
238
+ "source_bucket_environment_variable_name": "sourceBucketEnvironmentVariableName",
239
+ "source_bucket_props": "sourceBucketProps",
240
+ "source_logging_bucket_props": "sourceLoggingBucketProps",
241
+ "use_same_bucket": "useSameBucket",
242
+ "vpc_props": "vpcProps",
243
+ },
244
+ )
245
+ class LambdaToComprehendProps:
246
+ def __init__(
247
+ self,
248
+ *,
249
+ additional_permissions: typing.Optional[typing.Sequence[builtins.str]] = None,
250
+ analysis_types: typing.Optional[typing.Sequence["_aws_solutions_constructs_core_ac4f6ab9.ComprehendAnalysisType"]] = None,
251
+ comprehend_use_cases: typing.Optional[typing.Sequence["_aws_solutions_constructs_core_ac4f6ab9.ComprehendUseCase"]] = None,
252
+ data_access_role_arn_environment_variable_name: typing.Optional[builtins.str] = None,
253
+ deploy_vpc: typing.Optional[builtins.bool] = None,
254
+ destination_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
255
+ destination_bucket_props: typing.Optional[typing.Union["_aws_cdk_aws_s3_ceddda9d.BucketProps", typing.Dict[builtins.str, typing.Any]]] = None,
256
+ destination_logging_bucket_props: typing.Optional[typing.Union["_aws_cdk_aws_s3_ceddda9d.BucketProps", typing.Dict[builtins.str, typing.Any]]] = None,
257
+ existing_destination_bucket_obj: typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"] = None,
258
+ existing_lambda_obj: typing.Optional["_aws_cdk_aws_lambda_ceddda9d.Function"] = None,
259
+ existing_source_bucket_obj: typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"] = None,
260
+ existing_vpc: typing.Optional["_aws_cdk_aws_ec2_ceddda9d.IVpc"] = None,
261
+ lambda_function_props: typing.Optional[typing.Union["_aws_cdk_aws_lambda_ceddda9d.FunctionProps", typing.Dict[builtins.str, typing.Any]]] = None,
262
+ log_destination_s3_access_logs: typing.Optional[builtins.bool] = None,
263
+ log_source_s3_access_logs: typing.Optional[builtins.bool] = None,
264
+ source_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
265
+ source_bucket_props: typing.Optional[typing.Union["_aws_cdk_aws_s3_ceddda9d.BucketProps", typing.Dict[builtins.str, typing.Any]]] = None,
266
+ source_logging_bucket_props: typing.Optional[typing.Union["_aws_cdk_aws_s3_ceddda9d.BucketProps", typing.Dict[builtins.str, typing.Any]]] = None,
267
+ use_same_bucket: typing.Optional[builtins.bool] = None,
268
+ vpc_props: typing.Any = None,
269
+ ) -> None:
270
+ '''
271
+ :param additional_permissions: Optional array of additional IAM permissions to grant to the Lambda function for Amazon Comprehend. This is intended for use with Comprehend actions and will assign a resource of '*' - permissions for other services with specific resources should add the permission using Function.addToRolePolicy(). Default: - None
272
+ :param analysis_types: The Amazon Comprehend analysis families the Lambda function will use. The IAM policy granted to the Lambda function is the cross product of comprehendUseCases and analysisTypes. Default: - All analysis types
273
+ :param comprehend_use_cases: The Amazon Comprehend processing modes the Lambda function will use. Selecting ASYNC_BATCH causes source and destination S3 buckets and a Comprehend data access role to be created. Default: - [ComprehendUseCase.SINGLE_DOCUMENT_SYNC, ComprehendUseCase.MULTI_DOCUMENT_SYNC]
274
+ :param data_access_role_arn_environment_variable_name: Optional Name for the Lambda function environment variable set to the ARN of the IAM role used for asynchronous analysis jobs. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - DATA_ACCESS_ROLE_ARN
275
+ :param deploy_vpc: Whether to create a new VPC based on ``vpcProps`` into which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern. Default: - false
276
+ :param destination_bucket_environment_variable_name: Optional Name for the Lambda function environment variable set to the name of the destination bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - DESTINATION_BUCKET_NAME
277
+ :param destination_bucket_props: Optional user provided props to override the default props for the destination S3 Bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - Default props are used
278
+ :param destination_logging_bucket_props: Optional user provided props to override the default props for the destination S3 Logging Bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - Default props are used
279
+ :param existing_destination_bucket_obj: Existing instance of S3 Bucket object for analysis results. If this is provided, then also providing destinationBucketProps causes an error. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - None
280
+ :param existing_lambda_obj: Optional - instance of an existing Lambda Function object, providing both this and ``lambdaFunctionProps`` will cause an error. Default: - None
281
+ :param existing_source_bucket_obj: Existing instance of S3 Bucket object for source documents. If this is provided, then also providing sourceBucketProps causes an error. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - None
282
+ :param existing_vpc: An optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for Amazon Comprehend. If comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH, a Gateway Endpoint for Amazon S3 will also be created. If an existing VPC is provided, the ``deployVpc`` property cannot be ``true``. This uses ``ec2.IVpc`` to allow clients to supply VPCs that exist outside the stack using the ``ec2.Vpc.fromLookup()`` method. Default: - None
283
+ :param lambda_function_props: Optional - user provided props to override the default props for the Lambda function. Providing both this and ``existingLambdaObj`` causes an error. Default: - Default properties are used.
284
+ :param log_destination_s3_access_logs: Whether to turn on Access Logging for the destination S3 bucket. Creates an S3 bucket with associated storage costs for the logs. Enabling Access Logging is a best practice. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - true
285
+ :param log_source_s3_access_logs: Whether to turn on Access Logging for the source S3 bucket. Creates an S3 bucket with associated storage costs for the logs. Enabling Access Logging is a best practice. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - true
286
+ :param source_bucket_environment_variable_name: Optional Name for the Lambda function environment variable set to the name of the source bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - SOURCE_BUCKET_NAME
287
+ :param source_bucket_props: Optional user provided props to override the default props for the source S3 Bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - Default props are used
288
+ :param source_logging_bucket_props: Optional user provided props to override the default props for the source S3 Logging Bucket. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - Default props are used
289
+ :param use_same_bucket: Whether to use the same S3 bucket for both source documents and analysis results. When true, only the source bucket will be created and used for both purposes. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH. Default: - false
290
+ :param vpc_props: Optional user provided properties to override the default properties for the new VPC. ``enableDnsHostnames``, ``enableDnsSupport``, ``natGateways`` and ``subnetConfiguration`` are set by the pattern, so any values for those properties supplied here will be overridden. If ``deployVpc`` is not ``true`` then this property will be ignored. Default: - None
291
+
292
+ :summary: The properties for the LambdaToComprehend class.
293
+ '''
294
+ if isinstance(destination_bucket_props, dict):
295
+ destination_bucket_props = _aws_cdk_aws_s3_ceddda9d.BucketProps(**destination_bucket_props)
296
+ if isinstance(destination_logging_bucket_props, dict):
297
+ destination_logging_bucket_props = _aws_cdk_aws_s3_ceddda9d.BucketProps(**destination_logging_bucket_props)
298
+ if isinstance(lambda_function_props, dict):
299
+ lambda_function_props = _aws_cdk_aws_lambda_ceddda9d.FunctionProps(**lambda_function_props)
300
+ if isinstance(source_bucket_props, dict):
301
+ source_bucket_props = _aws_cdk_aws_s3_ceddda9d.BucketProps(**source_bucket_props)
302
+ if isinstance(source_logging_bucket_props, dict):
303
+ source_logging_bucket_props = _aws_cdk_aws_s3_ceddda9d.BucketProps(**source_logging_bucket_props)
304
+ if __debug__:
305
+ type_hints = typing.get_type_hints(_typecheckingstub__d800e921afd359c89b606363d604034dc212a2b98d86cd95543509d8ff9fe06e)
306
+ check_type(argname="argument additional_permissions", value=additional_permissions, expected_type=type_hints["additional_permissions"])
307
+ check_type(argname="argument analysis_types", value=analysis_types, expected_type=type_hints["analysis_types"])
308
+ check_type(argname="argument comprehend_use_cases", value=comprehend_use_cases, expected_type=type_hints["comprehend_use_cases"])
309
+ check_type(argname="argument data_access_role_arn_environment_variable_name", value=data_access_role_arn_environment_variable_name, expected_type=type_hints["data_access_role_arn_environment_variable_name"])
310
+ check_type(argname="argument deploy_vpc", value=deploy_vpc, expected_type=type_hints["deploy_vpc"])
311
+ check_type(argname="argument destination_bucket_environment_variable_name", value=destination_bucket_environment_variable_name, expected_type=type_hints["destination_bucket_environment_variable_name"])
312
+ check_type(argname="argument destination_bucket_props", value=destination_bucket_props, expected_type=type_hints["destination_bucket_props"])
313
+ check_type(argname="argument destination_logging_bucket_props", value=destination_logging_bucket_props, expected_type=type_hints["destination_logging_bucket_props"])
314
+ check_type(argname="argument existing_destination_bucket_obj", value=existing_destination_bucket_obj, expected_type=type_hints["existing_destination_bucket_obj"])
315
+ check_type(argname="argument existing_lambda_obj", value=existing_lambda_obj, expected_type=type_hints["existing_lambda_obj"])
316
+ check_type(argname="argument existing_source_bucket_obj", value=existing_source_bucket_obj, expected_type=type_hints["existing_source_bucket_obj"])
317
+ check_type(argname="argument existing_vpc", value=existing_vpc, expected_type=type_hints["existing_vpc"])
318
+ check_type(argname="argument lambda_function_props", value=lambda_function_props, expected_type=type_hints["lambda_function_props"])
319
+ check_type(argname="argument log_destination_s3_access_logs", value=log_destination_s3_access_logs, expected_type=type_hints["log_destination_s3_access_logs"])
320
+ check_type(argname="argument log_source_s3_access_logs", value=log_source_s3_access_logs, expected_type=type_hints["log_source_s3_access_logs"])
321
+ check_type(argname="argument source_bucket_environment_variable_name", value=source_bucket_environment_variable_name, expected_type=type_hints["source_bucket_environment_variable_name"])
322
+ check_type(argname="argument source_bucket_props", value=source_bucket_props, expected_type=type_hints["source_bucket_props"])
323
+ check_type(argname="argument source_logging_bucket_props", value=source_logging_bucket_props, expected_type=type_hints["source_logging_bucket_props"])
324
+ check_type(argname="argument use_same_bucket", value=use_same_bucket, expected_type=type_hints["use_same_bucket"])
325
+ check_type(argname="argument vpc_props", value=vpc_props, expected_type=type_hints["vpc_props"])
326
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
327
+ if additional_permissions is not None:
328
+ self._values["additional_permissions"] = additional_permissions
329
+ if analysis_types is not None:
330
+ self._values["analysis_types"] = analysis_types
331
+ if comprehend_use_cases is not None:
332
+ self._values["comprehend_use_cases"] = comprehend_use_cases
333
+ if data_access_role_arn_environment_variable_name is not None:
334
+ self._values["data_access_role_arn_environment_variable_name"] = data_access_role_arn_environment_variable_name
335
+ if deploy_vpc is not None:
336
+ self._values["deploy_vpc"] = deploy_vpc
337
+ if destination_bucket_environment_variable_name is not None:
338
+ self._values["destination_bucket_environment_variable_name"] = destination_bucket_environment_variable_name
339
+ if destination_bucket_props is not None:
340
+ self._values["destination_bucket_props"] = destination_bucket_props
341
+ if destination_logging_bucket_props is not None:
342
+ self._values["destination_logging_bucket_props"] = destination_logging_bucket_props
343
+ if existing_destination_bucket_obj is not None:
344
+ self._values["existing_destination_bucket_obj"] = existing_destination_bucket_obj
345
+ if existing_lambda_obj is not None:
346
+ self._values["existing_lambda_obj"] = existing_lambda_obj
347
+ if existing_source_bucket_obj is not None:
348
+ self._values["existing_source_bucket_obj"] = existing_source_bucket_obj
349
+ if existing_vpc is not None:
350
+ self._values["existing_vpc"] = existing_vpc
351
+ if lambda_function_props is not None:
352
+ self._values["lambda_function_props"] = lambda_function_props
353
+ if log_destination_s3_access_logs is not None:
354
+ self._values["log_destination_s3_access_logs"] = log_destination_s3_access_logs
355
+ if log_source_s3_access_logs is not None:
356
+ self._values["log_source_s3_access_logs"] = log_source_s3_access_logs
357
+ if source_bucket_environment_variable_name is not None:
358
+ self._values["source_bucket_environment_variable_name"] = source_bucket_environment_variable_name
359
+ if source_bucket_props is not None:
360
+ self._values["source_bucket_props"] = source_bucket_props
361
+ if source_logging_bucket_props is not None:
362
+ self._values["source_logging_bucket_props"] = source_logging_bucket_props
363
+ if use_same_bucket is not None:
364
+ self._values["use_same_bucket"] = use_same_bucket
365
+ if vpc_props is not None:
366
+ self._values["vpc_props"] = vpc_props
367
+
368
+ @builtins.property
369
+ def additional_permissions(self) -> typing.Optional[typing.List[builtins.str]]:
370
+ '''Optional array of additional IAM permissions to grant to the Lambda function for Amazon Comprehend.
371
+
372
+ This is
373
+ intended for use with Comprehend actions and will assign a resource of '*' - permissions for other services with
374
+ specific resources should add the permission using Function.addToRolePolicy().
375
+
376
+ :default: - None
377
+ '''
378
+ result = self._values.get("additional_permissions")
379
+ return typing.cast(typing.Optional[typing.List[builtins.str]], result)
380
+
381
+ @builtins.property
382
+ def analysis_types(
383
+ self,
384
+ ) -> typing.Optional[typing.List["_aws_solutions_constructs_core_ac4f6ab9.ComprehendAnalysisType"]]:
385
+ '''The Amazon Comprehend analysis families the Lambda function will use.
386
+
387
+ The IAM policy granted to the Lambda
388
+ function is the cross product of comprehendUseCases and analysisTypes.
389
+
390
+ :default: - All analysis types
391
+ '''
392
+ result = self._values.get("analysis_types")
393
+ return typing.cast(typing.Optional[typing.List["_aws_solutions_constructs_core_ac4f6ab9.ComprehendAnalysisType"]], result)
394
+
395
+ @builtins.property
396
+ def comprehend_use_cases(
397
+ self,
398
+ ) -> typing.Optional[typing.List["_aws_solutions_constructs_core_ac4f6ab9.ComprehendUseCase"]]:
399
+ '''The Amazon Comprehend processing modes the Lambda function will use.
400
+
401
+ Selecting ASYNC_BATCH causes source and
402
+ destination S3 buckets and a Comprehend data access role to be created.
403
+
404
+ :default: - [ComprehendUseCase.SINGLE_DOCUMENT_SYNC, ComprehendUseCase.MULTI_DOCUMENT_SYNC]
405
+ '''
406
+ result = self._values.get("comprehend_use_cases")
407
+ return typing.cast(typing.Optional[typing.List["_aws_solutions_constructs_core_ac4f6ab9.ComprehendUseCase"]], result)
408
+
409
+ @builtins.property
410
+ def data_access_role_arn_environment_variable_name(
411
+ self,
412
+ ) -> typing.Optional[builtins.str]:
413
+ '''Optional Name for the Lambda function environment variable set to the ARN of the IAM role used for asynchronous analysis jobs.
414
+
415
+ Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH.
416
+
417
+ :default: - DATA_ACCESS_ROLE_ARN
418
+ '''
419
+ result = self._values.get("data_access_role_arn_environment_variable_name")
420
+ return typing.cast(typing.Optional[builtins.str], result)
421
+
422
+ @builtins.property
423
+ def deploy_vpc(self) -> typing.Optional[builtins.bool]:
424
+ '''Whether to create a new VPC based on ``vpcProps`` into which to deploy this pattern.
425
+
426
+ Setting this to true will
427
+ deploy the minimal, most private VPC to run the pattern.
428
+
429
+ :default: - false
430
+ '''
431
+ result = self._values.get("deploy_vpc")
432
+ return typing.cast(typing.Optional[builtins.bool], result)
433
+
434
+ @builtins.property
435
+ def destination_bucket_environment_variable_name(
436
+ self,
437
+ ) -> typing.Optional[builtins.str]:
438
+ '''Optional Name for the Lambda function environment variable set to the name of the destination bucket.
439
+
440
+ Only valid
441
+ when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH.
442
+
443
+ :default: - DESTINATION_BUCKET_NAME
444
+ '''
445
+ result = self._values.get("destination_bucket_environment_variable_name")
446
+ return typing.cast(typing.Optional[builtins.str], result)
447
+
448
+ @builtins.property
449
+ def destination_bucket_props(
450
+ self,
451
+ ) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.BucketProps"]:
452
+ '''Optional user provided props to override the default props for the destination S3 Bucket.
453
+
454
+ Only valid when
455
+ comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH.
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
+ Only valid
469
+ when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH.
470
+
471
+ :default: - Default props are used
472
+ '''
473
+ result = self._values.get("destination_logging_bucket_props")
474
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.BucketProps"], result)
475
+
476
+ @builtins.property
477
+ def existing_destination_bucket_obj(
478
+ self,
479
+ ) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"]:
480
+ '''Existing instance of S3 Bucket object for analysis results.
481
+
482
+ If this is provided, then also providing
483
+ destinationBucketProps causes an error. Only valid when comprehendUseCases includes
484
+ ComprehendUseCase.ASYNC_BATCH.
485
+
486
+ :default: - None
487
+ '''
488
+ result = self._values.get("existing_destination_bucket_obj")
489
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"], result)
490
+
491
+ @builtins.property
492
+ def existing_lambda_obj(
493
+ self,
494
+ ) -> typing.Optional["_aws_cdk_aws_lambda_ceddda9d.Function"]:
495
+ '''Optional - instance of an existing Lambda Function object, providing both this and ``lambdaFunctionProps`` will cause an error.
496
+
497
+ :default: - None
498
+ '''
499
+ result = self._values.get("existing_lambda_obj")
500
+ return typing.cast(typing.Optional["_aws_cdk_aws_lambda_ceddda9d.Function"], result)
501
+
502
+ @builtins.property
503
+ def existing_source_bucket_obj(
504
+ self,
505
+ ) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"]:
506
+ '''Existing instance of S3 Bucket object for source documents.
507
+
508
+ If this is provided, then also providing
509
+ sourceBucketProps causes an error. Only valid when comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH.
510
+
511
+ :default: - None
512
+ '''
513
+ result = self._values.get("existing_source_bucket_obj")
514
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.IBucket"], result)
515
+
516
+ @builtins.property
517
+ def existing_vpc(self) -> typing.Optional["_aws_cdk_aws_ec2_ceddda9d.IVpc"]:
518
+ '''An optional, existing VPC into which this pattern should be deployed.
519
+
520
+ When deployed in a VPC, the Lambda function
521
+ will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for
522
+ Amazon Comprehend. If comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH, a Gateway Endpoint for Amazon S3
523
+ will also be created. If an existing VPC is provided, the ``deployVpc`` property cannot be ``true``. This uses
524
+ ``ec2.IVpc`` to allow clients to supply VPCs that exist outside the stack using the ``ec2.Vpc.fromLookup()`` method.
525
+
526
+ :default: - None
527
+ '''
528
+ result = self._values.get("existing_vpc")
529
+ return typing.cast(typing.Optional["_aws_cdk_aws_ec2_ceddda9d.IVpc"], result)
530
+
531
+ @builtins.property
532
+ def lambda_function_props(
533
+ self,
534
+ ) -> typing.Optional["_aws_cdk_aws_lambda_ceddda9d.FunctionProps"]:
535
+ '''Optional - user provided props to override the default props for the Lambda function.
536
+
537
+ Providing both this and
538
+ ``existingLambdaObj`` causes an error.
539
+
540
+ :default: - Default properties are used.
541
+ '''
542
+ result = self._values.get("lambda_function_props")
543
+ return typing.cast(typing.Optional["_aws_cdk_aws_lambda_ceddda9d.FunctionProps"], result)
544
+
545
+ @builtins.property
546
+ def log_destination_s3_access_logs(self) -> typing.Optional[builtins.bool]:
547
+ '''Whether to turn on Access Logging for the destination S3 bucket.
548
+
549
+ Creates an S3 bucket with associated storage
550
+ costs for the logs. Enabling Access Logging is a best practice. Only valid when comprehendUseCases includes
551
+ ComprehendUseCase.ASYNC_BATCH.
552
+
553
+ :default: - true
554
+ '''
555
+ result = self._values.get("log_destination_s3_access_logs")
556
+ return typing.cast(typing.Optional[builtins.bool], result)
557
+
558
+ @builtins.property
559
+ def log_source_s3_access_logs(self) -> typing.Optional[builtins.bool]:
560
+ '''Whether to turn on Access Logging for the source S3 bucket.
561
+
562
+ Creates an S3 bucket with associated storage costs
563
+ for the logs. Enabling Access Logging is a best practice. Only valid when comprehendUseCases includes
564
+ ComprehendUseCase.ASYNC_BATCH.
565
+
566
+ :default: - true
567
+ '''
568
+ result = self._values.get("log_source_s3_access_logs")
569
+ return typing.cast(typing.Optional[builtins.bool], result)
570
+
571
+ @builtins.property
572
+ def source_bucket_environment_variable_name(self) -> typing.Optional[builtins.str]:
573
+ '''Optional Name for the Lambda function environment variable set to the name of the source bucket.
574
+
575
+ Only valid when
576
+ comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH.
577
+
578
+ :default: - SOURCE_BUCKET_NAME
579
+ '''
580
+ result = self._values.get("source_bucket_environment_variable_name")
581
+ return typing.cast(typing.Optional[builtins.str], result)
582
+
583
+ @builtins.property
584
+ def source_bucket_props(
585
+ self,
586
+ ) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.BucketProps"]:
587
+ '''Optional user provided props to override the default props for the source S3 Bucket.
588
+
589
+ Only valid when
590
+ comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH.
591
+
592
+ :default: - Default props are used
593
+ '''
594
+ result = self._values.get("source_bucket_props")
595
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.BucketProps"], result)
596
+
597
+ @builtins.property
598
+ def source_logging_bucket_props(
599
+ self,
600
+ ) -> typing.Optional["_aws_cdk_aws_s3_ceddda9d.BucketProps"]:
601
+ '''Optional user provided props to override the default props for the source S3 Logging Bucket.
602
+
603
+ Only valid when
604
+ comprehendUseCases includes ComprehendUseCase.ASYNC_BATCH.
605
+
606
+ :default: - Default props are used
607
+ '''
608
+ result = self._values.get("source_logging_bucket_props")
609
+ return typing.cast(typing.Optional["_aws_cdk_aws_s3_ceddda9d.BucketProps"], result)
610
+
611
+ @builtins.property
612
+ def use_same_bucket(self) -> typing.Optional[builtins.bool]:
613
+ '''Whether to use the same S3 bucket for both source documents and analysis results.
614
+
615
+ When true, only the source
616
+ bucket will be created and used for both purposes. Only valid when comprehendUseCases includes
617
+ ComprehendUseCase.ASYNC_BATCH.
618
+
619
+ :default: - false
620
+ '''
621
+ result = self._values.get("use_same_bucket")
622
+ return typing.cast(typing.Optional[builtins.bool], result)
623
+
624
+ @builtins.property
625
+ def vpc_props(self) -> typing.Any:
626
+ '''Optional user provided properties to override the default properties for the new VPC.
627
+
628
+ ``enableDnsHostnames``,
629
+ ``enableDnsSupport``, ``natGateways`` and ``subnetConfiguration`` are set by the pattern, so any values for those
630
+ properties supplied here will be overridden. If ``deployVpc`` is not ``true`` then this property will be ignored.
631
+
632
+ :default: - None
633
+ '''
634
+ result = self._values.get("vpc_props")
635
+ return typing.cast(typing.Any, result)
636
+
637
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
638
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
639
+
640
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
641
+ return not (rhs == self)
642
+
643
+ def __repr__(self) -> str:
644
+ return "LambdaToComprehendProps(%s)" % ", ".join(
645
+ k + "=" + repr(v) for k, v in self._values.items()
646
+ )
647
+
648
+
649
+ __all__ = [
650
+ "ComprehendAnalysisType",
651
+ "ComprehendUseCase",
652
+ "LambdaToComprehend",
653
+ "LambdaToComprehendProps",
654
+ ]
655
+
656
+ publication.publish()
657
+
658
+ def _typecheckingstub__c5e759944011144ff103652395955fb586d2e15bd8368c961cad81c9785d327b(
659
+ scope: _constructs_77d1e7e8.Construct,
660
+ id: builtins.str,
661
+ *,
662
+ additional_permissions: typing.Optional[typing.Sequence[builtins.str]] = None,
663
+ analysis_types: typing.Optional[typing.Sequence[_aws_solutions_constructs_core_ac4f6ab9.ComprehendAnalysisType]] = None,
664
+ comprehend_use_cases: typing.Optional[typing.Sequence[_aws_solutions_constructs_core_ac4f6ab9.ComprehendUseCase]] = None,
665
+ data_access_role_arn_environment_variable_name: typing.Optional[builtins.str] = None,
666
+ deploy_vpc: typing.Optional[builtins.bool] = None,
667
+ destination_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
668
+ destination_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
669
+ destination_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
670
+ existing_destination_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
671
+ existing_lambda_obj: typing.Optional[_aws_cdk_aws_lambda_ceddda9d.Function] = None,
672
+ existing_source_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
673
+ existing_vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
674
+ lambda_function_props: typing.Optional[typing.Union[_aws_cdk_aws_lambda_ceddda9d.FunctionProps, typing.Dict[builtins.str, typing.Any]]] = None,
675
+ log_destination_s3_access_logs: typing.Optional[builtins.bool] = None,
676
+ log_source_s3_access_logs: typing.Optional[builtins.bool] = None,
677
+ source_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
678
+ source_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
679
+ source_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
680
+ use_same_bucket: typing.Optional[builtins.bool] = None,
681
+ vpc_props: typing.Any = None,
682
+ ) -> None:
683
+ """Type checking stubs"""
684
+ pass
685
+
686
+ def _typecheckingstub__d800e921afd359c89b606363d604034dc212a2b98d86cd95543509d8ff9fe06e(
687
+ *,
688
+ additional_permissions: typing.Optional[typing.Sequence[builtins.str]] = None,
689
+ analysis_types: typing.Optional[typing.Sequence[_aws_solutions_constructs_core_ac4f6ab9.ComprehendAnalysisType]] = None,
690
+ comprehend_use_cases: typing.Optional[typing.Sequence[_aws_solutions_constructs_core_ac4f6ab9.ComprehendUseCase]] = None,
691
+ data_access_role_arn_environment_variable_name: typing.Optional[builtins.str] = None,
692
+ deploy_vpc: typing.Optional[builtins.bool] = None,
693
+ destination_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
694
+ destination_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
695
+ destination_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
696
+ existing_destination_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
697
+ existing_lambda_obj: typing.Optional[_aws_cdk_aws_lambda_ceddda9d.Function] = None,
698
+ existing_source_bucket_obj: typing.Optional[_aws_cdk_aws_s3_ceddda9d.IBucket] = None,
699
+ existing_vpc: typing.Optional[_aws_cdk_aws_ec2_ceddda9d.IVpc] = None,
700
+ lambda_function_props: typing.Optional[typing.Union[_aws_cdk_aws_lambda_ceddda9d.FunctionProps, typing.Dict[builtins.str, typing.Any]]] = None,
701
+ log_destination_s3_access_logs: typing.Optional[builtins.bool] = None,
702
+ log_source_s3_access_logs: typing.Optional[builtins.bool] = None,
703
+ source_bucket_environment_variable_name: typing.Optional[builtins.str] = None,
704
+ source_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
705
+ source_logging_bucket_props: typing.Optional[typing.Union[_aws_cdk_aws_s3_ceddda9d.BucketProps, typing.Dict[builtins.str, typing.Any]]] = None,
706
+ use_same_bucket: typing.Optional[builtins.bool] = None,
707
+ vpc_props: typing.Any = None,
708
+ ) -> None:
709
+ """Type checking stubs"""
710
+ 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-comprehend",
37
+ "2.104.0",
38
+ __name__[0:-6],
39
+ "aws-lambda-comprehend@2.104.0.jsii.tgz",
40
+ )
41
+
42
+ __all__ = [
43
+ "__jsii_assembly__",
44
+ ]
45
+
46
+ publication.publish()
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.1
2
+ Name: aws-solutions-constructs.aws-lambda-comprehend
3
+ Version: 2.104.0
4
+ Summary: CDK constructs for defining an interaction between an AWS Lambda function and Amazon Comprehend natural language processing service with optional S3 buckets for asynchronous analysis jobs.
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.266.0
22
+ Requires-Dist: aws-solutions-constructs.core==2.104.0
23
+ Requires-Dist: constructs<11.0.0,>=10.0.0
24
+ Requires-Dist: jsii<2.0.0,>=1.126.0
25
+ Requires-Dist: publication>=0.0.3
26
+ Requires-Dist: typeguard==2.13.3
27
+
28
+ Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-lambda-comprehend/README.adoc)
@@ -0,0 +1,14 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ setup.py
6
+ src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/PKG-INFO
7
+ src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/SOURCES.txt
8
+ src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/dependency_links.txt
9
+ src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/requires.txt
10
+ src/aws_solutions_constructs.aws_lambda_comprehend.egg-info/top_level.txt
11
+ src/aws_solutions_constructs/aws_lambda_comprehend/__init__.py
12
+ src/aws_solutions_constructs/aws_lambda_comprehend/py.typed
13
+ src/aws_solutions_constructs/aws_lambda_comprehend/_jsii/__init__.py
14
+ src/aws_solutions_constructs/aws_lambda_comprehend/_jsii/aws-lambda-comprehend@2.104.0.jsii.tgz
@@ -0,0 +1,6 @@
1
+ aws-cdk-lib<3.0.0,>=2.266.0
2
+ aws-solutions-constructs.core==2.104.0
3
+ constructs<11.0.0,>=10.0.0
4
+ jsii<2.0.0,>=1.126.0
5
+ publication>=0.0.3
6
+ typeguard==2.13.3