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

The logging configuration for a Redshift cluster.

Obtainable from: ClusterLogging.cloudWatch, ClusterLogging.s3

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/cluster.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-redshift-alpha/lib/cluster.ts#L179)
- Type last changed: v2.273.0-alpha.0 · 9 Oct 2026

## Example

TypeScript:

```ts
import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as s3 from 'aws-cdk-lib/aws-s3';
import { ClusterLogging } from '@aws-cdk/aws-redshift-alpha';

declare const vpc: ec2.IVpc;
declare const bucket: s3.IBucket;

const cluster = new Cluster(this, 'Redshift', {
  masterUser: {
    masterUsername: 'admin',
  },
  vpc,
  logging: ClusterLogging.s3({
    bucket,
    keyPrefix: 'redshift-logs/',
  }),
});
```

Python:

```python
from aws_cdk.aws_redshift_alpha import Login
import aws_cdk.aws_ec2 as ec2
import aws_cdk.aws_s3 as s3
from aws_cdk.aws_redshift_alpha import ClusterLogging

# vpc: ec2.IVpc
# bucket: s3.IBucket

cluster = Cluster(self, "Redshift",
    master_user=Login(
        master_username="admin"
    ),
    vpc=vpc,
    logging=ClusterLogging.s3(
        bucket=bucket,
        key_prefix="redshift-logs/"
    )
)
```

Java:

```java
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.s3.*;
import software.amazon.awscdk.services.redshift.alpha.ClusterLogging;

IVpc vpc;
IBucket bucket;

Cluster cluster = Cluster.Builder.create(this, "Redshift")
        .masterUser(Login.builder()
                .masterUsername("admin")
                .build())
        .vpc(vpc)
        .logging(ClusterLogging.s3(S3LoggingOptions.builder()
                .bucket(bucket)
                .keyPrefix("redshift-logs/")
                .build()))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Redshift.Alpha
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.S3;
using Amazon.CDK.AWS.Redshift.Alpha;

IVpc vpc;
IBucket bucket;

var cluster = new Cluster(this, "Redshift", new ClusterProps {
    MasterUser = new Login {
        MasterUsername = "admin"
    },
    Vpc = vpc,
    Logging = ClusterLogging.S3(new S3LoggingOptions {
        Bucket = bucket,
        KeyPrefix = "redshift-logs/"
    })
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkredshiftalpha/v2
import ec2 "github.com/aws/aws-cdk-go/awscdk"
import s3 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdkredshiftalpha"

var vpc IVpc
var bucket IBucket

cluster := awscdkredshiftalpha.NewCluster(this, jsii.String("Redshift"), &ClusterProps{
	MasterUser: &Login{
		MasterUsername: jsii.String("admin"),
	},
	Vpc: Vpc,
	Logging: awscdkredshiftalpha.ClusterLogging_S3(&S3LoggingOptions{
		Bucket: *Bucket,
		KeyPrefix: jsii.String("redshift-logs/"),
	}),
})
```

## Initializer

TypeScript:

```ts
new ClusterLogging()
```

Python:

```python
ClusterLogging()
```

Java:

```java
new ClusterLogging()
```

C# / .NET:

```csharp
new ClusterLogging()
```

Golang:

```go
NewClusterLogging()
```

## Methods

- `cloudWatch(options?: CloudWatchLoggingOptions): ClusterLogging // chainable` (static) — Send logs to CloudWatch.

- `s3(options: S3LoggingOptions): ClusterLogging // chainable` (static) — Send logs to S3.
