Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return loaded config instead of null #4

Merged
merged 2 commits into from
Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ public function getEventBridgeSource()
}
}

return null;
return $source;
}
}
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Magento 2 Eventbridge Notifier
This repository adds an [aligent/magento2-webhooks](https://bitbucket.org/aligent/magento2-webhooks) compatible notifier for submitting events to [AWS EventBridge](https://aws.amazon.com/eventbridge/).
This repository adds an [aligent/magento2-webhooks](https://bitbucket.org/aligent/magento2-webhooks) compatible notifier for submitting events to [Amazon EventBridge](https://aws.amazon.com/eventbridge/).

## How to use
This module only provides an implementation of the `EventBridgeNotifier`. The `NotifierFactoryInterface` does not know anything about it yet. Therefore, it must be hooked up to the factory depending on the implementation of the `NotifierFactory`.
Expand Down Expand Up @@ -34,4 +34,12 @@ curl --location --request POST 'https://m2.dev.aligent.consulting:44356/rest/V1/
"metadata": "event_bridge"
}
}'
```
```

### Configuring AWS Credentials
An IAM role with the `events:PutEvents` action is required so that the notifier can relay events into Amazon EventBridge.

Under `Stores -> Services -> Amazon EventBridge` set the `Access Key ID` and the `Secret Access Key` and the `Region`. You
can configure the source of the event and the event bus if necessary.

![AWS Config](./docs/config.png)
2 changes: 1 addition & 1 deletion Service/EventBridgeNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Class EventBridgeNotifier
*
* A notifier for relaying events into AWS EventBridge.
* A notifier for relaying events into Amazon EventBridge.
*
*/
class EventBridgeNotifier implements NotifierInterface
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aligent/magento2-eventbridge-notifier",
"description": "An AWS EventBridge notifier backed by the aligent/magento2-webhooks module.",
"description": "An Amazon EventBridge notifier backed by the aligent/magento2-webhooks module.",
"type": "magento2-module",
"require": {
"php": ">=7.0",
Expand Down
Binary file added docs/config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="aligent_eventbridge" showInDefault="1" showInWebsite="1" showInStore="1">
<label>AWS EventBridge</label>
<label>Amazon EventBridge</label>
<tab>service</tab>
<resource>Magento_Webapi::config_webapi</resource>

Expand Down