Class: AWSCDK::SchedulerTargets::ScheduleTargetBaseProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
scheduler_targets/schedule_target_base_props.rb

Overview

Base properties for a Schedule Target.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dead_letter_queue: nil, input: nil, max_event_age: nil, retry_attempts: nil, role: nil) ⇒ ScheduleTargetBaseProps

Returns a new instance of ScheduleTargetBaseProps.

Parameters:

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

    The SQS queue to be used as deadLetterQueue.

  • input (AWSCDK::Scheduler::ScheduleTargetInput, nil) (defaults to: nil)

    Input passed to the target.

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

    The maximum age of a request that Scheduler sends to a target for processing.

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

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

  • role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'scheduler_targets/schedule_target_base_props.rb', line 12

def initialize(dead_letter_queue: nil, input: nil, max_event_age: nil, retry_attempts: nil, role: 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("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2NoZWR1bGVyLlNjaGVkdWxlVGFyZ2V0SW5wdXQifQ==")), "input") unless @input.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?
  @role = role
  Jsii::Type.check_type(@role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "role") unless @role.nil?
end

Instance Attribute Details

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

Note:

Default: - no dead-letter queue

The SQS queue to be used as deadLetterQueue.

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:



33
34
35
# File 'scheduler_targets/schedule_target_base_props.rb', line 33

def dead_letter_queue
  @dead_letter_queue
end

#inputAWSCDK::Scheduler::ScheduleTargetInput? (readonly)

Note:

Default: - no input.

Input passed to the target.



38
39
40
# File 'scheduler_targets/schedule_target_base_props.rb', line 38

def input
  @input
end

#max_event_ageAWSCDK::Duration? (readonly)

Note:

Default: Duration.hours(24)

The maximum age of a request that Scheduler sends to a target for processing.

Minimum value of 60. Maximum value of 86400.

Returns:



46
47
48
# File 'scheduler_targets/schedule_target_base_props.rb', line 46

def max_event_age
  @max_event_age
end

#retry_attemptsNumeric? (readonly)

Note:

Default: 185

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

Minimum value of 0. Maximum value of 185.

Returns:

  • (Numeric, nil)


54
55
56
# File 'scheduler_targets/schedule_target_base_props.rb', line 54

def retry_attempts
  @retry_attempts
end

#roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - created by target

An execution role is an IAM role that EventBridge Scheduler assumes in order to interact with other AWS services on your behalf.

If none provided templates target will automatically create an IAM role with all the minimum necessary permissions to interact with the templated target. If you wish you may specify your own IAM role, then the templated targets will grant minimal required permissions.

Returns:



63
64
65
# File 'scheduler_targets/schedule_target_base_props.rb', line 63

def role
  @role
end

Class Method Details

.jsii_propertiesObject



65
66
67
68
69
70
71
72
73
# File 'scheduler_targets/schedule_target_base_props.rb', line 65

def self.jsii_properties
  {
    :dead_letter_queue => "deadLetterQueue",
    :input => "input",
    :max_event_age => "maxEventAge",
    :retry_attempts => "retryAttempts",
    :role => "role",
  }
end

Instance Method Details

#to_jsiiObject



75
76
77
78
79
80
81
82
83
84
85
# File 'scheduler_targets/schedule_target_base_props.rb', line 75

def to_jsii
  result = {}
  result.merge!({
    "deadLetterQueue" => @dead_letter_queue,
    "input" => @input,
    "maxEventAge" => @max_event_age,
    "retryAttempts" => @retry_attempts,
    "role" => @role,
  })
  result.compact
end