Skip to main content

AWS DevOps Webhook Integration

Requesting AWS DevOps Webhook Integration which needs this schema:

{

eventType: 'incident';

incidentId: string;

action: 'created' | 'updated' | 'closed' | 'resolved';

priority: "CRITICAL" | "HIGH" | "MEDIUM" | "LOW" | "MINIMAL";

title: string;

description?: string;

timestamp?: string;

service?: string;

// The original event generated by service is attached here.

data?: object;

}

They have provided the following example:

function sendEventToWebhook(webhookUrl, secret) {

const timestamp = new Date().toISOString();

const payload = {

eventType: 'incident',

incidentId: 'incident-123',

action: 'created',

priority: "HIGH",

title: 'Test Alert',

description: 'Test description',

timestamp: timestamp,

service: 'TestService',

data: {}

};

fetch(webhookUrl, {

method: "POST",

headers: {

"Content-Type": "application/json",

"x-amzn-event-timestamp": timestamp,

"Authorization": Bearer ${secret},

},

body: JSON.stringify(payload),

});

}

Log in to comment and vote

No comments yet

Be the first to share your thoughts.