|
1 | | -## Magento 2 module AWS EventBridge integration |
| 1 | +# Amazon EventBridge integration module for Magento 2 |
2 | 2 |
|
3 | 3 | Send Magento events to [Amazon EventBridge](https://aws.amazon.com/eventbridge/) service to be able to integrate Magento with many different AWS serverless services. |
4 | 4 |
|
5 | 5 |  |
6 | 6 |
|
7 | | - |
| 7 | + |
8 | 8 |
|
9 | 9 |  |
10 | 10 |
|
11 | | -## Installation Instructions |
| 11 | +## Contents |
| 12 | + |
| 13 | +- [Installation instructions](#installation-instructions) |
| 14 | +- [IAM permissions required](#iam-permissions-required) |
| 15 | +- [Setup](#setup) |
| 16 | + - [Credentials](#credentials) |
| 17 | + - [Options](#options) |
| 18 | +- [Events](#events) |
| 19 | + - [Enable events](#enable-events) |
| 20 | + - [Create an AWS EventBridge Rule](#create-an-aws-eventbridge-rule) |
| 21 | + - [Data specification](#data-specification) |
| 22 | + - [Supported Events](#supported-events) |
| 23 | +- [Debug and local testing](#debug-and-local-testing) |
| 24 | +- [Contributing](#contributing) |
| 25 | + |
| 26 | +## Installation instructions |
12 | 27 |
|
13 | 28 | Install this module using composer: |
14 | 29 |
|
@@ -111,14 +126,17 @@ If you enable the "Queue mode" you also need to enable cron consumer runner into |
111 | 126 | ``` |
112 | 127 | N.B. cron events are always executed synchronously without using queue. |
113 | 128 |
|
114 | | - |
115 | | - |
116 | | -These sections contain a list of supported events that can be activated and used to trigger Lambda functions, send event to an SNS topic, add message to SQS Queue, execute a StepFunction and so on.. |
117 | | - |
118 | 129 | ## Events |
119 | 130 |
|
120 | 131 | This module inject observers to listen to Magento 2 events, elaborate the payload and then send the event to AWS services. |
121 | 132 |
|
| 133 | +### Enable events |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | +These option sections contain a list of supported events that can be activated and used to trigger Lambda functions, send event to an SNS topic, add message to SQS Queue, execute a StepFunction and so on. |
| 138 | +Enable events you want to receive to be able to trigger your EventBridge Rules. |
| 139 | + |
122 | 140 | ### Create an AWS EventBridge Rule |
123 | 141 |
|
124 | 142 | In order to connect to an EventBridge event and trigger a target you need to create an EventBridge Rule that match one or more events. |
@@ -776,3 +794,35 @@ An index change state. |
776 | 794 | } |
777 | 795 | ``` |
778 | 796 |
|
| 797 | +## Debug and local testing |
| 798 | + |
| 799 | +Module log are written in `var/log/aws-eventbridge.log` log file. |
| 800 | + |
| 801 | +Enable "debug mode" option to increase logging level and retrieve more details about module operations. |
| 802 | + |
| 803 | +``` |
| 804 | +[2020-08-26 10:49:36] report.DEBUG: Event 'User/LoginFailed' captured, executing.. [] [] |
| 805 | +[2020-08-26 10:49:36] report.DEBUG: Event 'User/LoginFailed' executed in 0.002s [] [] |
| 806 | +``` |
| 807 | + |
| 808 | +Enable "dry run mode" to test module without configuring credentials. |
| 809 | +This options skip AWS API call and allow you to test locally without need a AWS Account. |
| 810 | + |
| 811 | +``` |
| 812 | +[2020-08-26 10:49:36] report.DEBUG: [DryRun] Sending event 'UserLoginFailed' with data: Array |
| 813 | +( |
| 814 | + |
| 815 | + [metadata] => Array |
| 816 | + ( |
| 817 | + [date] => 2020-08-26 10:49:36 |
| 818 | + [timestamp] => 1598438976 |
| 819 | + [async] => |
| 820 | + ) |
| 821 | +) |
| 822 | + [] [] |
| 823 | +[2020-08-26 10:49:36] report.DEBUG: [DryRun] Event 'UserLoginFailed' sent with id 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' [] [] |
| 824 | +``` |
| 825 | + |
| 826 | +## Contributing |
| 827 | + |
| 828 | +Any help is appreciated. If you want to contribute first read the [contribution guide](CONTRIBUTING.md). |
0 commit comments