Class RedshiftQuery

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.events.targets.RedshiftQuery
All Implemented Interfaces:
IRuleTarget, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.125.0 (build fdbe357)", date="2026-01-19T12:03:54.824Z") @Stability(Stable) public class RedshiftQuery extends software.amazon.jsii.JsiiObject implements IRuleTarget
Schedule an Amazon Redshift Query to be run, using the Redshift Data API.

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 both statementName and ruleName.

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

    • RedshiftQuery

      protected RedshiftQuery(software.amazon.jsii.JsiiObjectRef objRef)
    • RedshiftQuery

      protected RedshiftQuery(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • RedshiftQuery

      @Stability(Stable) public RedshiftQuery(@NotNull String clusterArn, @NotNull RedshiftQueryProps props)
      Parameters:
      clusterArn - The ARN of the Amazon Redshift cluster. This parameter is required.
      props - The properties of the Redshift Query event. This parameter is required.
  • Method Details

    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRuleRef rule, @Nullable String _id)
      Returns the rule target specification.

      NOTE: Do not use the various inputXxx options. They can be set in a call to addTarget.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      rule - This parameter is required.
      _id -
    • bind

      @Stability(Stable) @NotNull public RuleTargetConfig bind(@NotNull IRuleRef rule)
      Returns the rule target specification.

      NOTE: Do not use the various inputXxx options. They can be set in a call to addTarget.

      Specified by:
      bind in interface IRuleTarget
      Parameters:
      rule - This parameter is required.