Skip to content

Commit cd8455d

Browse files
committed
Improve doc
1 parent e2c13f3 commit cd8455d

File tree

1 file changed

+57
-7
lines changed

1 file changed

+57
-7
lines changed

README.md

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1-
## Magento 2 module AWS EventBridge integration
1+
# Amazon EventBridge integration module for Magento 2
22

33
Send Magento events to [Amazon EventBridge](https://aws.amazon.com/eventbridge/) service to be able to integrate Magento with many different AWS serverless services.
44

55
![Packagist](https://img.shields.io/packagist/v/bitbull/magento2-module-awseventbridge)
66

7-
![Magento](https://img.shields.io/badge/magento-~2.3.4-orange)
7+
![Magento](https://img.shields.io/badge/magento-~2.3.4-red)
88

99
![PHP](https://img.shields.io/packagist/php-v/bitbull/magento2-module-awseventbridge)
1010

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
1227

1328
Install this module using composer:
1429

@@ -111,14 +126,17 @@ If you enable the "Queue mode" you also need to enable cron consumer runner into
111126
```
112127
N.B. cron events are always executed synchronously without using queue.
113128

114-
![Events](./doc/imgs/config-cart-events.png?raw=true)
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-
118129
## Events
119130

120131
This module inject observers to listen to Magento 2 events, elaborate the payload and then send the event to AWS services.
121132

133+
### Enable events
134+
135+
![Events](./doc/imgs/config-cart-events.png?raw=true)
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+
122140
### Create an AWS EventBridge Rule
123141

124142
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.
776794
}
777795
```
778796

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+
[username] => [email protected]
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

Comments
 (0)