RedshiftQueryProps Struct
Configuration properties of an Amazon Redshift Query event.
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'],
}));
Properties
dbUseroptionalstringdb_useroptionalstrdbUseroptionalStringDbUseroptionalstringDbUseroptional*string#Default: No Database user is specified
This is required when authenticating via temporary credentials.
deadLetterQueueoptionalIQueuedead_letter_queueoptionalIQueuedeadLetterQueueoptionalIQueueDeadLetterQueueoptionalIQueueDeadLetterQueueoptionalIQueue#Default: No dead letter queue is specified
inputoptionalRuleTargetInputinputoptionalRuleTargetInputinputoptionalRuleTargetInputInputoptionalRuleTargetInputInputoptionalRuleTargetInput#Default: the entire EventBridge event
Default: a new role will be created.
secretoptionalISecretsecretoptionalISecretsecretoptionalISecretSecretoptionalISecretSecretoptionalISecret#Default: No secret is specified
This is required when authenticating via Secrets Manager. If the full secret ARN is not specified, this will instead use the secret name.
sendEventBridgeEventoptionalbooleansend_event_bridge_eventoptionalboolsendEventBridgeEventoptionalBooleanSendEventBridgeEventoptionalboolSendEventBridgeEventoptional*bool= false#Default: No SQL query is specified
notes
Each query is run sequentially within a single transaction; the next query in the array will only execute after the previous one has successfully completed.
- When multiple sql queries are included, this will use the
batchExecuteStatementAPI. Therefore, if any statement fails, the entire transaction is rolled back. - If a single SQL statement is to be executed, this will use the
executeStatementAPI.
statementNameoptionalstringstatement_nameoptionalstrstatementNameoptionalStringStatementNameoptionalstringStatementNameoptional*string#Default: No statement name is specified
You can name the SQL statement for identitfication purposes. 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 the statement name.