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

A source that reads from an SQS queue.

Implements: [ISource](/cdk/api/v2/docs/@aws-cdk_aws-pipes-alpha.ISource.html)

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/sqs.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-pipes-sources-alpha/lib/sqs.ts#L30)

## Example

TypeScript:

```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,
});
```

Python:

```python
# source_queue: sqs.Queue
# dest: events.ApiDestination

api_target = targets.ApiDestinationTarget(dest,
    input_transformation=pipes.InputTransformation.from_object({"body": "👀"})
)

pipe = pipes.Pipe(self, "Pipe",
    source=SqsSource(source_queue),
    target=api_target
)
```

Java:

```java
Queue sourceQueue;
ApiDestination dest;

ApiDestinationTarget apiTarget = ApiDestinationTarget.Builder.create(dest)
        .inputTransformation(InputTransformation.fromObject(Map.of("body", "👀")))
        .build();

Pipe pipe = Pipe.Builder.create(this, "Pipe")
        .source(new SqsSource(sourceQueue))
        .target(apiTarget)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Pipes.Sources.Alpha
Queue sourceQueue;
ApiDestination dest;

var apiTarget = new ApiDestinationTarget(dest, new ApiDestinationTargetParameters {
    InputTransformation = InputTransformation.FromObject(new Dictionary<string, object> { { "body", "👀" } })
});

var pipe = new Pipe(this, "Pipe", new PipeProps {
    Source = new SqsSource(sourceQueue),
    Target = apiTarget
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkpipessourcesalpha/v2
var sourceQueue Queue
var dest ApiDestination

apiTarget := targets.NewApiDestinationTarget(dest, &ApiDestinationTargetParameters{
	InputTransformation: pipes.InputTransformation_FromObject(map[string]interface{}{
		"body": jsii.String("👀"),
	}),
})

pipe := pipes.NewPipe(this, jsii.String("Pipe"), &PipeProps{
	Source: awscdkpipessourcesalpha.NewSqsSource(sourceQueue),
	Target: apiTarget,
})
```

## Initializer

TypeScript:

```ts
new SqsSource(queue: IQueue, parameters?: SqsSourceParameters)
```

Python:

```python
SqsSource(queue: IQueue, parameters: typing.Optional[SqsSourceParameters] = None)
```

Java:

```java
new SqsSource(IQueue queue, SqsSourceParameters parameters)
```

C# / .NET:

```csharp
new SqsSource(IQueue queue, SqsSourceParameters? parameters = null)
```

Golang:

```go
NewSqsSource(Queue IQueue, Parameters SqsSourceParameters)
```

## Properties

- `sourceArn`: string — The ARN of the source resource.

## Methods

- `bind(_pipe: IPipe): SourceConfig` — Bind the source to a pipe.

- `grantRead(grantee: IRole): void` — Grant the pipe role read access to the source.
