Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/k6/next/javascript-api/jslib/aws/eventbridgeclient.md, or by sending Accept: text/markdown to https://grafana.com/docs/k6/next/javascript-api/jslib/aws/eventbridgeclient/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
EventBridgeClient
EventBridgeClient interacts with the AWS EventBridge service.
With it, you can send custom events to Amazon EventBridge. These events can then be matched to rules defined in EventBridge. For a full list of supported operations, see Methods.
Both the dedicated event-bridge.js jslib bundle and the all-encompassing aws.js bundle include the EventBridgeClient.
Methods
| Function | Description |
|---|---|
| putEvents(input) | Send custom events to Amazon EventBridge. |
Throws
EventBridgeClient methods will throw errors in case of failure.
| Error | Condition |
|---|---|
| InvalidSignatureError | when invalid credentials were provided or the request signature is invalid. |
| EventBridgeServiceError | when AWS replied to the requested operation with an error. |
Examples
import {
AWSConfig,
EventBridgeClient,
} from 'https://jslib.k6.io/aws/0.14.0/event-bridge.js';
const awsConfig = new AWSConfig({
region: __ENV.AWS_REGION,
accessKeyId: __ENV.AWS_ACCESS_KEY_ID,
secretAccessKey: __ENV.AWS_SECRET_ACCESS_KEY,
sessionToken: __ENV.AWS_SESSION_TOKEN,
});
const eventBridge = new EventBridgeClient(awsConfig);
export default async function () {
const eventDetails = {
Source: 'my.custom.source',
Detail: { key1: 'value1', key2: 'value2' },
DetailType: 'MyDetailType',
Resources: ['arn:aws:resource1'],
};
const input = {
Entries: [eventDetails],
};
try {
await eventBridge.putEvents(input);
} catch (error) {
console.error(`Failed to put events: ${error.message}`);
}
}Was this page helpful?
Related resources from Grafana Labs

