Class: AWSCDK::EventsTargets::BatchJob
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::EventsTargets::BatchJob
- Includes:
- AWSCDK::Events::IRuleTarget
- Defined in:
- events_targets/batch_job.rb
Overview
Use an AWS Batch Job / Queue as an event rule target.
Most likely the code will look something like this:
new BatchJob(jobQueue.jobQueueArn, jobQueue, jobDefinition.jobDefinitionArn, jobDefinition)
In the future this API will be improved to be fully typed
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(rule, _id = nil) ⇒ AWSCDK::Events::RuleTargetConfig
Returns a RuleTarget that can be used to trigger queue this batch job as a result from an EventBridge event.
-
#initialize(job_queue_arn, job_queue_scope, job_definition_arn, job_definition_scope, props = nil) ⇒ BatchJob
constructor
A new instance of BatchJob.
Constructor Details
#initialize(job_queue_arn, job_queue_scope, job_definition_arn, job_definition_scope, props = nil) ⇒ BatchJob
Returns a new instance of BatchJob.
19 20 21 22 23 24 25 26 27 |
# File 'events_targets/batch_job.rb', line 19 def initialize(job_queue_arn, job_queue_scope, job_definition_arn, job_definition_scope, props = nil) props = props.is_a?(Hash) ? ::AWSCDK::EventsTargets::BatchJobProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(job_queue_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jobQueueArn") Jsii::Type.check_type(job_queue_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "jobQueueScope") Jsii::Type.check_type(job_definition_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jobDefinitionArn") Jsii::Type.check_type(job_definition_scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklDb25zdHJ1Y3QifQ==")), "jobDefinitionScope") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzX3RhcmdldHMuQmF0Y2hKb2JQcm9wcyJ9")), "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(job_queue_arn, job_queue_scope, job_definition_arn, job_definition_scope, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
29 30 31 32 33 |
# File 'events_targets/batch_job.rb', line 29 def self.jsii_overridable_methods { :bind => { kind: :method, name: "bind", is_optional: false }, } end |
Instance Method Details
#bind(rule, _id = nil) ⇒ AWSCDK::Events::RuleTargetConfig
Returns a RuleTarget that can be used to trigger queue this batch job as a result from an EventBridge event.
40 41 42 43 44 |
# File 'events_targets/batch_job.rb', line 40 def bind(rule, _id = nil) Jsii::Type.check_type(rule, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19ldmVudHMuSVJ1bGVSZWYifQ==")), "rule") Jsii::Type.check_type(_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "_id") unless _id.nil? jsii_call_method("bind", [rule, _id]) end |