Class: AWSCDK::EventsTargets::LambdaFunctionProps
- Inherits:
-
TargetBaseProps
- Object
- TargetBaseProps
- AWSCDK::EventsTargets::LambdaFunctionProps
- Defined in:
- events_targets/lambda_function_props.rb
Overview
Customize the Lambda Event Target.
Instance Attribute Summary collapse
-
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue?
readonly
The SQS queue to be used as deadLetterQueue.
-
#event ⇒ AWSCDK::Events::RuleTargetInput?
readonly
The event to send to the Lambda.
-
#max_event_age ⇒ AWSCDK::Duration?
readonly
The maximum age of a request that Lambda sends to a function for processing.
-
#retry_attempts ⇒ Numeric?
readonly
The maximum number of times to retry when the function returns an error.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, event: nil) ⇒ LambdaFunctionProps
constructor
A new instance of LambdaFunctionProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, event: nil) ⇒ LambdaFunctionProps
Returns a new instance of LambdaFunctionProps.
11 12 13 14 15 16 17 18 19 20 |
# File 'events_targets/lambda_function_props.rb', line 11 def initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, event: 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? @event = event Jsii::Type.check_type(@event, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlJ1bGVUYXJnZXRJbnB1dCJ9")), "event") unless @event.nil? end |
Instance Attribute Details
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue? (readonly)
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.
30 31 32 |
# File 'events_targets/lambda_function_props.rb', line 30 def dead_letter_queue @dead_letter_queue end |
#event ⇒ AWSCDK::Events::RuleTargetInput? (readonly)
Default: the entire EventBridge event
The event to send to the Lambda.
This will be the payload sent to the Lambda Function.
53 54 55 |
# File 'events_targets/lambda_function_props.rb', line 53 def event @event end |
#max_event_age ⇒ AWSCDK::Duration? (readonly)
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.
38 39 40 |
# File 'events_targets/lambda_function_props.rb', line 38 def max_event_age @max_event_age end |
#retry_attempts ⇒ Numeric? (readonly)
Default: 185
The maximum number of times to retry when the function returns an error.
Minimum value of 0. Maximum value of 185.
46 47 48 |
# File 'events_targets/lambda_function_props.rb', line 46 def retry_attempts @retry_attempts end |
Class Method Details
.jsii_properties ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'events_targets/lambda_function_props.rb', line 55 def self.jsii_properties { :dead_letter_queue => "deadLetterQueue", :max_event_age => "maxEventAge", :retry_attempts => "retryAttempts", :event => "event", } end |
Instance Method Details
#to_jsii ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 |
# File 'events_targets/lambda_function_props.rb', line 64 def to_jsii result = {} result.merge!(super) result.merge!({ "deadLetterQueue" => @dead_letter_queue, "maxEventAge" => @max_event_age, "retryAttempts" => @retry_attempts, "event" => @event, }) result.compact end |