Class: AWSCDK::EventsTargets::APIGatewayProps
- Inherits:
-
TargetBaseProps
- Object
- TargetBaseProps
- AWSCDK::EventsTargets::APIGatewayProps
- Defined in:
- events_targets/api_gateway_props.rb
Overview
Customize the API Gateway Event Target.
Instance Attribute Summary collapse
-
#dead_letter_queue ⇒ AWSCDK::SQS::IQueue?
readonly
The SQS queue to be used as deadLetterQueue.
-
#event_role ⇒ AWSCDK::IAM::IRole?
readonly
The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.
-
#header_parameters ⇒ Hash{String => String}?
readonly
The headers to be set when requesting API.
-
#max_event_age ⇒ AWSCDK::Duration?
readonly
The maximum age of a request that Lambda sends to a function for processing.
-
#method ⇒ String?
readonly
The method for api resource invoked by the rule.
-
#path ⇒ String?
readonly
The api resource invoked by the rule.
-
#path_parameter_values ⇒ Array<String>?
readonly
The path parameter values to be used to populate to wildcards("*") of requesting api path.
-
#post_body ⇒ AWSCDK::Events::RuleTargetInput?
readonly
This will be the post request body send to the API.
-
#query_string_parameters ⇒ Hash{String => String}?
readonly
The query parameters to be set when requesting API.
-
#retry_attempts ⇒ Numeric?
readonly
The maximum number of times to retry when the function returns an error.
-
#stage ⇒ String?
readonly
The deploy stage of api gateway invoked by the rule.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, event_role: nil, header_parameters: nil, method: nil, path: nil, path_parameter_values: nil, post_body: nil, query_string_parameters: nil, stage: nil) ⇒ APIGatewayProps
constructor
A new instance of APIGatewayProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, event_role: nil, header_parameters: nil, method: nil, path: nil, path_parameter_values: nil, post_body: nil, query_string_parameters: nil, stage: nil) ⇒ APIGatewayProps
Returns a new instance of APIGatewayProps.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'events_targets/api_gateway_props.rb', line 18 def initialize(dead_letter_queue: nil, max_event_age: nil, retry_attempts: nil, event_role: nil, header_parameters: nil, method: nil, path: nil, path_parameter_values: nil, post_body: nil, query_string_parameters: nil, stage: 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_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? @method = method Jsii::Type.check_type(@method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "method") unless @method.nil? @path = path Jsii::Type.check_type(@path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") unless @path.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? @post_body = post_body Jsii::Type.check_type(@post_body, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfZXZlbnRzLlJ1bGVUYXJnZXRJbnB1dCJ9")), "postBody") unless @post_body.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? @stage = stage Jsii::Type.check_type(@stage, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "stage") unless @stage.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.
51 52 53 |
# File 'events_targets/api_gateway_props.rb', line 51 def dead_letter_queue @dead_letter_queue end |
#event_role ⇒ AWSCDK::IAM::IRole? (readonly)
Default: - a new role will be created
The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.
72 73 74 |
# File 'events_targets/api_gateway_props.rb', line 72 def event_role @event_role end |
#header_parameters ⇒ Hash{String => String}? (readonly)
Default: no header parameters
The headers to be set when requesting API.
77 78 79 |
# File 'events_targets/api_gateway_props.rb', line 77 def header_parameters @header_parameters 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.
59 60 61 |
# File 'events_targets/api_gateway_props.rb', line 59 def max_event_age @max_event_age end |
#method ⇒ String? (readonly)
Default: '*' that treated as ANY
The method for api resource invoked by the rule.
82 83 84 |
# File 'events_targets/api_gateway_props.rb', line 82 def method @method end |
#path ⇒ String? (readonly)
Default: '/'
The api resource invoked by the rule.
We can use wildcards('*') to specify the path. In that case, an equal number of real values must be specified for pathParameterValues.
90 91 92 |
# File 'events_targets/api_gateway_props.rb', line 90 def path @path end |
#path_parameter_values ⇒ Array<String>? (readonly)
Default: no path parameters
The path parameter values to be used to populate to wildcards("*") of requesting api path.
95 96 97 |
# File 'events_targets/api_gateway_props.rb', line 95 def path_parameter_values @path_parameter_values end |
#post_body ⇒ AWSCDK::Events::RuleTargetInput? (readonly)
Default: the entire EventBridge event
This will be the post request body send to the API.
100 101 102 |
# File 'events_targets/api_gateway_props.rb', line 100 def post_body @post_body end |
#query_string_parameters ⇒ Hash{String => String}? (readonly)
Default: no querystring parameters
The query parameters to be set when requesting API.
105 106 107 |
# File 'events_targets/api_gateway_props.rb', line 105 def query_string_parameters @query_string_parameters 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.
67 68 69 |
# File 'events_targets/api_gateway_props.rb', line 67 def retry_attempts @retry_attempts end |
#stage ⇒ String? (readonly)
Default: the value of deploymentStage.stageName of target api gateway.
The deploy stage of api gateway invoked by the rule.
110 111 112 |
# File 'events_targets/api_gateway_props.rb', line 110 def stage @stage end |
Class Method Details
.jsii_properties ⇒ Object
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'events_targets/api_gateway_props.rb', line 112 def self.jsii_properties { :dead_letter_queue => "deadLetterQueue", :max_event_age => "maxEventAge", :retry_attempts => "retryAttempts", :event_role => "eventRole", :header_parameters => "headerParameters", :method => "method", :path => "path", :path_parameter_values => "pathParameterValues", :post_body => "postBody", :query_string_parameters => "queryStringParameters", :stage => "stage", } end |
Instance Method Details
#to_jsii ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'events_targets/api_gateway_props.rb', line 128 def to_jsii result = {} result.merge!(super) result.merge!({ "deadLetterQueue" => @dead_letter_queue, "maxEventAge" => @max_event_age, "retryAttempts" => @retry_attempts, "eventRole" => @event_role, "headerParameters" => @header_parameters, "method" => @method, "path" => @path, "pathParameterValues" => @path_parameter_values, "postBody" => @post_body, "queryStringParameters" => @query_string_parameters, "stage" => @stage, }) result.compact end |