aws-sdk-lambda 1.92.0 → 1.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/VERSION +1 -1
- data/lib/aws-sdk-lambda/client.rb +363 -68
- data/lib/aws-sdk-lambda/client_api.rb +80 -0
- data/lib/aws-sdk-lambda/endpoints.rb +14 -0
- data/lib/aws-sdk-lambda/event_streams.rb +54 -0
- data/lib/aws-sdk-lambda/plugins/endpoints.rb +2 -0
- data/lib/aws-sdk-lambda/types.rb +386 -80
- data/lib/aws-sdk-lambda.rb +2 -1
- metadata +3 -2
@@ -32,6 +32,7 @@ require 'aws-sdk-core/plugins/defaults_mode.rb'
|
|
32
32
|
require 'aws-sdk-core/plugins/recursion_detection.rb'
|
33
33
|
require 'aws-sdk-core/plugins/sign.rb'
|
34
34
|
require 'aws-sdk-core/plugins/protocols/rest_json.rb'
|
35
|
+
require 'aws-sdk-core/plugins/event_stream_configuration.rb'
|
35
36
|
|
36
37
|
Aws::Plugins::GlobalConfiguration.add_identifier(:lambda)
|
37
38
|
|
@@ -81,6 +82,7 @@ module Aws::Lambda
|
|
81
82
|
add_plugin(Aws::Plugins::RecursionDetection)
|
82
83
|
add_plugin(Aws::Plugins::Sign)
|
83
84
|
add_plugin(Aws::Plugins::Protocols::RestJson)
|
85
|
+
add_plugin(Aws::Plugins::EventStreamConfiguration)
|
84
86
|
add_plugin(Aws::Lambda::Plugins::Endpoints)
|
85
87
|
|
86
88
|
# @overload initialize(options)
|
@@ -210,6 +212,12 @@ module Aws::Lambda
|
|
210
212
|
# @option options [Boolean] :endpoint_discovery (false)
|
211
213
|
# When set to `true`, endpoint discovery will be enabled for operations when available.
|
212
214
|
#
|
215
|
+
# @option options [Proc] :event_stream_handler
|
216
|
+
# When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.
|
217
|
+
#
|
218
|
+
# @option options [Proc] :input_event_stream_handler
|
219
|
+
# When an EventStream or Proc object is provided, it can be used for sending events for the event stream.
|
220
|
+
#
|
213
221
|
# @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
|
214
222
|
# The log formatter.
|
215
223
|
#
|
@@ -226,6 +234,9 @@ module Aws::Lambda
|
|
226
234
|
# setting this value to 5 will result in a request being retried up to
|
227
235
|
# 4 times. Used in `standard` and `adaptive` retry modes.
|
228
236
|
#
|
237
|
+
# @option options [Proc] :output_event_stream_handler
|
238
|
+
# When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way.
|
239
|
+
#
|
229
240
|
# @option options [String] :profile ("default")
|
230
241
|
# Used when loading credentials from the shared credentials file
|
231
242
|
# at HOME/.aws/credentials. When not specified, 'default' is used.
|
@@ -730,6 +741,8 @@ module Aws::Lambda
|
|
730
741
|
#
|
731
742
|
# * [ Apache Kafka][6]
|
732
743
|
#
|
744
|
+
# * [ Amazon DocumentDB][7]
|
745
|
+
#
|
733
746
|
# The following error handling options are available only for stream
|
734
747
|
# sources (DynamoDB and Kinesis):
|
735
748
|
#
|
@@ -753,17 +766,19 @@ module Aws::Lambda
|
|
753
766
|
# For information about which configuration parameters apply to each
|
754
767
|
# event source, see the following topics.
|
755
768
|
#
|
756
|
-
# * [ Amazon DynamoDB Streams][
|
769
|
+
# * [ Amazon DynamoDB Streams][8]
|
770
|
+
#
|
771
|
+
# * [ Amazon Kinesis][9]
|
757
772
|
#
|
758
|
-
# * [ Amazon
|
773
|
+
# * [ Amazon SQS][10]
|
759
774
|
#
|
760
|
-
# * [ Amazon
|
775
|
+
# * [ Amazon MQ and RabbitMQ][11]
|
761
776
|
#
|
762
|
-
# * [ Amazon
|
777
|
+
# * [ Amazon MSK][12]
|
763
778
|
#
|
764
|
-
# * [
|
779
|
+
# * [ Apache Kafka][13]
|
765
780
|
#
|
766
|
-
# * [
|
781
|
+
# * [ Amazon DocumentDB][14]
|
767
782
|
#
|
768
783
|
#
|
769
784
|
#
|
@@ -773,12 +788,14 @@ module Aws::Lambda
|
|
773
788
|
# [4]: https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping
|
774
789
|
# [5]: https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html
|
775
790
|
# [6]: https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html
|
776
|
-
# [7]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
777
|
-
# [8]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
778
|
-
# [9]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
779
|
-
# [10]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
780
|
-
# [11]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
781
|
-
# [12]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
791
|
+
# [7]: https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html
|
792
|
+
# [8]: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params
|
793
|
+
# [9]: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params
|
794
|
+
# [10]: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params
|
795
|
+
# [11]: https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params
|
796
|
+
# [12]: https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms
|
797
|
+
# [13]: https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms
|
798
|
+
# [14]: https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html#docdb-configuration
|
782
799
|
#
|
783
800
|
# @option params [String] :event_source_arn
|
784
801
|
# The Amazon Resource Name (ARN) of the event source.
|
@@ -795,6 +812,8 @@ module Aws::Lambda
|
|
795
812
|
#
|
796
813
|
# * **Amazon MQ** – The ARN of the broker.
|
797
814
|
#
|
815
|
+
# * **Amazon DocumentDB** – The ARN of the DocumentDB change stream.
|
816
|
+
#
|
798
817
|
# @option params [required, String] :function_name
|
799
818
|
# The name of the Lambda function.
|
800
819
|
#
|
@@ -839,6 +858,8 @@ module Aws::Lambda
|
|
839
858
|
#
|
840
859
|
# * **Amazon MQ (ActiveMQ and RabbitMQ)** – Default 100. Max 10,000.
|
841
860
|
#
|
861
|
+
# * **DocumentDB** – Default 100. Max 10,000.
|
862
|
+
#
|
842
863
|
# @option params [Types::FilterCriteria] :filter_criteria
|
843
864
|
# An object that defines the filter criteria that determine whether
|
844
865
|
# Lambda should process an event. For more information, see [Lambda
|
@@ -855,10 +876,10 @@ module Aws::Lambda
|
|
855
876
|
# seconds in increments of seconds.
|
856
877
|
#
|
857
878
|
# For streams and Amazon SQS event sources, the default batching window
|
858
|
-
# is 0 seconds. For Amazon MSK, Self-managed Apache Kafka,
|
859
|
-
# event sources, the default batching window is 500 ms.
|
860
|
-
# because you can only change `MaximumBatchingWindowInSeconds`
|
861
|
-
# increments of seconds, you cannot revert back to the 500 ms default
|
879
|
+
# is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ,
|
880
|
+
# and DocumentDB event sources, the default batching window is 500 ms.
|
881
|
+
# Note that because you can only change `MaximumBatchingWindowInSeconds`
|
882
|
+
# in increments of seconds, you cannot revert back to the 500 ms default
|
862
883
|
# batching window after you have changed it. To restore the default
|
863
884
|
# batching window, you must create a new event source mapping.
|
864
885
|
#
|
@@ -867,38 +888,41 @@ module Aws::Lambda
|
|
867
888
|
# `MaximumBatchingWindowInSeconds` to at least 1.
|
868
889
|
#
|
869
890
|
# @option params [Integer] :parallelization_factor
|
870
|
-
# (Streams only) The number of batches to process
|
871
|
-
# concurrently.
|
891
|
+
# (Kinesis and DynamoDB Streams only) The number of batches to process
|
892
|
+
# from each shard concurrently.
|
872
893
|
#
|
873
894
|
# @option params [String] :starting_position
|
874
895
|
# The position in a stream from which to start reading. Required for
|
875
896
|
# Amazon Kinesis, Amazon DynamoDB, and Amazon MSK Streams sources.
|
876
|
-
# `AT_TIMESTAMP` is supported only for Amazon Kinesis streams
|
897
|
+
# `AT_TIMESTAMP` is supported only for Amazon Kinesis streams and Amazon
|
898
|
+
# DocumentDB.
|
877
899
|
#
|
878
900
|
# @option params [Time,DateTime,Date,Integer,String] :starting_position_timestamp
|
879
901
|
# With `StartingPosition` set to `AT_TIMESTAMP`, the time from which to
|
880
902
|
# start reading.
|
881
903
|
#
|
882
904
|
# @option params [Types::DestinationConfig] :destination_config
|
883
|
-
# (Streams only)
|
884
|
-
# discarded records.
|
905
|
+
# (Kinesis and DynamoDB Streams only) A standard Amazon SQS queue or
|
906
|
+
# standard Amazon SNS topic destination for discarded records.
|
885
907
|
#
|
886
908
|
# @option params [Integer] :maximum_record_age_in_seconds
|
887
|
-
# (Streams only) Discard records older than the
|
888
|
-
# default value is infinite (-1).
|
909
|
+
# (Kinesis and DynamoDB Streams only) Discard records older than the
|
910
|
+
# specified age. The default value is infinite (-1).
|
889
911
|
#
|
890
912
|
# @option params [Boolean] :bisect_batch_on_function_error
|
891
|
-
# (Streams only) If the function returns an error,
|
892
|
-
# two and retry.
|
913
|
+
# (Kinesis and DynamoDB Streams only) If the function returns an error,
|
914
|
+
# split the batch in two and retry.
|
893
915
|
#
|
894
916
|
# @option params [Integer] :maximum_retry_attempts
|
895
|
-
# (Streams only) Discard records after the
|
896
|
-
# The default value is infinite (-1). When
|
897
|
-
# records are retried until the record
|
917
|
+
# (Kinesis and DynamoDB Streams only) Discard records after the
|
918
|
+
# specified number of retries. The default value is infinite (-1). When
|
919
|
+
# set to infinite (-1), failed records are retried until the record
|
920
|
+
# expires.
|
898
921
|
#
|
899
922
|
# @option params [Integer] :tumbling_window_in_seconds
|
900
|
-
# (Streams only) The duration in seconds of a
|
901
|
-
#
|
923
|
+
# (Kinesis and DynamoDB Streams only) The duration in seconds of a
|
924
|
+
# processing window for DynamoDB and Kinesis Streams event sources. A
|
925
|
+
# value of 0 seconds indicates no tumbling window.
|
902
926
|
#
|
903
927
|
# @option params [Array<String>] :topics
|
904
928
|
# The name of the Kafka topic.
|
@@ -914,8 +938,8 @@ module Aws::Lambda
|
|
914
938
|
# The self-managed Apache Kafka cluster to receive records from.
|
915
939
|
#
|
916
940
|
# @option params [Array<String>] :function_response_types
|
917
|
-
# (Streams and Amazon SQS) A list of current response
|
918
|
-
# to the event source mapping.
|
941
|
+
# (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response
|
942
|
+
# type enums applied to the event source mapping.
|
919
943
|
#
|
920
944
|
# @option params [Types::AmazonManagedKafkaEventSourceConfig] :amazon_managed_kafka_event_source_config
|
921
945
|
# Specific configuration settings for an Amazon Managed Streaming for
|
@@ -1524,6 +1548,24 @@ module Aws::Lambda
|
|
1524
1548
|
#
|
1525
1549
|
# [1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
1526
1550
|
#
|
1551
|
+
# @option params [String] :invoke_mode
|
1552
|
+
# Use one of the following options:
|
1553
|
+
#
|
1554
|
+
# * `BUFFERED` – This is the default option. Lambda invokes your
|
1555
|
+
# function using the `Invoke` API operation. Invocation results are
|
1556
|
+
# available when the payload is complete. The maximum payload size is
|
1557
|
+
# 6 MB.
|
1558
|
+
#
|
1559
|
+
# * `RESPONSE_STREAM` – Your function streams payload results as they
|
1560
|
+
# become available. Lambda invokes your function using the
|
1561
|
+
# `InvokeWithResponseStream` API operation. The maximum response
|
1562
|
+
# payload size is 20 MB, however, you can [request a quota
|
1563
|
+
# increase][1].
|
1564
|
+
#
|
1565
|
+
#
|
1566
|
+
#
|
1567
|
+
# [1]: https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html
|
1568
|
+
#
|
1527
1569
|
# @return [Types::CreateFunctionUrlConfigResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
1528
1570
|
#
|
1529
1571
|
# * {Types::CreateFunctionUrlConfigResponse#function_url #function_url} => String
|
@@ -1531,6 +1573,7 @@ module Aws::Lambda
|
|
1531
1573
|
# * {Types::CreateFunctionUrlConfigResponse#auth_type #auth_type} => String
|
1532
1574
|
# * {Types::CreateFunctionUrlConfigResponse#cors #cors} => Types::Cors
|
1533
1575
|
# * {Types::CreateFunctionUrlConfigResponse#creation_time #creation_time} => Time
|
1576
|
+
# * {Types::CreateFunctionUrlConfigResponse#invoke_mode #invoke_mode} => String
|
1534
1577
|
#
|
1535
1578
|
# @example Request syntax with placeholder values
|
1536
1579
|
#
|
@@ -1546,6 +1589,7 @@ module Aws::Lambda
|
|
1546
1589
|
# expose_headers: ["Header"],
|
1547
1590
|
# max_age: 1,
|
1548
1591
|
# },
|
1592
|
+
# invoke_mode: "BUFFERED", # accepts BUFFERED, RESPONSE_STREAM
|
1549
1593
|
# })
|
1550
1594
|
#
|
1551
1595
|
# @example Response structure
|
@@ -1564,6 +1608,7 @@ module Aws::Lambda
|
|
1564
1608
|
# resp.cors.expose_headers[0] #=> String
|
1565
1609
|
# resp.cors.max_age #=> Integer
|
1566
1610
|
# resp.creation_time #=> Time
|
1611
|
+
# resp.invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"
|
1567
1612
|
#
|
1568
1613
|
# @see http://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/CreateFunctionUrlConfig AWS API Documentation
|
1569
1614
|
#
|
@@ -2669,6 +2714,7 @@ module Aws::Lambda
|
|
2669
2714
|
# * {Types::GetFunctionUrlConfigResponse#cors #cors} => Types::Cors
|
2670
2715
|
# * {Types::GetFunctionUrlConfigResponse#creation_time #creation_time} => Time
|
2671
2716
|
# * {Types::GetFunctionUrlConfigResponse#last_modified_time #last_modified_time} => Time
|
2717
|
+
# * {Types::GetFunctionUrlConfigResponse#invoke_mode #invoke_mode} => String
|
2672
2718
|
#
|
2673
2719
|
# @example Request syntax with placeholder values
|
2674
2720
|
#
|
@@ -2694,6 +2740,7 @@ module Aws::Lambda
|
|
2694
2740
|
# resp.cors.max_age #=> Integer
|
2695
2741
|
# resp.creation_time #=> Time
|
2696
2742
|
# resp.last_modified_time #=> Time
|
2743
|
+
# resp.invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"
|
2697
2744
|
#
|
2698
2745
|
# @see http://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetFunctionUrlConfig AWS API Documentation
|
2699
2746
|
#
|
@@ -3210,6 +3257,220 @@ module Aws::Lambda
|
|
3210
3257
|
req.send_request(options)
|
3211
3258
|
end
|
3212
3259
|
|
3260
|
+
# Configure your Lambda functions to stream response payloads back to
|
3261
|
+
# clients. For more information, see [Configuring a Lambda function to
|
3262
|
+
# stream responses][1].
|
3263
|
+
#
|
3264
|
+
# This operation requires permission for the [lambda:InvokeFunction][2]
|
3265
|
+
# action. For details on how to set up permissions for cross-account
|
3266
|
+
# invocations, see [Granting function access to other accounts][3].
|
3267
|
+
#
|
3268
|
+
#
|
3269
|
+
#
|
3270
|
+
# [1]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html
|
3271
|
+
# [2]: https://docs.aws.amazon.com/IAM/latest/UserGuide/list_awslambda.html
|
3272
|
+
# [3]: https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html#permissions-resource-xaccountinvoke
|
3273
|
+
#
|
3274
|
+
# @option params [required, String] :function_name
|
3275
|
+
# The name of the Lambda function.
|
3276
|
+
#
|
3277
|
+
# **Name formats**
|
3278
|
+
#
|
3279
|
+
# * **Function name** – `my-function`.
|
3280
|
+
#
|
3281
|
+
# * **Function ARN** –
|
3282
|
+
# `arn:aws:lambda:us-west-2:123456789012:function:my-function`.
|
3283
|
+
#
|
3284
|
+
# * **Partial ARN** – `123456789012:function:my-function`.
|
3285
|
+
#
|
3286
|
+
# The length constraint applies only to the full ARN. If you specify
|
3287
|
+
# only the function name, it is limited to 64 characters in length.
|
3288
|
+
#
|
3289
|
+
# @option params [String] :invocation_type
|
3290
|
+
# Use one of the following options:
|
3291
|
+
#
|
3292
|
+
# * `RequestResponse` (default) – Invoke the function synchronously.
|
3293
|
+
# Keep the connection open until the function returns a response or
|
3294
|
+
# times out. The API operation response includes the function response
|
3295
|
+
# and additional data.
|
3296
|
+
#
|
3297
|
+
# * `DryRun` – Validate parameter values and verify that the IAM user or
|
3298
|
+
# role has permission to invoke the function.
|
3299
|
+
#
|
3300
|
+
# @option params [String] :log_type
|
3301
|
+
# Set to `Tail` to include the execution log in the response. Applies to
|
3302
|
+
# synchronously invoked functions only.
|
3303
|
+
#
|
3304
|
+
# @option params [String] :client_context
|
3305
|
+
# Up to 3,583 bytes of base64-encoded data about the invoking client to
|
3306
|
+
# pass to the function in the context object.
|
3307
|
+
#
|
3308
|
+
# @option params [String] :qualifier
|
3309
|
+
# The alias name.
|
3310
|
+
#
|
3311
|
+
# @option params [String, StringIO, File] :payload
|
3312
|
+
# The JSON that you want to provide to your Lambda function as input.
|
3313
|
+
#
|
3314
|
+
# You can enter the JSON directly. For example, `--payload '\{ "key":
|
3315
|
+
# "value" \}'`. You can also specify a file path. For example,
|
3316
|
+
# `--payload file://payload.json`.
|
3317
|
+
#
|
3318
|
+
# @return [Types::InvokeWithResponseStreamResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
3319
|
+
#
|
3320
|
+
# * {Types::InvokeWithResponseStreamResponse#status_code #status_code} => Integer
|
3321
|
+
# * {Types::InvokeWithResponseStreamResponse#executed_version #executed_version} => String
|
3322
|
+
# * {Types::InvokeWithResponseStreamResponse#event_stream #event_stream} => Types::InvokeWithResponseStreamResponseEvent
|
3323
|
+
# * {Types::InvokeWithResponseStreamResponse#response_stream_content_type #response_stream_content_type} => String
|
3324
|
+
#
|
3325
|
+
# @example EventStream Operation Example
|
3326
|
+
#
|
3327
|
+
# You can process event once it arrives immediately, or wait until
|
3328
|
+
# full response complete and iterate through eventstream enumerator.
|
3329
|
+
#
|
3330
|
+
# To interact with event immediately, you need to register #invoke_with_response_stream
|
3331
|
+
# with callbacks, callbacks can be register for specifc events or for all events,
|
3332
|
+
# callback for errors in the event stream is also available for register.
|
3333
|
+
#
|
3334
|
+
# Callbacks can be passed in by `:event_stream_handler` option or within block
|
3335
|
+
# statement attached to #invoke_with_response_stream call directly. Hybrid pattern of both
|
3336
|
+
# is also supported.
|
3337
|
+
#
|
3338
|
+
# `:event_stream_handler` option takes in either Proc object or
|
3339
|
+
# Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent object.
|
3340
|
+
#
|
3341
|
+
# Usage pattern a): callbacks with a block attached to #invoke_with_response_stream
|
3342
|
+
# Example for registering callbacks for all event types and error event
|
3343
|
+
#
|
3344
|
+
# client.invoke_with_response_stream( # params input# ) do |stream|
|
3345
|
+
# stream.on_error_event do |event|
|
3346
|
+
# # catch unmodeled error event in the stream
|
3347
|
+
# raise event
|
3348
|
+
# # => Aws::Errors::EventError
|
3349
|
+
# # event.event_type => :error
|
3350
|
+
# # event.error_code => String
|
3351
|
+
# # event.error_message => String
|
3352
|
+
# end
|
3353
|
+
#
|
3354
|
+
# stream.on_event do |event|
|
3355
|
+
# # process all events arrive
|
3356
|
+
# puts event.event_type
|
3357
|
+
# ...
|
3358
|
+
# end
|
3359
|
+
#
|
3360
|
+
# end
|
3361
|
+
#
|
3362
|
+
# Usage pattern b): pass in `:event_stream_handler` for #invoke_with_response_stream
|
3363
|
+
#
|
3364
|
+
# 1) create a Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent object
|
3365
|
+
# Example for registering callbacks with specific events
|
3366
|
+
#
|
3367
|
+
# handler = Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent.new
|
3368
|
+
# handler.on_payload_chunk_event do |event|
|
3369
|
+
# event # => Aws::Lambda::Types::PayloadChunk
|
3370
|
+
# end
|
3371
|
+
# handler.on_invoke_complete_event do |event|
|
3372
|
+
# event # => Aws::Lambda::Types::InvokeComplete
|
3373
|
+
# end
|
3374
|
+
#
|
3375
|
+
# client.invoke_with_response_stream( # params input #, event_stream_handler: handler)
|
3376
|
+
#
|
3377
|
+
# 2) use a Ruby Proc object
|
3378
|
+
# Example for registering callbacks with specific events
|
3379
|
+
#
|
3380
|
+
# handler = Proc.new do |stream|
|
3381
|
+
# stream.on_payload_chunk_event do |event|
|
3382
|
+
# event # => Aws::Lambda::Types::PayloadChunk
|
3383
|
+
# end
|
3384
|
+
# stream.on_invoke_complete_event do |event|
|
3385
|
+
# event # => Aws::Lambda::Types::InvokeComplete
|
3386
|
+
# end
|
3387
|
+
# end
|
3388
|
+
#
|
3389
|
+
# client.invoke_with_response_stream( # params input #, event_stream_handler: handler)
|
3390
|
+
#
|
3391
|
+
# Usage pattern c): hybird pattern of a) and b)
|
3392
|
+
#
|
3393
|
+
# handler = Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent.new
|
3394
|
+
# handler.on_payload_chunk_event do |event|
|
3395
|
+
# event # => Aws::Lambda::Types::PayloadChunk
|
3396
|
+
# end
|
3397
|
+
# handler.on_invoke_complete_event do |event|
|
3398
|
+
# event # => Aws::Lambda::Types::InvokeComplete
|
3399
|
+
# end
|
3400
|
+
#
|
3401
|
+
# client.invoke_with_response_stream( # params input #, event_stream_handler: handler) do |stream|
|
3402
|
+
# stream.on_error_event do |event|
|
3403
|
+
# # catch unmodeled error event in the stream
|
3404
|
+
# raise event
|
3405
|
+
# # => Aws::Errors::EventError
|
3406
|
+
# # event.event_type => :error
|
3407
|
+
# # event.error_code => String
|
3408
|
+
# # event.error_message => String
|
3409
|
+
# end
|
3410
|
+
# end
|
3411
|
+
#
|
3412
|
+
# Besides above usage patterns for process events when they arrive immediately, you can also
|
3413
|
+
# iterate through events after response complete.
|
3414
|
+
#
|
3415
|
+
# Events are available at resp.event_stream # => Enumerator
|
3416
|
+
# For parameter input example, please refer to following request syntax
|
3417
|
+
#
|
3418
|
+
# @example Request syntax with placeholder values
|
3419
|
+
#
|
3420
|
+
# resp = client.invoke_with_response_stream({
|
3421
|
+
# function_name: "NamespacedFunctionName", # required
|
3422
|
+
# invocation_type: "RequestResponse", # accepts RequestResponse, DryRun
|
3423
|
+
# log_type: "None", # accepts None, Tail
|
3424
|
+
# client_context: "String",
|
3425
|
+
# qualifier: "Qualifier",
|
3426
|
+
# payload: "data",
|
3427
|
+
# })
|
3428
|
+
#
|
3429
|
+
# @example Response structure
|
3430
|
+
#
|
3431
|
+
# resp.status_code #=> Integer
|
3432
|
+
# resp.executed_version #=> String
|
3433
|
+
# All events are available at resp.event_stream:
|
3434
|
+
# resp.event_stream #=> Enumerator
|
3435
|
+
# resp.event_stream.event_types #=> [:payload_chunk, :invoke_complete]
|
3436
|
+
#
|
3437
|
+
# For :payload_chunk event available at #on_payload_chunk_event callback and response eventstream enumerator:
|
3438
|
+
# event.payload #=> String
|
3439
|
+
#
|
3440
|
+
# For :invoke_complete event available at #on_invoke_complete_event callback and response eventstream enumerator:
|
3441
|
+
# event.error_code #=> String
|
3442
|
+
# event.error_details #=> String
|
3443
|
+
# event.log_result #=> String
|
3444
|
+
#
|
3445
|
+
# resp.response_stream_content_type #=> String
|
3446
|
+
#
|
3447
|
+
# @see http://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/InvokeWithResponseStream AWS API Documentation
|
3448
|
+
#
|
3449
|
+
# @overload invoke_with_response_stream(params = {})
|
3450
|
+
# @param [Hash] params ({})
|
3451
|
+
def invoke_with_response_stream(params = {}, options = {}, &block)
|
3452
|
+
params = params.dup
|
3453
|
+
event_stream_handler = case handler = params.delete(:event_stream_handler)
|
3454
|
+
when EventStreams::InvokeWithResponseStreamResponseEvent then handler
|
3455
|
+
when Proc then EventStreams::InvokeWithResponseStreamResponseEvent.new.tap(&handler)
|
3456
|
+
when nil then EventStreams::InvokeWithResponseStreamResponseEvent.new
|
3457
|
+
else
|
3458
|
+
msg = "expected :event_stream_handler to be a block or "\
|
3459
|
+
"instance of Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent"\
|
3460
|
+
", got `#{handler.inspect}` instead"
|
3461
|
+
raise ArgumentError, msg
|
3462
|
+
end
|
3463
|
+
|
3464
|
+
yield(event_stream_handler) if block_given?
|
3465
|
+
|
3466
|
+
req = build_request(:invoke_with_response_stream, params)
|
3467
|
+
|
3468
|
+
req.context[:event_stream_handler] = event_stream_handler
|
3469
|
+
req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)
|
3470
|
+
|
3471
|
+
req.send_request(options, &block)
|
3472
|
+
end
|
3473
|
+
|
3213
3474
|
# Returns a list of [aliases][1] for a Lambda function.
|
3214
3475
|
#
|
3215
3476
|
#
|
@@ -3347,6 +3608,8 @@ module Aws::Lambda
|
|
3347
3608
|
#
|
3348
3609
|
# * **Amazon MQ** – The ARN of the broker.
|
3349
3610
|
#
|
3611
|
+
# * **Amazon DocumentDB** – The ARN of the DocumentDB change stream.
|
3612
|
+
#
|
3350
3613
|
# @option params [String] :function_name
|
3351
3614
|
# The name of the Lambda function.
|
3352
3615
|
#
|
@@ -3563,6 +3826,7 @@ module Aws::Lambda
|
|
3563
3826
|
# resp.function_url_configs[0].cors.expose_headers[0] #=> String
|
3564
3827
|
# resp.function_url_configs[0].cors.max_age #=> Integer
|
3565
3828
|
# resp.function_url_configs[0].auth_type #=> String, one of "NONE", "AWS_IAM"
|
3829
|
+
# resp.function_url_configs[0].invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"
|
3566
3830
|
# resp.next_marker #=> String
|
3567
3831
|
#
|
3568
3832
|
# @see http://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListFunctionUrlConfigs AWS API Documentation
|
@@ -4531,9 +4795,9 @@ module Aws::Lambda
|
|
4531
4795
|
#
|
4532
4796
|
# * **Function** - The Amazon Resource Name (ARN) of a Lambda function.
|
4533
4797
|
#
|
4534
|
-
# * **Queue** - The ARN of
|
4798
|
+
# * **Queue** - The ARN of a standard SQS queue.
|
4535
4799
|
#
|
4536
|
-
# * **Topic** - The ARN of
|
4800
|
+
# * **Topic** - The ARN of a standard SNS topic.
|
4537
4801
|
#
|
4538
4802
|
# * **Event Bus** - The ARN of an Amazon EventBridge event bus.
|
4539
4803
|
#
|
@@ -5046,6 +5310,8 @@ module Aws::Lambda
|
|
5046
5310
|
#
|
5047
5311
|
# * [ Apache Kafka][6]
|
5048
5312
|
#
|
5313
|
+
# * [ Amazon DocumentDB][7]
|
5314
|
+
#
|
5049
5315
|
# The following error handling options are available only for stream
|
5050
5316
|
# sources (DynamoDB and Kinesis):
|
5051
5317
|
#
|
@@ -5069,17 +5335,19 @@ module Aws::Lambda
|
|
5069
5335
|
# For information about which configuration parameters apply to each
|
5070
5336
|
# event source, see the following topics.
|
5071
5337
|
#
|
5072
|
-
# * [ Amazon DynamoDB Streams][
|
5338
|
+
# * [ Amazon DynamoDB Streams][8]
|
5073
5339
|
#
|
5074
|
-
# * [ Amazon Kinesis][
|
5340
|
+
# * [ Amazon Kinesis][9]
|
5075
5341
|
#
|
5076
|
-
# * [ Amazon SQS][
|
5342
|
+
# * [ Amazon SQS][10]
|
5077
5343
|
#
|
5078
|
-
# * [ Amazon MQ and RabbitMQ][
|
5344
|
+
# * [ Amazon MQ and RabbitMQ][11]
|
5079
5345
|
#
|
5080
|
-
# * [ Amazon MSK][
|
5346
|
+
# * [ Amazon MSK][12]
|
5081
5347
|
#
|
5082
|
-
# * [ Apache Kafka][
|
5348
|
+
# * [ Apache Kafka][13]
|
5349
|
+
#
|
5350
|
+
# * [ Amazon DocumentDB][14]
|
5083
5351
|
#
|
5084
5352
|
#
|
5085
5353
|
#
|
@@ -5089,12 +5357,14 @@ module Aws::Lambda
|
|
5089
5357
|
# [4]: https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping
|
5090
5358
|
# [5]: https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html
|
5091
5359
|
# [6]: https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html
|
5092
|
-
# [7]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
5093
|
-
# [8]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
5094
|
-
# [9]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
5095
|
-
# [10]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
5096
|
-
# [11]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
5097
|
-
# [12]: https://docs.aws.amazon.com/lambda/latest/dg/with-
|
5360
|
+
# [7]: https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html
|
5361
|
+
# [8]: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params
|
5362
|
+
# [9]: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params
|
5363
|
+
# [10]: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params
|
5364
|
+
# [11]: https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params
|
5365
|
+
# [12]: https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms
|
5366
|
+
# [13]: https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms
|
5367
|
+
# [14]: https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html#docdb-configuration
|
5098
5368
|
#
|
5099
5369
|
# @option params [required, String] :uuid
|
5100
5370
|
# The identifier of the event source mapping.
|
@@ -5143,6 +5413,8 @@ module Aws::Lambda
|
|
5143
5413
|
#
|
5144
5414
|
# * **Amazon MQ (ActiveMQ and RabbitMQ)** – Default 100. Max 10,000.
|
5145
5415
|
#
|
5416
|
+
# * **DocumentDB** – Default 100. Max 10,000.
|
5417
|
+
#
|
5146
5418
|
# @option params [Types::FilterCriteria] :filter_criteria
|
5147
5419
|
# An object that defines the filter criteria that determine whether
|
5148
5420
|
# Lambda should process an event. For more information, see [Lambda
|
@@ -5159,10 +5431,10 @@ module Aws::Lambda
|
|
5159
5431
|
# seconds in increments of seconds.
|
5160
5432
|
#
|
5161
5433
|
# For streams and Amazon SQS event sources, the default batching window
|
5162
|
-
# is 0 seconds. For Amazon MSK, Self-managed Apache Kafka,
|
5163
|
-
# event sources, the default batching window is 500 ms.
|
5164
|
-
# because you can only change `MaximumBatchingWindowInSeconds`
|
5165
|
-
# increments of seconds, you cannot revert back to the 500 ms default
|
5434
|
+
# is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ,
|
5435
|
+
# and DocumentDB event sources, the default batching window is 500 ms.
|
5436
|
+
# Note that because you can only change `MaximumBatchingWindowInSeconds`
|
5437
|
+
# in increments of seconds, you cannot revert back to the 500 ms default
|
5166
5438
|
# batching window after you have changed it. To restore the default
|
5167
5439
|
# batching window, you must create a new event source mapping.
|
5168
5440
|
#
|
@@ -5171,37 +5443,39 @@ module Aws::Lambda
|
|
5171
5443
|
# `MaximumBatchingWindowInSeconds` to at least 1.
|
5172
5444
|
#
|
5173
5445
|
# @option params [Types::DestinationConfig] :destination_config
|
5174
|
-
# (Streams only)
|
5175
|
-
# discarded records.
|
5446
|
+
# (Kinesis and DynamoDB Streams only) A standard Amazon SQS queue or
|
5447
|
+
# standard Amazon SNS topic destination for discarded records.
|
5176
5448
|
#
|
5177
5449
|
# @option params [Integer] :maximum_record_age_in_seconds
|
5178
|
-
# (Streams only) Discard records older than the
|
5179
|
-
# default value is infinite (-1).
|
5450
|
+
# (Kinesis and DynamoDB Streams only) Discard records older than the
|
5451
|
+
# specified age. The default value is infinite (-1).
|
5180
5452
|
#
|
5181
5453
|
# @option params [Boolean] :bisect_batch_on_function_error
|
5182
|
-
# (Streams only) If the function returns an error,
|
5183
|
-
# two and retry.
|
5454
|
+
# (Kinesis and DynamoDB Streams only) If the function returns an error,
|
5455
|
+
# split the batch in two and retry.
|
5184
5456
|
#
|
5185
5457
|
# @option params [Integer] :maximum_retry_attempts
|
5186
|
-
# (Streams only) Discard records after the
|
5187
|
-
# The default value is infinite (-1). When
|
5188
|
-
# records are retried until the record
|
5458
|
+
# (Kinesis and DynamoDB Streams only) Discard records after the
|
5459
|
+
# specified number of retries. The default value is infinite (-1). When
|
5460
|
+
# set to infinite (-1), failed records are retried until the record
|
5461
|
+
# expires.
|
5189
5462
|
#
|
5190
5463
|
# @option params [Integer] :parallelization_factor
|
5191
|
-
# (Streams only) The number of batches to process
|
5192
|
-
# concurrently.
|
5464
|
+
# (Kinesis and DynamoDB Streams only) The number of batches to process
|
5465
|
+
# from each shard concurrently.
|
5193
5466
|
#
|
5194
5467
|
# @option params [Array<Types::SourceAccessConfiguration>] :source_access_configurations
|
5195
5468
|
# An array of authentication protocols or VPC components required to
|
5196
5469
|
# secure your event source.
|
5197
5470
|
#
|
5198
5471
|
# @option params [Integer] :tumbling_window_in_seconds
|
5199
|
-
# (Streams only) The duration in seconds of a
|
5200
|
-
#
|
5472
|
+
# (Kinesis and DynamoDB Streams only) The duration in seconds of a
|
5473
|
+
# processing window for DynamoDB and Kinesis Streams event sources. A
|
5474
|
+
# value of 0 seconds indicates no tumbling window.
|
5201
5475
|
#
|
5202
5476
|
# @option params [Array<String>] :function_response_types
|
5203
|
-
# (Streams and Amazon SQS) A list of current response
|
5204
|
-
# to the event source mapping.
|
5477
|
+
# (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response
|
5478
|
+
# type enums applied to the event source mapping.
|
5205
5479
|
#
|
5206
5480
|
# @option params [Types::ScalingConfig] :scaling_config
|
5207
5481
|
# (Amazon SQS only) The scaling configuration for the event source. For
|
@@ -5914,9 +6188,9 @@ module Aws::Lambda
|
|
5914
6188
|
#
|
5915
6189
|
# * **Function** - The Amazon Resource Name (ARN) of a Lambda function.
|
5916
6190
|
#
|
5917
|
-
# * **Queue** - The ARN of
|
6191
|
+
# * **Queue** - The ARN of a standard SQS queue.
|
5918
6192
|
#
|
5919
|
-
# * **Topic** - The ARN of
|
6193
|
+
# * **Topic** - The ARN of a standard SNS topic.
|
5920
6194
|
#
|
5921
6195
|
# * **Event Bus** - The ARN of an Amazon EventBridge event bus.
|
5922
6196
|
#
|
@@ -6002,6 +6276,24 @@ module Aws::Lambda
|
|
6002
6276
|
#
|
6003
6277
|
# [1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
6004
6278
|
#
|
6279
|
+
# @option params [String] :invoke_mode
|
6280
|
+
# Use one of the following options:
|
6281
|
+
#
|
6282
|
+
# * `BUFFERED` – This is the default option. Lambda invokes your
|
6283
|
+
# function using the `Invoke` API operation. Invocation results are
|
6284
|
+
# available when the payload is complete. The maximum payload size is
|
6285
|
+
# 6 MB.
|
6286
|
+
#
|
6287
|
+
# * `RESPONSE_STREAM` – Your function streams payload results as they
|
6288
|
+
# become available. Lambda invokes your function using the
|
6289
|
+
# `InvokeWithResponseStream` API operation. The maximum response
|
6290
|
+
# payload size is 20 MB, however, you can [request a quota
|
6291
|
+
# increase][1].
|
6292
|
+
#
|
6293
|
+
#
|
6294
|
+
#
|
6295
|
+
# [1]: https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html
|
6296
|
+
#
|
6005
6297
|
# @return [Types::UpdateFunctionUrlConfigResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
|
6006
6298
|
#
|
6007
6299
|
# * {Types::UpdateFunctionUrlConfigResponse#function_url #function_url} => String
|
@@ -6010,6 +6302,7 @@ module Aws::Lambda
|
|
6010
6302
|
# * {Types::UpdateFunctionUrlConfigResponse#cors #cors} => Types::Cors
|
6011
6303
|
# * {Types::UpdateFunctionUrlConfigResponse#creation_time #creation_time} => Time
|
6012
6304
|
# * {Types::UpdateFunctionUrlConfigResponse#last_modified_time #last_modified_time} => Time
|
6305
|
+
# * {Types::UpdateFunctionUrlConfigResponse#invoke_mode #invoke_mode} => String
|
6013
6306
|
#
|
6014
6307
|
# @example Request syntax with placeholder values
|
6015
6308
|
#
|
@@ -6025,6 +6318,7 @@ module Aws::Lambda
|
|
6025
6318
|
# expose_headers: ["Header"],
|
6026
6319
|
# max_age: 1,
|
6027
6320
|
# },
|
6321
|
+
# invoke_mode: "BUFFERED", # accepts BUFFERED, RESPONSE_STREAM
|
6028
6322
|
# })
|
6029
6323
|
#
|
6030
6324
|
# @example Response structure
|
@@ -6044,6 +6338,7 @@ module Aws::Lambda
|
|
6044
6338
|
# resp.cors.max_age #=> Integer
|
6045
6339
|
# resp.creation_time #=> Time
|
6046
6340
|
# resp.last_modified_time #=> Time
|
6341
|
+
# resp.invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"
|
6047
6342
|
#
|
6048
6343
|
# @see http://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UpdateFunctionUrlConfig AWS API Documentation
|
6049
6344
|
#
|
@@ -6067,7 +6362,7 @@ module Aws::Lambda
|
|
6067
6362
|
params: params,
|
6068
6363
|
config: config)
|
6069
6364
|
context[:gem_name] = 'aws-sdk-lambda'
|
6070
|
-
context[:gem_version] = '1.
|
6365
|
+
context[:gem_version] = '1.94.0'
|
6071
6366
|
Seahorse::Client::Request.new(handlers, context)
|
6072
6367
|
end
|
6073
6368
|
|