aws-solutions-constructs.aws-apigatewayv2websocket-sqs 2.85.2__py3-none-any.whl → 2.85.3__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.
- aws_solutions_constructs/aws_apigatewayv2websocket_sqs/__init__.py +1 -149
- aws_solutions_constructs/aws_apigatewayv2websocket_sqs/_jsii/__init__.py +2 -2
- aws_solutions_constructs/aws_apigatewayv2websocket_sqs/_jsii/aws-apigatewayv2websocket-sqs@2.85.3.jsii.tgz +0 -0
- aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info/METADATA +28 -0
- aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info/RECORD +9 -0
- aws_solutions_constructs/aws_apigatewayv2websocket_sqs/_jsii/aws-apigatewayv2websocket-sqs@2.85.2.jsii.tgz +0 -0
- aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info/METADATA +0 -176
- aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info/RECORD +0 -9
- {aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info → aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info}/LICENSE +0 -0
- {aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info → aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info}/WHEEL +0 -0
- {aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info → aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info}/top_level.txt +0 -0
@@ -1,153 +1,5 @@
|
|
1
1
|
r'''
|
2
|
-
|
3
|
-
|
4
|
-
<!--BEGIN STABILITY BANNER-->---
|
5
|
-
|
6
|
-
|
7
|
-

|
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|`aws_solutions_constructs.aws_apigatewayv2websocket_sqs`|
|
20
|
-
| Typescript|`@aws-solutions-constructs/aws-apigatewayv2websocket-sqs`|
|
21
|
-
| Java|`software.amazon.awsconstructs.services.apigatewayv2websocketsqs`|
|
22
|
-
|
23
|
-
## Overview
|
24
|
-
|
25
|
-
This AWS Solutions Construct implements an Amazon API Gateway WebSocket connected to an Amazon SQS queue pattern.
|
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 {
|
35
|
-
ApiGatewayV2WebSocketToSqs,
|
36
|
-
ApiGatewayV2WebSocketToSqsProps,
|
37
|
-
} from "@aws-solutions-constructs/aws-apigatewayv2websocket-sqs";
|
38
|
-
import { WebSocketLambdaAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
|
39
|
-
|
40
|
-
const authorizer = new WebSocketLambdaAuthorizer('Authorizer', authHandler);
|
41
|
-
|
42
|
-
new ApiGateApiGatewayV2WebSocketToSqswayToSqs(this, "ApiGatewayV2WebSocketToSqsPattern", {
|
43
|
-
webSocketApiProps: {
|
44
|
-
connectRouteOptions: {
|
45
|
-
integration: new WebSocketLambdaIntegration("ConnectIntegration", connectLambda),
|
46
|
-
authorizer: authorizer,
|
47
|
-
},
|
48
|
-
disconnectRouteOptions: {
|
49
|
-
integration: new WebSocketLambdaIntegration("DisconnectIntegration", disconnectLambda),
|
50
|
-
},
|
51
|
-
},
|
52
|
-
createDefaultRoute: true
|
53
|
-
});
|
54
|
-
```
|
55
|
-
|
56
|
-
Python
|
57
|
-
|
58
|
-
```python
|
59
|
-
from aws_solutions_constructs.aws_apigateway_sqs import ApiGatewayV2WebSocketToSqs
|
60
|
-
from aws_cdk.aws_apigatewayv2_authorizers import WebSocketLambdaAuthorizer
|
61
|
-
from aws_cdk import Stack
|
62
|
-
from constructs import Construct
|
63
|
-
|
64
|
-
authorizer = WebSocketLambdaAuthorizer("Authorizer", auth_handler)
|
65
|
-
|
66
|
-
ApiGatewayV2WebSocketToSqs(self, 'ApiGatewayV2WebSocketToSqsPattern',
|
67
|
-
connect_route_options=apigwv2.WebSocketRouteOptions(
|
68
|
-
integration=WebSocketLambdaIntegration("ConnectIntegration", connect_lambda),
|
69
|
-
authorizer=authorizer
|
70
|
-
),
|
71
|
-
disconnect_route_options=apigwv2.WebSocketRouteOptions(
|
72
|
-
integration=WebSocketLambdaIntegration("DisConnectIntegration", disconnect_lambda),
|
73
|
-
),
|
74
|
-
create_default_route=True
|
75
|
-
)
|
76
|
-
```
|
77
|
-
|
78
|
-
Java
|
79
|
-
|
80
|
-
```java
|
81
|
-
import software.constructs.Construct;
|
82
|
-
|
83
|
-
import software.amazon.awscdk.Stack;
|
84
|
-
import software.amazon.awscdk.StackProps;
|
85
|
-
import software.amazon.awscdk.aws_apigatewayv2_authorizers.*;
|
86
|
-
import software.amazon.awscdk.aws_apigatewayv2_integrations.*;
|
87
|
-
import software.amazon.awsconstructs.services.apigatewaysqs.*;
|
88
|
-
|
89
|
-
new ApiGatewayV2WebSocketToSqs(this, "ApiGatewayV2WebSocketToSqsPattern", new ApiGatewayV2WebSocketToSqsProps.Builder()
|
90
|
-
.webSocketApiProps(new WebSocketApiProps.Builder()
|
91
|
-
.connectRouteOptions(new WebSocketRouteOptions.builder()
|
92
|
-
.integration(new WebSocketLambdaIntegration("ConnectIntegration", connect_lambda)))
|
93
|
-
.disconnectRouteOptions(new WebSocketRouteOptions.builder()
|
94
|
-
.integration(new WebSocketLambdaIntegration("DisConnectIntegration", disconnect_lambda)))
|
95
|
-
.createDefaultRoute(true)
|
96
|
-
.build());
|
97
|
-
```
|
98
|
-
|
99
|
-
## Pattern Construct Props
|
100
|
-
|
101
|
-
| **Name** | **Type** | **Description** |
|
102
|
-
|:-------------|:----------------|-----------------|
|
103
|
-
|existingWebSocketApi?|[`apigwv2.WebSocketApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketApi.html)|Optional API Gateway WebSocket instance. Providing both existingWebSocketApi and webSocketApiProps will cause an error.|
|
104
|
-
|webSocketApiProps?|[`apigwv2.WebSocketApiProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketApiProps.html)|Optional user-provided props to override the default props for the API Gateway. Providing both existingWebSocketApi and webSocketApiProps will cause an error.|
|
105
|
-
|queueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional user-provided props to override the default props for the queue. Providing both existingQueueObj and queueProps will cause an error.|
|
106
|
-
|existingQueueObj?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Optional existing instance of SQS Queue. Providing both existingQueueObj and queueProps will cause an error.|
|
107
|
-
|deployDeadLetterQueue?|`boolean`|Whether to deploy a secondary queue to be used as a dead letter queue. Defaults to `true`.|
|
108
|
-
|deadLetterQueueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional properties to use for creating dead letter queue. Note that if you are creating a FIFO Queue, the dead letter queue should also be FIFO.|
|
109
|
-
|maxReceiveCount|`number`|The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.|
|
110
|
-
|createDefaultRoute?|`boolean`|Whether to create a default route. At least one of createDefaultRoute or customRouteName must be provided. If set to true, then it will use the value supplied with `defaultRouteRequestTemplate`.|
|
111
|
-
|defaultRouteRequestTemplate?|`{ [contentType: string]: string }`|Optional user provided API Gateway Request Template for the default route and/ or customRoute (if customRouteName is provided). This property will only be used if createDefaultRoute is `true`. If createDefaultRoute is `true` and this property is not provided, the construct will create the default route with the following VTL mapping `"Action=SendMessage&MessageGroupId=$input.path('$.MessageGroupId')&MessageDeduplicationId=$context.requestId&MessageAttribute.1.Name=connectionId&MessageAttribute.1.Value.StringValue=$context.connectionId&MessageAttribute.1.Value.DataType=String&MessageAttribute.2.Name=requestId&MessageAttribute.2.Value.StringValue=$context.requestId&MessageAttribute.2.Value.DataType=String&MessageBody=$util.urlEncode($input.json($util.escapeJavaScript('$').replaceAll(\"\\\\'\",\"'\")))"`.|
|
112
|
-
|defaultIamAuthorization?|`boolean`|Add IAM authorization to the $connect path by default. Only set this to false if: 1) If plan to provide an authorizer with the `$connect` route; or 2) The API should be open (no authorization) (AWS recommends against deploying unprotected APIs). If an authorizer is specified in connectRouteOptions, this parameter is ignored and no default IAM authorizer will be created. |
|
113
|
-
|customRouteName?|`string`|The name of the route that will be sent through WebSocketApiProps.routeSelectionExpression when invoking the WebSocket endpoint. At least one of createDefaultRoute or customRouteName must be provided. |
|
114
|
-
|
115
|
-
## Pattern Properties
|
116
|
-
|
117
|
-
| **Name** | **Type** | **Description** |
|
118
|
-
|:-------------|:----------------|-----------------|
|
119
|
-
|webSocketApi|[`apigwv2.WebSocketApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketApi.html)|Returns an instance of the API Gateway WebSocket API created by the pattern.|
|
120
|
-
|apiGatewayRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for API Gateway.|
|
121
|
-
|webSocketStage|[`apigwv2.WebSocketStage`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketStage.html)|Returns an instance of the WebSocketStage created by the construct.|
|
122
|
-
|apiGatewayLogGroup|[`logs.LogGroup`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroup.html)|Returns an instance of the LogGroup created by the construct for API Gateway access logging to CloudWatch.|
|
123
|
-
|sqsQueue|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of the SQS queue created by the pattern.|
|
124
|
-
|deadLetterQueue?|[`sqs.DeadLetterQueue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.DeadLetterQueue.html)|Returns an instance of the DeadLetterQueue created by the pattern.|
|
125
|
-
|
126
|
-
## Default settings
|
127
|
-
|
128
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
129
|
-
|
130
|
-
### Amazon API Gateway
|
131
|
-
|
132
|
-
* Deploy a WebSocket endpoint
|
133
|
-
* Enable CloudWatch logging for API Gateway
|
134
|
-
* Configure least privilege access IAM role for API Gateway
|
135
|
-
* Enable X-Ray Tracing
|
136
|
-
|
137
|
-
### Amazon SQS Queue
|
138
|
-
|
139
|
-
* Deploy SQS dead-letter queue for the source SQS Queue
|
140
|
-
* Enable server-side encryption for source SQS Queue using AWS Managed KMS Key
|
141
|
-
* Enforce encryption of data in transit
|
142
|
-
|
143
|
-
## Architecture
|
144
|
-
|
145
|
-

|
146
|
-
|
147
|
-
---
|
148
|
-
|
149
|
-
|
150
|
-
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2
|
+
Documentation for this pattern can be found [here](https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-apigatewayv2websocket-sqs/README.adoc)
|
151
3
|
'''
|
152
4
|
from pkgutil import extend_path
|
153
5
|
__path__ = extend_path(__path__, __name__)
|
@@ -34,9 +34,9 @@ import constructs._jsii
|
|
34
34
|
|
35
35
|
__jsii_assembly__ = jsii.JSIIAssembly.load(
|
36
36
|
"@aws-solutions-constructs/aws-apigatewayv2websocket-sqs",
|
37
|
-
"2.85.
|
37
|
+
"2.85.3",
|
38
38
|
__name__[0:-6],
|
39
|
-
"aws-apigatewayv2websocket-sqs@2.85.
|
39
|
+
"aws-apigatewayv2websocket-sqs@2.85.3.jsii.tgz",
|
40
40
|
)
|
41
41
|
|
42
42
|
__all__ = [
|
Binary file
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: aws-solutions-constructs.aws-apigatewayv2websocket-sqs
|
3
|
+
Version: 2.85.3
|
4
|
+
Summary: CDK constructs for defining an interaction between an AWS Lambda function and an Amazon S3 bucket.
|
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.193.0
|
22
|
+
Requires-Dist: aws-solutions-constructs.core==2.85.3
|
23
|
+
Requires-Dist: constructs<11.0.0,>=10.0.0
|
24
|
+
Requires-Dist: jsii<2.0.0,>=1.111.0
|
25
|
+
Requires-Dist: publication>=0.0.3
|
26
|
+
Requires-Dist: typeguard<4.3.0,>=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-apigatewayv2websocket-sqs/README.adoc)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
aws_solutions_constructs/aws_apigatewayv2websocket_sqs/__init__.py,sha256=yPzEv1LmFkIaXu-c2K1vvksWwztBUHvdndNwR0sdR8g,31287
|
2
|
+
aws_solutions_constructs/aws_apigatewayv2websocket_sqs/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
3
|
+
aws_solutions_constructs/aws_apigatewayv2websocket_sqs/_jsii/__init__.py,sha256=wfjYW_6glEOZSv14lqM6APMVXCEsYjjg9sF1YNnCMVk,1553
|
4
|
+
aws_solutions_constructs/aws_apigatewayv2websocket_sqs/_jsii/aws-apigatewayv2websocket-sqs@2.85.3.jsii.tgz,sha256=xxg7SqJi3wlGWDdbUJKIVK3Ydz5y_Nu4020VSfql6-s,179035
|
5
|
+
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info/LICENSE,sha256=wnT4A3LZDAEpNzcPDh8VCH0i4wjvmLJ86l3A0tCINmw,10279
|
6
|
+
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info/METADATA,sha256=3j72AS5C-XGLxanHhyL5poXariFA3bgy7rdzPyWrXng,1343
|
7
|
+
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
8
|
+
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info/top_level.txt,sha256=hi3us_KW7V1ocfOqVsNq1o3w552jCEgu_KsCckqYWsg,25
|
9
|
+
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.3.dist-info/RECORD,,
|
Binary file
|
@@ -1,176 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: aws-solutions-constructs.aws-apigatewayv2websocket-sqs
|
3
|
-
Version: 2.85.2
|
4
|
-
Summary: CDK constructs for defining an interaction between an AWS Lambda function and an Amazon S3 bucket.
|
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.193.0
|
22
|
-
Requires-Dist: aws-solutions-constructs.core==2.85.2
|
23
|
-
Requires-Dist: constructs<11.0.0,>=10.0.0
|
24
|
-
Requires-Dist: jsii<2.0.0,>=1.111.0
|
25
|
-
Requires-Dist: publication>=0.0.3
|
26
|
-
Requires-Dist: typeguard<4.3.0,>=2.13.3
|
27
|
-
|
28
|
-
# aws-apigatewayv2websocket-sqs module
|
29
|
-
|
30
|
-
<!--BEGIN STABILITY BANNER-->---
|
31
|
-
|
32
|
-
|
33
|
-

