Skip to content

AWS.Pipes reference

Source: src/AWS/Pipes/DescribePipe.ts

Runtime binding for pipes:DescribePipe.

Reads the bound Pipe’s full definition and live state (CurrentState, DesiredState, source/enrichment/target parameters) — e.g. an operational dashboard or a controller that checks whether the pipe settled after a start/stop. The pipe name is injected from the binding. Provide the implementation with Effect.provide(AWS.Pipes.DescribePipeHttp).

// init — bind the operation to the pipe
const describePipe = yield* AWS.Pipes.DescribePipe(pipe);
// runtime
const described = yield* describePipe();
// described.CurrentState === "RUNNING"

Source: src/AWS/Pipes/ListPipes.ts

Runtime binding for pipes:ListPipes.

Lists the account’s pipes, optionally filtered by name prefix, current state, or source/target prefix — e.g. an operational console enumerating the pipes it manages. Account-level: no resource argument. Provide the implementation with Effect.provide(AWS.Pipes.ListPipesHttp).

// init — account-level binding, no resource argument
const listPipes = yield* AWS.Pipes.ListPipes();
// runtime
const { Pipes } = yield* listPipes({ NamePrefix: "orders-" });
// [{ Name: "orders-pipe", CurrentState: "RUNNING", ... }, ...]

Source: src/AWS/Pipes/Pipe.ts

An Amazon EventBridge Pipe — point-to-point source→(filter)→(enrich)→target plumbing between AWS services without glue code.

Pipe owns the lifecycle of an EventBridge Pipe. Reconcile waits (bounded) for the pipe to leave its CREATING/UPDATING transitional states, and a pipe that lands in a *_FAILED state surfaces as a typed PipeFailed error rather than hanging. Prefer the from builder for the common pairs — it synthesizes the pipes.amazonaws.com execution role with source-read and target-invoke policies for you.

SQS to Lambda (builder — role synthesized automatically)

import * as AWS from "alchemy/AWS";
const queue = yield* AWS.SQS.Queue("OrdersQueue");
const pipe = yield* AWS.Pipes.from(queue, { batchSize: 1 }).toLambda(fn);

SQS to SQS (canonical resource with an explicit role)

const pipe = yield* AWS.Pipes.Pipe("OrdersPipe", {
source: source.queueArn,
target: target.queueArn,
roleArn: role.roleArn,
sourceParameters: {
SqsQueueParameters: { BatchSize: 1 },
},
});
const pipe = yield* AWS.Pipes.from(queue)
.filter(JSON.stringify({ body: { type: ["order.created"] } }))
.toLambda(fn);
const pipe = yield* AWS.Pipes.from(queue)
.enrich(enricherFn)
.toQueue(target);

Kinesis stream source

const pipe = yield* AWS.Pipes.from(stream, {
startingPosition: "TRIM_HORIZON",
batchSize: 10,
}).toLambda(fn);

Stop a pipe without deleting it

const pipe = yield* AWS.Pipes.Pipe("OrdersPipe", {
source: source.queueArn,
target: target.queueArn,
roleArn: role.roleArn,
desiredState: "STOPPED",
});

Source: src/AWS/Pipes/StartPipe.ts

Runtime binding for pipes:StartPipe.

Starts the bound Pipe after it was stopped — e.g. resuming source polling on a schedule or in response to an operational signal. The response reports the transitional STARTING/desired RUNNING states; use DescribePipe to observe when the pipe settles. The pipe name is injected from the binding. Provide the implementation with Effect.provide(AWS.Pipes.StartPipeHttp).

// init — bind the operation to the pipe
const startPipe = yield* AWS.Pipes.StartPipe(pipe);
// runtime
const response = yield* startPipe();
// response.DesiredState === "RUNNING"

Source: src/AWS/Pipes/StopPipe.ts

Runtime binding for pipes:StopPipe.

Stops the bound Pipe without deleting it — e.g. pausing source polling during a maintenance window or in response to a poison-pill backlog. The response reports the transitional STOPPING/desired STOPPED states; use DescribePipe to observe when the pipe settles. The pipe name is injected from the binding. Provide the implementation with Effect.provide(AWS.Pipes.StopPipeHttp).

// init — bind the operation to the pipe
const stopPipe = yield* AWS.Pipes.StopPipe(pipe);
// runtime
const response = yield* stopPipe();
// response.DesiredState === "STOPPED"