Class RedshiftQuery.Builder

java.lang.Object
software.amazon.awscdk.services.events.targets.RedshiftQuery.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<RedshiftQuery>
Enclosing class:
RedshiftQuery

@Stability(Stable) public static final class RedshiftQuery.Builder extends Object implements software.amazon.jsii.Builder<RedshiftQuery>
A fluent builder for RedshiftQuery.
  • Method Details

    • create

      @Stability(Stable) public static RedshiftQuery.Builder create(String clusterArn)
      Parameters:
      clusterArn - The ARN of the Amazon Redshift cluster. This parameter is required.
      Returns:
      a new instance of RedshiftQuery.Builder.
    • database

      @Stability(Stable) public RedshiftQuery.Builder database(String 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

      @Stability(Stable) public RedshiftQuery.Builder sql(List<String> 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
    • dbUser

      @Stability(Stable) public RedshiftQuery.Builder dbUser(String 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

      @Stability(Stable) public RedshiftQuery.Builder deadLetterQueue(IQueue 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

      @Stability(Stable) public RedshiftQuery.Builder input(RuleTargetInput 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

      @Stability(Stable) public RedshiftQuery.Builder role(IRole 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

      @Stability(Stable) public RedshiftQuery.Builder secret(ISecret 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

      @Stability(Stable) public RedshiftQuery.Builder sendEventBridgeEvent(Boolean 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

      @Stability(Stable) public RedshiftQuery.Builder statementName(String 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

      @Stability(Stable) public RedshiftQuery build()
      Specified by:
      build in interface software.amazon.jsii.Builder<RedshiftQuery>
      Returns:
      a newly built instance of RedshiftQuery.