GetConnection
Source:
src/AWS/CodeConnections/GetConnection.ts
Runtime binding for codeconnections:GetConnection.
Bind this operation to a Connection to read the connection’s live
state — status (PENDING/AVAILABLE/ERROR), provider type, and owner —
from inside a function runtime. Useful for workloads that gate work on the
connection’s OAuth handshake having been completed. Provide the
implementation with Effect.provide(AWS.CodeConnections.GetConnectionHttp).
Inspecting a Connection
Section titled “Inspecting a Connection”// init — bind the operation to the connectionconst getConnection = yield* AWS.CodeConnections.GetConnection(connection);
// runtimeconst { Connection: live } = yield* getConnection();if (live?.ConnectionStatus !== "AVAILABLE") { return yield* HttpServerResponse.text("handshake pending", { status: 409 });}