# S3Destination

Use a S3 bucket as a Lambda destination.

Implements: [IDestination](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.IDestination.html)

- Source: [`aws-lambda-destinations/lib/s3.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-lambda-destinations/lib/s3.ts#L8)
- Type last changed: v2.168.0 · 20 Nov 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda_destinations as lambda_destinations } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';

declare const bucket: s3.Bucket;
const s3Destination = new lambda_destinations.S3Destination(bucket);
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_lambda_destinations as lambda_destinations
from aws_cdk import aws_s3 as s3

# bucket: s3.Bucket

s3_destination = lambda_destinations.S3Destination(bucket)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.lambda.destinations.*;
import software.amazon.awscdk.services.s3.*;

Bucket bucket;

S3Destination s3Destination = new S3Destination(bucket);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Lambda.Destinations;
using Amazon.CDK.AWS.S3;

Bucket bucket;

var s3Destination = new S3Destination(bucket);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var bucket Bucket

s3Destination := awscdk.Aws_lambda_destinations.NewS3Destination(bucket)
```

## Initializer

TypeScript:

```ts
new S3Destination(bucket: IBucket)
```

Python:

```python
S3Destination(bucket: IBucket)
```

Java:

```java
new S3Destination(IBucket bucket)
```

C# / .NET:

```csharp
new S3Destination(IBucket bucket)
```

Golang:

```go
NewS3Destination(Bucket IBucket)
```

## Methods

- `bind(_scope: Construct, fn: IFunction, _options?: DestinationOptions): DestinationConfig` — Returns a destination configuration.
