Skip to content
v2.277.0

Experimental

@aws-cdk/aws-redshift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

CloudWatchLoggingOptions Struct ​

Options for CloudWatch logging.

Example ​

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

declare const vpc: ec2.IVpc;

const cluster = new Cluster(this, 'Redshift', {
  masterUser: {
    masterUsername: 'admin',
  },
  vpc,
  logging: ClusterLogging.cloudWatch({
    logExports: [LogExport.CONNECTION_LOG, LogExport.USER_LOG],
  }),
});
python
from aws_cdk.aws_redshift_alpha import Login
import aws_cdk.aws_ec2 as ec2
from aws_cdk.aws_redshift_alpha import ClusterLogging, LogExport

# vpc: ec2.IVpc


cluster = Cluster(self, "Redshift",
    master_user=Login(
        master_username="admin"
    ),
    vpc=vpc,
    logging=ClusterLogging.cloud_watch(
        log_exports=[LogExport.CONNECTION_LOG, LogExport.USER_LOG]
    )
)
java
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.redshift.alpha.ClusterLogging;
import software.amazon.awscdk.services.redshift.alpha.LogExport;

IVpc vpc;


Cluster cluster = Cluster.Builder.create(this, "Redshift")
        .masterUser(Login.builder()
                .masterUsername("admin")
                .build())
        .vpc(vpc)
        .logging(ClusterLogging.cloudWatch(CloudWatchLoggingOptions.builder()
                .logExports(List.of(LogExport.CONNECTION_LOG, LogExport.USER_LOG))
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Redshift.Alpha
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.Redshift.Alpha;

IVpc vpc;


var cluster = new Cluster(this, "Redshift", new ClusterProps {
    MasterUser = new Login {
        MasterUsername = "admin"
    },
    Vpc = vpc,
    Logging = ClusterLogging.CloudWatch(new CloudWatchLoggingOptions {
        LogExports = new [] { LogExport.CONNECTION_LOG, LogExport.USER_LOG }
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkredshiftalpha/v2
import ec2 "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdkredshiftalpha"

var vpc IVpc


cluster := awscdkredshiftalpha.NewCluster(this, jsii.String("Redshift"), &ClusterProps{
	MasterUser: &Login{
		MasterUsername: jsii.String("admin"),
	},
	Vpc: Vpc,
	Logging: awscdkredshiftalpha.ClusterLogging_CloudWatch(&CloudWatchLoggingOptions{
		LogExports: []LogExport{
			awscdkredshiftalpha.LogExport_CONNECTION_LOG,
			awscdkredshiftalpha.LogExport_USER_LOG,
		},
	}),
})

Properties ​

logExportsoptionalLogExport[]log_exportsoptionaltyping.List[LogExport]logExportsoptionalList<LogExport>LogExportsoptionalLogExport[]LogExportsoptional*[]LogExport #
The types of logs to export.

Default: [LogExport.CONNECTION_LOG, LogExport.USER_LOG, LogExport.USER_ACTIVITY_LOG]