Skip to content

Commit 1950a6e

Browse files
committed
Updates Readme.md with Serverless Pattern reference and requestflow diagram along with repo url update in the pattern.json files
1 parent 79fc569 commit 1950a6e

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

waf-cloudfront-websocket-apigw-cdk-python/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ The WebSocket API provides real-time communication capabilities, while CloudFron
66

77
![Alt text](images/architecturediagram.png?raw=true "Architecture Diagram for WebSocket API with CloudFront and WAF Integration")
88

9+
10+
Learn more about this pattern at [Serverless Land Patterns](https://serverlessland.com/patterns/waf-cloudfront-websocket-apigw-cdk-python).
11+
12+
Important: this application uses various AWS services and there are costs associated with these services after the Free Tier usage - please see the [AWS Pricing page](https://aws.amazon.com/pricing/) for details. You are responsible for any AWS costs incurred. No warranty is implied in this example.
13+
914
### Prerequisites
1015

1116
- Python 3.9 or later
@@ -73,18 +78,13 @@ The main configuration for the WebSocket API and related services is defined in
7378
The WebSocket API handles data flow as follows:
7479

7580
1. Client initiates a WebSocket connection to the CloudFront distribution URL.
76-
2. CloudFront forwards the request to the API Gateway WebSocket API with the "x-api-key" as custom header.
77-
3. Websocket API validates the API key and routes the request based on the route selection expression.
78-
4. The Lambda function is invoked to handle the WebSocket event.
81+
2. WAF validates the request against the configured rules
82+
3. CloudFront forwards the request to the API Gateway WebSocket API with the "x-api-key" as custom header.
83+
4. Websocket API validates the API key and routes the request based on the route selection expression.
7984

80-
```
81-
[Client] <-> [CloudFront] <-> [API Gateway WebSocket API] <-> [Lambda Function]
82-
^ |
83-
| |
84-
+---------------------------------------------------------------+
85-
```
85+
![Alt text](images/RequestFlow.png?raw=true "Request Flow for WebSocket API with CloudFront and WAF Integration")
8686

87-
##Testing
87+
## Testing
8888

8989
Copy the "DistributionURL" value from the Cloudformation Stack's output section. Use it to connect to your Webosocket API. When you connect to your API, API Gateway invokes the $connect route.
9090
```

waf-cloudfront-websocket-apigw-cdk-python/example-pattern.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
},
1313
"gitHub": {
1414
"template": {
15-
"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/<>",
16-
"templateURL": "serverless-patterns/<>",
17-
"projectFolder": "<>",
18-
"templateFile": "my_websocket_api_stack.py"
15+
"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/waf-cloudfront-websocket-apigw-cdk-python",
16+
"templateURL": "serverless-patterns/waf-cloudfront-websocket-apigw-cdk-python",
17+
"projectFolder": "waf-cloudfront-websocket-apigw-cdk-python",
18+
"templateFile": "my_websocket_api/my_websocket_api_stack.py"
1919
}
2020
},
2121
"resources": {
94.2 KB
Loading

waf-cloudfront-websocket-apigw-cdk-python/waf-cloudfront-websocket-apigw-cdk-python.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
},
1313
"gitHub": {
1414
"template": {
15-
"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/<>",
16-
"templateURL": "serverless-patterns/<>",
17-
"projectFolder": "<>",
18-
"templateFile": "my_websocket_api_stack.py"
15+
"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/waf-cloudfront-websocket-apigw-cdk-python",
16+
"templateURL": "serverless-patterns/waf-cloudfront-websocket-apigw-cdk-python",
17+
"projectFolder": "waf-cloudfront-websocket-apigw-cdk-python",
18+
"templateFile": "my_websocket_api/my_websocket_api_stack.py"
1919
}
2020
},
2121
"resources": {

0 commit comments

Comments
 (0)