Class RedshiftQuery.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<RedshiftQuery>
- Enclosing class:
RedshiftQuery
RedshiftQuery
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
static RedshiftQuery.Builder
The Amazon Redshift database to run the query against.The Amazon Redshift database user to run the query as.deadLetterQueue
(IQueue deadLetterQueue) The queue to be used as dead letter queue.input
(RuleTargetInput input) The input to the state machine execution.The IAM role to be used to execute the SQL statement.The secret containing the password for the database user.sendEventBridgeEvent
(Boolean sendEventBridgeEvent) Should an event be sent back to Event Bridge when the SQL statement is executed.The SQL queries to be executed.statementName
(String statementName) The name of the SQL statement.
-
Method Details
-
create
- Parameters:
clusterArn
- The ARN of the Amazon Redshift cluster. This parameter is required.- Returns:
- a new instance of
RedshiftQuery.Builder
.
-
database
The Amazon Redshift database to run the query against.- Parameters:
database
- The Amazon Redshift database to run the query against. This parameter is required.- Returns:
this
-
sql
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
- Parameters:
sql
- The SQL queries to be executed. This parameter is required.- Returns:
this
- When multiple sql queries are included, this will use the
-
dbUser
The Amazon Redshift database user to run the query as.This is required when authenticating via temporary credentials.
Default: - No Database user is specified
- Parameters:
dbUser
- The Amazon Redshift database user to run the query as. This parameter is required.- Returns:
this
-
deadLetterQueue
The queue to be used as dead letter queue.Default: - No dead letter queue is specified
- Parameters:
deadLetterQueue
- The queue to be used as dead letter queue. This parameter is required.- Returns:
this
-
input
The input to the state machine execution.Default: - the entire EventBridge event
- Parameters:
input
- The input to the state machine execution. This parameter is required.- Returns:
this
-
role
The IAM role to be used to execute the SQL statement.Default: - a new role will be created.
- Parameters:
role
- The IAM role to be used to execute the SQL statement. This parameter is required.- Returns:
this
-
secret
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
- Parameters:
secret
- The secret containing the password for the database user. This parameter is required.- Returns:
this
-
sendEventBridgeEvent
Should an event be sent back to Event Bridge when the SQL statement is executed.Default: false
- Parameters:
sendEventBridgeEvent
- Should an event be sent back to Event Bridge when the SQL statement is executed. This parameter is required.- Returns:
this
-
statementName
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
- Parameters:
statementName
- The name of the SQL statement. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<RedshiftQuery>
- Returns:
- a newly built instance of
RedshiftQuery
.
-