Interface RedshiftQueryProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
RedshiftQueryProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-10-31T19:12:58.552Z") @Stability(Stable) public interface RedshiftQueryProps extends software.amazon.jsii.JsiiSerializable
Configuration properties of an Amazon Redshift Query event.

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());
 
  • Method Details

    • getDatabase

      @Stability(Stable) @NotNull String getDatabase()
      The Amazon Redshift database to run the query against.
    • getSql

      @Stability(Stable) @NotNull List<String> 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

    • getDbUser

      @Stability(Stable) @Nullable default String 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

      @Stability(Stable) @Nullable default IQueue getDeadLetterQueue()
      The queue to be used as dead letter queue.

      Default: - No dead letter queue is specified

    • getInput

      @Stability(Stable) @Nullable default RuleTargetInput getInput()
      The input to the state machine execution.

      Default: - the entire EventBridge event

    • getRole

      @Stability(Stable) @Nullable default IRole getRole()
      The IAM role to be used to execute the SQL statement.

      Default: - a new role will be created.

    • getSecret

      @Stability(Stable) @Nullable default ISecret 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

      @Stability(Stable) @Nullable default Boolean getSendEventBridgeEvent()
      Should an event be sent back to Event Bridge when the SQL statement is executed.

      Default: false

    • getStatementName

      @Stability(Stable) @Nullable default String 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

      @Stability(Stable) static RedshiftQueryProps.Builder builder()
      Returns:
      a RedshiftQueryProps.Builder of RedshiftQueryProps