Class: AWSCDK::EventsTargets::APIDestinationProps

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

Overview

Customize the EventBridge Api Destinations 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, event: nil, event_role: nil, header_parameters: nil, path_parameter_values: nil, query_string_parameters: nil) ⇒ APIDestinationProps

Returns a new instance of APIDestinationProps.

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.

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

    The event to send.

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

    The role to assume before invoking the target.

  • header_parameters (Hash{String => String}, nil) (defaults to: nil)

    Additional headers sent to the API Destination.

  • path_parameter_values (Array<String>, nil) (defaults to: nil)

    Path parameters to insert in place of path wildcards (*).

  • query_string_parameters (Hash{String => String}, nil) (defaults to: nil)

    Additional query string parameters sent to the API Destination.



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

def initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, event: nil, event_role: nil, header_parameters: nil, path_parameter_values: nil, query_string_parameters: 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?
  @event_role = event_role
  Jsii::Type.check_type(@event_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "eventRole") unless @event_role.nil?
  @header_parameters = header_parameters
  Jsii::Type.check_type(@header_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "headerParameters") unless @header_parameters.nil?
  @path_parameter_values = path_parameter_values
  Jsii::Type.check_type(@path_parameter_values, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "pathParameterValues") unless @path_parameter_values.nil?
  @query_string_parameters = query_string_parameters
  Jsii::Type.check_type(@query_string_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "queryStringParameters") unless @query_string_parameters.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. 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:



42
43
44
# File 'events_targets/api_destination_props.rb', line 42

def dead_letter_queue
  @dead_letter_queue
end

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

Note:

Default: - the entire EventBridge event

The event to send.



63
64
65
# File 'events_targets/api_destination_props.rb', line 63

def event
  @event
end

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

Note:

Default: - a new role will be created

The role to assume before invoking the target.

Returns:



68
69
70
# File 'events_targets/api_destination_props.rb', line 68

def event_role
  @event_role
end

#header_parametersHash{String => String}? (readonly)

Note:

Default: - none

Additional headers sent to the API Destination.

These are merged with headers specified on the Connection, with the headers on the Connection taking precedence.

You can only specify secret values on the Connection.

Returns:

  • (Hash{String => String}, nil)


78
79
80
# File 'events_targets/api_destination_props.rb', line 78

def header_parameters
  @header_parameters
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:



50
51
52
# File 'events_targets/api_destination_props.rb', line 50

def max_event_age
  @max_event_age
end

#path_parameter_valuesArray<String>? (readonly)

Note:

Default: - none

Path parameters to insert in place of path wildcards (*).

If the API destination has a wilcard in the path, these path parts will be inserted in that place.

Returns:

  • (Array<String>, nil)


86
87
88
# File 'events_targets/api_destination_props.rb', line 86

def path_parameter_values
  @path_parameter_values
end

#query_string_parametersHash{String => String}? (readonly)

Note:

Default: - none

Additional query string parameters sent to the API Destination.

These are merged with headers specified on the Connection, with the headers on the Connection taking precedence.

You can only specify secret values on the Connection.

Returns:

  • (Hash{String => String}, nil)


96
97
98
# File 'events_targets/api_destination_props.rb', line 96

def query_string_parameters
  @query_string_parameters
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)


58
59
60
# File 'events_targets/api_destination_props.rb', line 58

def retry_attempts
  @retry_attempts
end

Class Method Details

.jsii_propertiesObject



98
99
100
101
102
103
104
105
106
107
108
109
# File 'events_targets/api_destination_props.rb', line 98

def self.jsii_properties
  {
    :dead_letter_queue => "deadLetterQueue",
    :max_event_age => "maxEventAge",
    :retry_attempts => "retryAttempts",
    :event => "event",
    :event_role => "eventRole",
    :header_parameters => "headerParameters",
    :path_parameter_values => "pathParameterValues",
    :query_string_parameters => "queryStringParameters",
  }
end

Instance Method Details

#to_jsiiObject



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'events_targets/api_destination_props.rb', line 111

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "deadLetterQueue" => @dead_letter_queue,
    "maxEventAge" => @max_event_age,
    "retryAttempts" => @retry_attempts,
    "event" => @event,
    "eventRole" => @event_role,
    "headerParameters" => @header_parameters,
    "pathParameterValues" => @path_parameter_values,
    "queryStringParameters" => @query_string_parameters,
  })
  result.compact
end