|
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|`aws_solutions_constructs.aws_apigatewayv2websocket_sqs`|
|
46
|
-
| Typescript|`@aws-solutions-constructs/aws-apigatewayv2websocket-sqs`|
|
47
|
-
| Java|`software.amazon.awsconstructs.services.apigatewayv2websocketsqs`|
|
48
|
-
|
49
|
-
## Overview
|
50
|
-
|
51
|
-
This AWS Solutions Construct implements an Amazon API Gateway WebSocket connected to an Amazon SQS queue pattern.
|
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 {
|
61
|
-
ApiGatewayV2WebSocketToSqs,
|
62
|
-
ApiGatewayV2WebSocketToSqsProps,
|
63
|
-
} from "@aws-solutions-constructs/aws-apigatewayv2websocket-sqs";
|
64
|
-
import { WebSocketLambdaAuthorizer } from 'aws-cdk-lib/aws-apigatewayv2-authorizers';
|
65
|
-
|
66
|
-
const authorizer = new WebSocketLambdaAuthorizer('Authorizer', authHandler);
|
67
|
-
|
68
|
-
new ApiGateApiGatewayV2WebSocketToSqswayToSqs(this, "ApiGatewayV2WebSocketToSqsPattern", {
|
69
|
-
webSocketApiProps: {
|
70
|
-
connectRouteOptions: {
|
71
|
-
integration: new WebSocketLambdaIntegration("ConnectIntegration", connectLambda),
|
72
|
-
authorizer: authorizer,
|
73
|
-
},
|
74
|
-
disconnectRouteOptions: {
|
75
|
-
integration: new WebSocketLambdaIntegration("DisconnectIntegration", disconnectLambda),
|
76
|
-
},
|
77
|
-
},
|
78
|
-
createDefaultRoute: true
|
79
|
-
});
|
80
|
-
```
|
81
|
-
|
82
|
-
Python
|
83
|
-
|
84
|
-
```python
|
85
|
-
from aws_solutions_constructs.aws_apigateway_sqs import ApiGatewayV2WebSocketToSqs
|
86
|
-
from aws_cdk.aws_apigatewayv2_authorizers import WebSocketLambdaAuthorizer
|
87
|
-
from aws_cdk import Stack
|
88
|
-
from constructs import Construct
|
89
|
-
|
90
|
-
authorizer = WebSocketLambdaAuthorizer("Authorizer", auth_handler)
|
91
|
-
|
92
|
-
ApiGatewayV2WebSocketToSqs(self, 'ApiGatewayV2WebSocketToSqsPattern',
|
93
|
-
connect_route_options=apigwv2.WebSocketRouteOptions(
|
94
|
-
integration=WebSocketLambdaIntegration("ConnectIntegration", connect_lambda),
|
95
|
-
authorizer=authorizer
|
96
|
-
),
|
97
|
-
disconnect_route_options=apigwv2.WebSocketRouteOptions(
|
98
|
-
integration=WebSocketLambdaIntegration("DisConnectIntegration", disconnect_lambda),
|
99
|
-
),
|
100
|
-
create_default_route=True
|
101
|
-
)
|
102
|
-
```
|
103
|
-
|
104
|
-
Java
|
105
|
-
|
106
|
-
```java
|
107
|
-
import software.constructs.Construct;
|
108
|
-
|
109
|
-
import software.amazon.awscdk.Stack;
|
110
|
-
import software.amazon.awscdk.StackProps;
|
111
|
-
import software.amazon.awscdk.aws_apigatewayv2_authorizers.*;
|
112
|
-
import software.amazon.awscdk.aws_apigatewayv2_integrations.*;
|
113
|
-
import software.amazon.awsconstructs.services.apigatewaysqs.*;
|
114
|
-
|
115
|
-
new ApiGatewayV2WebSocketToSqs(this, "ApiGatewayV2WebSocketToSqsPattern", new ApiGatewayV2WebSocketToSqsProps.Builder()
|
116
|
-
.webSocketApiProps(new WebSocketApiProps.Builder()
|
117
|
-
.connectRouteOptions(new WebSocketRouteOptions.builder()
|
118
|
-
.integration(new WebSocketLambdaIntegration("ConnectIntegration", connect_lambda)))
|
119
|
-
.disconnectRouteOptions(new WebSocketRouteOptions.builder()
|
120
|
-
.integration(new WebSocketLambdaIntegration("DisConnectIntegration", disconnect_lambda)))
|
121
|
-
.createDefaultRoute(true)
|
122
|
-
.build());
|
123
|
-
```
|
124
|
-
|
125
|
-
## Pattern Construct Props
|
126
|
-
|
127
|
-
| **Name** | **Type** | **Description** |
|
128
|
-
|:-------------|:----------------|-----------------|
|
129
|
-
|existingWebSocketApi?|[`apigwv2.WebSocketApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketApi.html)|Optional API Gateway WebSocket instance. Providing both existingWebSocketApi and webSocketApiProps will cause an error.|
|
130
|
-
|webSocketApiProps?|[`apigwv2.WebSocketApiProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketApiProps.html)|Optional user-provided props to override the default props for the API Gateway. Providing both existingWebSocketApi and webSocketApiProps will cause an error.|
|
131
|
-
|queueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional user-provided props to override the default props for the queue. Providing both existingQueueObj and queueProps will cause an error.|
|
132
|
-
|existingQueueObj?|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Optional existing instance of SQS Queue. Providing both existingQueueObj and queueProps will cause an error.|
|
133
|
-
|deployDeadLetterQueue?|`boolean`|Whether to deploy a secondary queue to be used as a dead letter queue. Defaults to `true`.|
|
134
|
-
|deadLetterQueueProps?|[`sqs.QueueProps`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.QueueProps.html)|Optional properties to use for creating dead letter queue. Note that if you are creating a FIFO Queue, the dead letter queue should also be FIFO.|
|
135
|
-
|maxReceiveCount|`number`|The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.|
|
136
|
-
|createDefaultRoute?|`boolean`|Whether to create a default route. At least one of createDefaultRoute or customRouteName must be provided. If set to true, then it will use the value supplied with `defaultRouteRequestTemplate`.|
|
137
|
-
|defaultRouteRequestTemplate?|`{ [contentType: string]: string }`|Optional user provided API Gateway Request Template for the default route and/ or customRoute (if customRouteName is provided). This property will only be used if createDefaultRoute is `true`. If createDefaultRoute is `true` and this property is not provided, the construct will create the default route with the following VTL mapping `"Action=SendMessage&MessageGroupId=$input.path('$.MessageGroupId')&MessageDeduplicationId=$context.requestId&MessageAttribute.1.Name=connectionId&MessageAttribute.1.Value.StringValue=$context.connectionId&MessageAttribute.1.Value.DataType=String&MessageAttribute.2.Name=requestId&MessageAttribute.2.Value.StringValue=$context.requestId&MessageAttribute.2.Value.DataType=String&MessageBody=$util.urlEncode($input.json($util.escapeJavaScript('$').replaceAll(\"\\\\'\",\"'\")))"`.|
|
138
|
-
|defaultIamAuthorization?|`boolean`|Add IAM authorization to the $connect path by default. Only set this to false if: 1) If plan to provide an authorizer with the `$connect` route; or 2) The API should be open (no authorization) (AWS recommends against deploying unprotected APIs). If an authorizer is specified in connectRouteOptions, this parameter is ignored and no default IAM authorizer will be created. |
|
139
|
-
|customRouteName?|`string`|The name of the route that will be sent through WebSocketApiProps.routeSelectionExpression when invoking the WebSocket endpoint. At least one of createDefaultRoute or customRouteName must be provided. |
|
140
|
-
|
141
|
-
## Pattern Properties
|
142
|
-
|
143
|
-
| **Name** | **Type** | **Description** |
|
144
|
-
|:-------------|:----------------|-----------------|
|
145
|
-
|webSocketApi|[`apigwv2.WebSocketApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketApi.html)|Returns an instance of the API Gateway WebSocket API created by the pattern.|
|
146
|
-
|apiGatewayRole|[`iam.Role`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_iam.Role.html)|Returns an instance of the iam.Role created by the construct for API Gateway.|
|
147
|
-
|webSocketStage|[`apigwv2.WebSocketStage`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketStage.html)|Returns an instance of the WebSocketStage created by the construct.|
|
148
|
-
|apiGatewayLogGroup|[`logs.LogGroup`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_logs.LogGroup.html)|Returns an instance of the LogGroup created by the construct for API Gateway access logging to CloudWatch.|
|
149
|
-
|sqsQueue|[`sqs.Queue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.Queue.html)|Returns an instance of the SQS queue created by the pattern.|
|
150
|
-
|deadLetterQueue?|[`sqs.DeadLetterQueue`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sqs.DeadLetterQueue.html)|Returns an instance of the DeadLetterQueue created by the pattern.|
|
151
|
-
|
152
|
-
## Default settings
|
153
|
-
|
154
|
-
Out of the box implementation of the Construct without any override will set the following defaults:
|
155
|
-
|
156
|
-
### Amazon API Gateway
|
157
|
-
|
158
|
-
* Deploy a WebSocket endpoint
|
159
|
-
* Enable CloudWatch logging for API Gateway
|
160
|
-
* Configure least privilege access IAM role for API Gateway
|
161
|
-
* Enable X-Ray Tracing
|
162
|
-
|
163
|
-
### Amazon SQS Queue
|
164
|
-
|
165
|
-
* Deploy SQS dead-letter queue for the source SQS Queue
|
166
|
-
* Enable server-side encryption for source SQS Queue using AWS Managed KMS Key
|
167
|
-
* Enforce encryption of data in transit
|
168
|
-
|
169
|
-
## Architecture
|
170
|
-
|
171
|
-

|
172
|
-
|
173
|
-
---
|
174
|
-
|
175
|
-
|
176
|
-
© Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
@@ -1,9 +0,0 @@
|
|
1
|
-
aws_solutions_constructs/aws_apigatewayv2websocket_sqs/__init__.py,sha256=Fg8m00yv30Wr-fJrzRvY4jLlZMbAcrQOqFah03TxgcU,40128
|
2
|
-
aws_solutions_constructs/aws_apigatewayv2websocket_sqs/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
3
|
-
aws_solutions_constructs/aws_apigatewayv2websocket_sqs/_jsii/__init__.py,sha256=S2EF78i_fF-PwbbuPMW5BBPv36jd5Ri2_-bHUpyT0Js,1553
|
4
|
-
aws_solutions_constructs/aws_apigatewayv2websocket_sqs/_jsii/aws-apigatewayv2websocket-sqs@2.85.2.jsii.tgz,sha256=Kl2W-Q8l5FjhVADM38J4SQ4THyKuHl3lPOVWeg_S76k,181261
|
5
|
-
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info/LICENSE,sha256=wnT4A3LZDAEpNzcPDh8VCH0i4wjvmLJ86l3A0tCINmw,10279
|
6
|
-
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info/METADATA,sha256=MGBV3f9nu9iKyLJ-rY5YXZQib0XQ6mEZasGmw1QMeiI,10184
|
7
|
-
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
8
|
-
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info/top_level.txt,sha256=hi3us_KW7V1ocfOqVsNq1o3w552jCEgu_KsCckqYWsg,25
|
9
|
-
aws_solutions_constructs_aws_apigatewayv2websocket_sqs-2.85.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|