Skip to content

Commit

Permalink
Merge pull request #4 from aligent/fix/config_returns_null
Browse files Browse the repository at this point in the history
Return loaded config instead of null
  • Loading branch information
John Smith authored Nov 22, 2021
2 parents d3b6423 + 665603c commit d86b769
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
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

0 comments on commit d86b769

Please sign in to comment.