๐ŸŒ‰EventBridge Events

EventBridge is supported for all aws.* sources coming within the message payload. You can implement your own methods just by creating a method similar to on[source_name]Event.

For example, you might have this EC2 Spot Termination notice:

   "detail-type":"EC2 Instance State-change Notification",

Because the source is called aws.ec2, you should create an onEc2Event method within your extended class:

use RenokiCo\AwsWebhooks\Http\Controllers\EventbridgeWebhook;

class MyEventbridgeController extends EventbridgeWebhook
     * Handle the EC2 events.
     * @param  array  $message
     * @param  array  $originalMessage
     * @param  \Illuminate\Http\Request  $request
     * @return void
    protected function onEc2Event(array $message, array $originalMessage, Request $request)
        foreach ($message['resources'] as $instanceArn) {

Last updated