class RedshiftQuery
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Events.Targets.RedshiftQuery |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awseventstargets#RedshiftQuery |
Java | software.amazon.awscdk.services.events.targets.RedshiftQuery |
Python | aws_cdk.aws_events_targets.RedshiftQuery |
TypeScript (source) | aws-cdk-lib » aws_events_targets » RedshiftQuery |
Implements
IRule
Schedule an Amazon Redshift Query to be run, using the Redshift Data API.
If you would like Amazon Redshift to identify the Event Bridge rule, and present it in the Amazon Redshift console, append a QS2-
prefix to both statementName
and ruleName
.
Example
import * as redshiftserverless from 'aws-cdk-lib/aws-redshiftserverless'
declare const workgroup: redshiftserverless.CfnWorkgroup;
const rule = new events.Rule(this, 'Rule', {
schedule: events.Schedule.rate(cdk.Duration.hours(1)),
});
const dlq = new sqs.Queue(this, 'DeadLetterQueue');
rule.addTarget(new targets.RedshiftQuery(workgroup.attrWorkgroupWorkgroupArn, {
database: 'dev',
deadLetterQueue: dlq,
sql: ['SELECT * FROM foo','SELECT * FROM baz'],
}));
Initializer
new RedshiftQuery(clusterArn: string, props: RedshiftQueryProps)
Parameters
- clusterArn
string
— The ARN of the Amazon Redshift cluster. - props
Redshift
— The properties of the Redshift Query event.Query Props
Methods
Name | Description |
---|---|
bind(rule, _id?) | Returns the rule target specification. |
bind(rule, _id?)
public bind(rule: IRule, _id?: string): RuleTargetConfig
Parameters
- rule
IRule
- _id
string
Returns
Returns the rule target specification.
NOTE: Do not use the various inputXxx
options. They can be set in a call to addTarget
.