|
1 | | -# SQS to DynamoDB using EventBridge Pipes with API Gateway and CDK/Python |
| 1 | +# Amazon SQS to Amazon DynamoDB using Amazon EventBridge Pipes with Amazon API Gateway and CDK/Python |
2 | 2 |
|
3 | 3 | This pattern will send messages from an SQS queue to a DynamoDB table via API Gateway using EventBridge Pipes. |
4 | 4 |
|
5 | | -Learn more about this pattern at Serverless Land Patterns: https://serverlessland.com/patterns/eventbridge-pipes-sqs-to-dynamodb |
| 5 | + |
| 6 | + |
| 7 | +Learn more about this pattern at Serverless Land Patterns: [https://serverlessland.com/patterns/eventbridge-pipes-sqs-to-dynamodb](https://serverlessland.com/patterns/eventbridge-pipes-sqs-to-dynamodb) |
6 | 8 |
|
7 | 9 | 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. |
8 | 10 |
|
@@ -55,21 +57,32 @@ Messages sent to the SQS queue are polled by EventBridge Pipe. EventBridge Pipe |
55 | 57 |
|
56 | 58 | Once this stack is deployed in your AWS account, copy the SQS queue name value from the output. |
57 | 59 |
|
| 60 | +Alternatively, retrieve the queue URL using AWS CLI: |
| 61 | +```sh |
| 62 | +aws sqs list-queues --query 'QueueUrls[?contains(@, `EntryPointToEventbridgePipe`)]' |
| 63 | +``` |
| 64 | + |
58 | 65 | Then, send a message to the SQS queue as follows: |
59 | 66 | ```sh |
60 | | - aws sqs send-message \ |
61 | | - --queue-url "https://sqs.<region-id>.amazonaws.com/<account-id>/<queue-name>" \ |
62 | | - --message-body '{"Message": "{\"content\":\"Test message\",\"params\":{\"name\":\"Mario\",\"surname\":\"Rossi\"}}"}' |
| 67 | +aws sqs send-message \ |
| 68 | + --queue-url "<REPLACE_WITH_OUTPUT_FROM_PREVIOUS_COMMAND>" \ |
| 69 | + --message-body '{"Message": "{\"content\":\"Test message\",\"params\":{\"name\":\"Mario\",\"surname\":\"Rossi\"}}"}' |
63 | 70 | ``` |
64 | 71 |
|
| 72 | +Navigate to [AWS Console DynamoDB Tables](https://console.aws.amazon.com/dynamodbv2/home#tables) and check for a table with name `Audit-Table`. |
65 | 73 | When you check the DynamoDB table, you can see the entry with all the attributes parsed by API Gateway. |
66 | 74 |
|
| 75 | +Alternatively, you can scan the table using AWS CLI: |
| 76 | +```sh |
| 77 | +aws dynamodb scan --table-name Audit-Table |
| 78 | +``` |
| 79 | + |
67 | 80 | ## Cleanup |
68 | 81 |
|
69 | 82 | 1. Delete the stack |
70 | 83 |
|
71 | 84 | ```bash |
72 | | - cdk destroy |
| 85 | +cdk destroy |
73 | 86 | ``` |
74 | 87 |
|
75 | 88 | --- |
|
0 commit comments