> **Experimental**
>
> `@aws-cdk/aws-pipes-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# Pipe

Amazon EventBridge Pipes connects sources to targets.

Pipes are intended for point-to-point integrations between supported sources and targets,
with support for advanced transformations and enrichment.

Extends: Construct › Resource › Pipe
Implements: IPipe, IResource, IEnvironmentAware, IConstruct, IDependable

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/pipe.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-pipes-alpha/lib/pipe.ts#L224)

## Example

```ts
declare const sourceQueue: sqs.Queue;
declare const dest: events.ApiDestination;

const apiTarget = new targets.ApiDestinationTarget(dest, {
  inputTransformation: pipes.InputTransformation.fromObject({ body: "👀" }),
});

const pipe = new pipes.Pipe(this, 'Pipe', {
    source: new SqsSource(sourceQueue),
    target: apiTarget,
});
```

## Initializer

```ts
new Pipe(scope: Construct, id: string, props: PipeProps)
```

## Construct Props

- `description`: string — A description of the pipe displayed in the AWS console.

  **Default:** no description

- `desiredState`: [DesiredState](/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.DesiredState.html) = DesiredState.RUNNING — The desired state of the pipe.

  If the state is set to STOPPED, the pipe will not process events.

- `enrichment`: [IEnrichment](/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.IEnrichment.html) — Enrichment step to enhance the data from the source before sending it to the target.

  **Default:** no enrichment

- `filter`: [IFilter](/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.IFilter.html) — The filter pattern for the pipe source.

  **Default:** no filter

- `kmsKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — The AWS KMS customer managed key to encrypt pipe data.

  **Default:** undefined - AWS managed key is used

- `logDestinations`: [ILogDestination](/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.ILogDestination.html)[] — Destinations for the logs.

  **Default:** no logs

- `logIncludeExecutionData`: [IncludeExecutionData](/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.IncludeExecutionData.html)[] = none — Whether the execution data (specifically, the `payload` , `awsRequest` , and `awsResponse` fields) is included in the log messages for this pipe.

  This applies to all log destinations for the pipe.

  For more information, see [Including execution data in logs](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs.html#eb-pipes-logs-execution-data) and the [message schema](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs-schema.html) in the *Amazon EventBridge User Guide* .

- `logLevel`: [LogLevel](/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.LogLevel.html) = LogLevel.ERROR — The level of logging detail to include.

  This applies to all log destinations for the pipe.

- `pipeName`: string — Name of the pipe in the AWS console.

  **Default:** automatically generated name

- `role`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The role used by the pipe which has permissions to read from the source and write to the target.

  **Default:** a new role will be created.

  If an enriched target is used, the role also have permissions to call the enriched target.
  If no role is provided, a role will be created.

- `source`: [ISource](/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.ISource.html) (required) — The source of the pipe.

- `tags`: { [key: string]: string } — The list of key-value pairs to associate with the pipe.

  **Default:** no tags

- `target`: [ITarget](/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.ITarget.html) (required) — The target of the pipe.

## Properties

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `pipeArn`: string — The ARN of the pipe.

- `pipeName`: string — The name of the pipe.

- `pipeRole`: [IRole](/cdk/api/v2/docs/aws-cdk-lib.aws_iam.IRole.html) — The role used by the pipe.

  For imported pipes it assumes that the default role is used.

- `PROPERTY_INJECTION_ID`: string (static) — Uniquely identifies this class.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — The stack in which this resource is defined.

## Methods

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Override the cross-stack reference strength for this resource.

  When set, any cross-stack reference to this resource will use the specified
  mechanism instead of the global default determined by the
  `@aws-cdk/core:defaultCrossStackReferences` context key. This is useful for
  selectively weakening specific references to avoid the "deadly embrace" problem
  without changing the app-wide default.

  **Parameters**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).

- `fromPipeName(scope: Construct, id: string, pipeName: string): IPipe` (static) — Creates a pipe from the name of a pipe.

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `isOwnedResource(construct: IConstruct): boolean` (static) — Returns true if the construct was created by CDK, and false otherwise.

- `isResource(construct: IConstruct): boolean` (static) — Check whether the given construct is a Resource.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
