Skip to content

Connection

Source: src/AWS/EventBridge/Connection.ts

An Amazon EventBridge connection holding the authorization used to invoke an HTTP endpoint through an ApiDestination. EventBridge stores the secret half of the connection in Secrets Manager on your behalf.

Connections do not support tags, so ownership is tracked by the deterministic physical name.

API-Key Connection

import * as Redacted from "effect/Redacted";
const connection = yield* AWS.EventBridge.Connection("PartnerApi", {
authorizationType: "API_KEY",
authParameters: {
apiKeyAuthParameters: {
apiKeyName: "x-api-key",
apiKeyValue: Redacted.make(process.env.PARTNER_API_KEY!),
},
},
});

OAuth Client-Credentials Connection

const connection = yield* AWS.EventBridge.Connection("OAuthApi", {
authorizationType: "OAUTH_CLIENT_CREDENTIALS",
authParameters: {
oauthParameters: {
clientParameters: {
clientId: "my-client",
clientSecret: Redacted.make(process.env.OAUTH_SECRET!),
},
authorizationEndpoint: "https://auth.example.com/oauth/token",
httpMethod: "POST",
},
},
});