Class: AWSCDK::EventsTargets::RedshiftQueryProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::EventsTargets::RedshiftQueryProps
- Defined in:
- events_targets/redshift_query_props.rb
Overview
Configuration properties of an Amazon Redshift Query event.
Instance Attribute Summary collapse
-
#database ⇒ String
readonly
The Amazon Redshift database to run the query against.
-
#db_user ⇒ String?
readonly
The Amazon Redshift database user to run the query as.
-
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue?
readonly
The queue to be used as dead letter queue.
-
#input ⇒ AWSCDK::Events::RuleTargetInput?
readonly
The input to the state machine execution.
-
#role ⇒ AWSCDK::IAM::IRole?
readonly
The IAM role to be used to execute the SQL statement.
-
#secret ⇒ AWSCDK::SecretsManager::ISecret?
readonly
The secret containing the password for the database user.
-
#send_event_bridge_event ⇒ Boolean?
readonly
Should an event be sent back to Event Bridge when the SQL statement is executed.
-
#sql ⇒ Array<String>
readonly
The SQL queries to be executed.
-
#statement_name ⇒ String?
readonly
The name of the SQL statement.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(database:, sql:, db_user: nil, dead_letter_queue: nil, input: nil, role: nil, secret: nil, send_event_bridge_event: nil, statement_name: nil) ⇒ RedshiftQueryProps
constructor
A new instance of RedshiftQueryProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(database:, sql:, db_user: nil, dead_letter_queue: nil, input: nil, role: nil, secret: nil, send_event_bridge_event: nil, statement_name: nil) ⇒ RedshiftQueryProps
Returns a new instance of RedshiftQueryProps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'events_targets/redshift_query_props.rb', line 16 def initialize(database:, sql:, db_user: nil, dead_letter_queue: nil, input: nil, role: nil, secret: nil, send_event_bridge_event: nil, statement_name: nil) @database = database Jsii::Type.check_type(@database, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "database") @sql = sql Jsii::Type.check_type(@sql, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "sql") @db_user = db_user Jsii::Type.check_type(@db_user, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dbUser") unless @db_user.nil? @dead_letter_queue = dead_letter_queue Jsii::Type.check_type(@dead_letter_queue, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3FzLklRdWV1ZSJ9")), "deadLetterQueue") unless @dead_letter_queue.nil? @input = input Jsii::Type.check_type(@input, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlJ1bGVUYXJnZXRJbnB1dCJ9")), "input") unless @input.nil? @role = role Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil? @secret = secret Jsii::Type.check_type(@secret, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2VjcmV0c21hbmFnZXIuSVNlY3JldCJ9")), "secret") unless @secret.nil? @send_event_bridge_event = send_event_bridge_event Jsii::Type.check_type(@send_event_bridge_event, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "sendEventBridgeEvent") unless @send_event_bridge_event.nil? @statement_name = statement_name Jsii::Type.check_type(@statement_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statementName") unless @statement_name.nil? end |
Instance Attribute Details
#database ⇒ String (readonly)
The Amazon Redshift database to run the query against.
40 41 42 |
# File 'events_targets/redshift_query_props.rb', line 40 def database @database end |
#db_user ⇒ String? (readonly)
Default: - No Database user is specified
The Amazon Redshift database user to run the query as.
This is required when authenticating via temporary credentials.
57 58 59 |
# File 'events_targets/redshift_query_props.rb', line 57 def db_user @db_user end |
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue? (readonly)
Default: - No dead letter queue is specified
The queue to be used as dead letter queue.
62 63 64 |
# File 'events_targets/redshift_query_props.rb', line 62 def dead_letter_queue @dead_letter_queue end |
#input ⇒ AWSCDK::Events::RuleTargetInput? (readonly)
Default: - the entire EventBridge event
The input to the state machine execution.
67 68 69 |
# File 'events_targets/redshift_query_props.rb', line 67 def input @input end |
#role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - a new role will be created.
The IAM role to be used to execute the SQL statement.
72 73 74 |
# File 'events_targets/redshift_query_props.rb', line 72 def role @role end |
#secret ⇒ AWSCDK::SecretsManager::ISecret? (readonly)
Default: - No secret is specified
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.
80 81 82 |
# File 'events_targets/redshift_query_props.rb', line 80 def secret @secret end |
#send_event_bridge_event ⇒ Boolean? (readonly)
Default: false
Should an event be sent back to Event Bridge when the SQL statement is executed.
85 86 87 |
# File 'events_targets/redshift_query_props.rb', line 85 def send_event_bridge_event @send_event_bridge_event end |
#sql ⇒ Array<String> (readonly)
Default: - No SQL query is specified
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
batch_execute_statementAPI. Therefore, if any statement fails, the entire transaction is rolled back. - If a single SQL statement is to be executed, this will use the
execute_statementAPI.
50 51 52 |
# File 'events_targets/redshift_query_props.rb', line 50 def sql @sql end |
#statement_name ⇒ String? (readonly)
Default: - No statement name is specified
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.
92 93 94 |
# File 'events_targets/redshift_query_props.rb', line 92 def statement_name @statement_name end |
Class Method Details
.jsii_properties ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'events_targets/redshift_query_props.rb', line 94 def self.jsii_properties { :database => "database", :sql => "sql", :db_user => "dbUser", :dead_letter_queue => "deadLetterQueue", :input => "input", :role => "role", :secret => "secret", :send_event_bridge_event => "sendEventBridgeEvent", :statement_name => "statementName", } end |
Instance Method Details
#to_jsii ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'events_targets/redshift_query_props.rb', line 108 def to_jsii result = {} result.merge!({ "database" => @database, "sql" => @sql, "dbUser" => @db_user, "deadLetterQueue" => @dead_letter_queue, "input" => @input, "role" => @role, "secret" => @secret, "sendEventBridgeEvent" => @send_event_bridge_event, "statementName" => @statement_name, }) result.compact end |