Class: AWSCDK::EventsTargets::BatchJobProps

Inherits:
TargetBaseProps
  • Object
show all
Defined in:
events_targets/batch_job_props.rb

Overview

Customize the Batch Job Event Target.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, attempts: nil, event: nil, job_name: nil, size: nil) ⇒ BatchJobProps

Returns a new instance of BatchJobProps.

Parameters:

  • dead_letter_queue (AWSCDK::SQS::IQueue, nil) (defaults to: nil)

    The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.

  • max_event_age (AWSCDK::Duration, nil) (defaults to: nil)

    The maximum age of a request that Lambda sends to a function for processing.

  • retry_attempts (Numeric, nil) (defaults to: nil)

    The maximum number of times to retry when the function returns an error.

  • attempts (Numeric, nil) (defaults to: nil)

    The number of times to attempt to retry, if the job fails.

  • event (AWSCDK::Events::RuleTargetInput, nil) (defaults to: nil)

    The event to send to the Lambda.

  • job_name (String, nil) (defaults to: nil)

    The name of the submitted job.

  • size (Numeric, nil) (defaults to: nil)

    The size of the array, if this is an array batch job.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'events_targets/batch_job_props.rb', line 14

def initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, attempts: nil, event: nil, job_name: nil, size: 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?
  @max_event_age = max_event_age
  Jsii::Type.check_type(@max_event_age, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "maxEventAge") unless @max_event_age.nil?
  @retry_attempts = retry_attempts
  Jsii::Type.check_type(@retry_attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "retryAttempts") unless @retry_attempts.nil?
  @attempts = attempts
  Jsii::Type.check_type(@attempts, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "attempts") unless @attempts.nil?
  @event = event
  Jsii::Type.check_type(@event, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlJ1bGVUYXJnZXRJbnB1dCJ9")), "event") unless @event.nil?
  @job_name = job_name
  Jsii::Type.check_type(@job_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "jobName") unless @job_name.nil?
  @size = size
  Jsii::Type.check_type(@size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "size") unless @size.nil?
end

Instance Attribute Details

#attemptsNumeric? (readonly)

Note:

Default: no retryStrategy is set

The number of times to attempt to retry, if the job fails.

Valid values are 1–10.

Returns:

  • (Numeric, nil)


62
63
64
# File 'events_targets/batch_job_props.rb', line 62

def attempts
  @attempts
end

#dead_letter_queueAWSCDK::SQS::IQueue? (readonly)

Note:

Default: - no dead-letter queue

The SQS queue to be used as deadLetterQueue. Check out the considerations for using a dead-letter queue.

The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.

Returns:



39
40
41
# File 'events_targets/batch_job_props.rb', line 39

def dead_letter_queue
  @dead_letter_queue
end

#eventAWSCDK::Events::RuleTargetInput? (readonly)

Note:

Default: the entire EventBridge event

The event to send to the Lambda.

This will be the payload sent to the Lambda Function.



69
70
71
# File 'events_targets/batch_job_props.rb', line 69

def event
  @event
end

#job_nameString? (readonly)

Note:

Default: - Automatically generated

The name of the submitted job.

Returns:

  • (String, nil)


74
75
76
# File 'events_targets/batch_job_props.rb', line 74

def job_name
  @job_name
end

#max_event_ageAWSCDK::Duration? (readonly)

Note:

Default: Duration.hours(24)

The maximum age of a request that Lambda sends to a function for processing.

Minimum value of 60. Maximum value of 86400.

Returns:



47
48
49
# File 'events_targets/batch_job_props.rb', line 47

def max_event_age
  @max_event_age
end

#retry_attemptsNumeric? (readonly)

Note:

Default: 185

The maximum number of times to retry when the function returns an error.

Minimum value of 0. Maximum value of 185.

Returns:

  • (Numeric, nil)


55
56
57
# File 'events_targets/batch_job_props.rb', line 55

def retry_attempts
  @retry_attempts
end

#sizeNumeric? (readonly)

Note:

Default: no arrayProperties are set

The size of the array, if this is an array batch job.

Valid values are integers between 2 and 10,000.

Returns:

  • (Numeric, nil)


81
82
83
# File 'events_targets/batch_job_props.rb', line 81

def size
  @size
end

Class Method Details

.jsii_propertiesObject



83
84
85
86
87
88
89
90
91
92
93
# File 'events_targets/batch_job_props.rb', line 83

def self.jsii_properties
  {
    :dead_letter_queue => "deadLetterQueue",
    :max_event_age => "maxEventAge",
    :retry_attempts => "retryAttempts",
    :attempts => "attempts",
    :event => "event",
    :job_name => "jobName",
    :size => "size",
  }
end

Instance Method Details

#to_jsiiObject



95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'events_targets/batch_job_props.rb', line 95

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "deadLetterQueue" => @dead_letter_queue,
    "maxEventAge" => @max_event_age,
    "retryAttempts" => @retry_attempts,
    "attempts" => @attempts,
    "event" => @event,
    "jobName" => @job_name,
    "size" => @size,
  })
  result.compact
end