Interface RedshiftQueryProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
RedshiftQueryProps.Jsii$Proxy
Example:
import software.amazon.awscdk.services.redshiftserverless.*; CfnWorkgroup workgroup; Rule rule = Rule.Builder.create(this, "Rule") .schedule(Schedule.rate(Duration.hours(1))) .build(); Queue dlq = new Queue(this, "DeadLetterQueue"); rule.addTarget(RedshiftQuery.Builder.create(workgroup.getAttrWorkgroupWorkgroupArn()) .database("dev") .deadLetterQueue(dlq) .sql(List.of("SELECT * FROM foo", "SELECT * FROM baz")) .build());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forRedshiftQueryProps
static final class
An implementation forRedshiftQueryProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic RedshiftQueryProps.Builder
builder()
The Amazon Redshift database to run the query against.default String
The Amazon Redshift database user to run the query as.default IQueue
The queue to be used as dead letter queue.default RuleTargetInput
getInput()
The input to the state machine execution.default IRole
getRole()
The IAM role to be used to execute the SQL statement.default ISecret
The secret containing the password for the database user.default Boolean
Should an event be sent back to Event Bridge when the SQL statement is executed.getSql()
The SQL queries to be executed.default String
The name of the SQL statement.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getDatabase
The Amazon Redshift database to run the query against. -
getSql
The SQL queries to be executed.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
batchExecuteStatement
API. Therefore, if any statement fails, the entire transaction is rolled back. - If a single SQL statement is to be executed, this will use the
executeStatement
API.
Default: - No SQL query is specified
- When multiple sql queries are included, this will use the
-
getDbUser
The Amazon Redshift database user to run the query as.This is required when authenticating via temporary credentials.
Default: - No Database user is specified
-
getDeadLetterQueue
The queue to be used as dead letter queue.Default: - No dead letter queue is specified
-
getInput
The input to the state machine execution.Default: - the entire EventBridge event
-
getRole
The IAM role to be used to execute the SQL statement.Default: - a new role will be created.
-
getSecret
The secret containing the password for the database user.This is required when authenticating via Secrets Manager. If the full secret ARN is not specified, this will instead use the secret name.
Default: - No secret is specified
-
getSendEventBridgeEvent
Should an event be sent back to Event Bridge when the SQL statement is executed.Default: false
-
getStatementName
The name of the SQL statement.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.Default: - No statement name is specified
-
builder
- Returns:
- a
RedshiftQueryProps.Builder
ofRedshiftQueryProps
-