Class RedshiftQueryProps.Builder
java.lang.Object
software.amazon.awscdk.services.events.targets.RedshiftQueryProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<RedshiftQueryProps>
- Enclosing interface:
RedshiftQueryProps
@Stability(Stable)
public static final class RedshiftQueryProps.Builder
extends Object
implements software.amazon.jsii.Builder<RedshiftQueryProps>
A builder for
RedshiftQueryProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofRedshiftQueryProps.getDatabase()
Sets the value ofRedshiftQueryProps.getDbUser()
deadLetterQueue
(IQueue deadLetterQueue) Sets the value ofRedshiftQueryProps.getDeadLetterQueue()
input
(RuleTargetInput input) Sets the value ofRedshiftQueryProps.getInput()
Sets the value ofRedshiftQueryProps.getRole()
Sets the value ofRedshiftQueryProps.getSecret()
sendEventBridgeEvent
(Boolean sendEventBridgeEvent) Sets the value ofRedshiftQueryProps.getSendEventBridgeEvent()
Sets the value ofRedshiftQueryProps.getSql()
statementName
(String statementName) Sets the value ofRedshiftQueryProps.getStatementName()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
database
Sets the value ofRedshiftQueryProps.getDatabase()
- Parameters:
database
- The Amazon Redshift database to run the query against. This parameter is required.- Returns:
this
-
sql
Sets the value ofRedshiftQueryProps.getSql()
- Parameters:
sql
- The SQL queries to be executed. This parameter is required. 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.
- When multiple sql queries are included, this will use the
- Returns:
this
-
dbUser
Sets the value ofRedshiftQueryProps.getDbUser()
- Parameters:
dbUser
- The Amazon Redshift database user to run the query as. This is required when authenticating via temporary credentials.- Returns:
this
-
deadLetterQueue
Sets the value ofRedshiftQueryProps.getDeadLetterQueue()
- Parameters:
deadLetterQueue
- The queue to be used as dead letter queue.- Returns:
this
-
input
Sets the value ofRedshiftQueryProps.getInput()
- Parameters:
input
- The input to the state machine execution.- Returns:
this
-
role
Sets the value ofRedshiftQueryProps.getRole()
- Parameters:
role
- The IAM role to be used to execute the SQL statement.- Returns:
this
-
secret
Sets the value ofRedshiftQueryProps.getSecret()
- Parameters:
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.- Returns:
this
-
sendEventBridgeEvent
@Stability(Stable) public RedshiftQueryProps.Builder sendEventBridgeEvent(Boolean sendEventBridgeEvent) Sets the value ofRedshiftQueryProps.getSendEventBridgeEvent()
- Parameters:
sendEventBridgeEvent
- Should an event be sent back to Event Bridge when the SQL statement is executed.- Returns:
this
-
statementName
Sets the value ofRedshiftQueryProps.getStatementName()
- Parameters:
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 aQS2-
prefix to the statement name.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<RedshiftQueryProps>
- Returns:
- a new instance of
RedshiftQueryProps
- Throws:
NullPointerException
- if any required attribute was not provided
-