aws-sdk-lambda 1.92.0 → 1.93.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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][7]
769
+ # * [ Amazon DynamoDB Streams][8]
770
+ #
771
+ # * [ Amazon Kinesis][9]
757
772
  #
758
- # * [ Amazon Kinesis][8]
773
+ # * [ Amazon SQS][10]
759
774
  #
760
- # * [ Amazon SQS][9]
775
+ # * [ Amazon MQ and RabbitMQ][11]
761
776
  #
762
- # * [ Amazon MQ and RabbitMQ][10]
777
+ # * [ Amazon MSK][12]
763
778
  #
764
- # * [ Amazon MSK][11]
779
+ # * [ Apache Kafka][13]
765
780
  #
766
- # * [ Apache Kafka][12]
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-ddb.html#services-ddb-params
777
- # [8]: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params
778
- # [9]: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params
779
- # [10]: https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params
780
- # [11]: https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms
781
- # [12]: https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms
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, and Amazon MQ
859
- # event sources, the default batching window is 500 ms. Note that
860
- # because you can only change `MaximumBatchingWindowInSeconds` in
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 from each shard
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) An Amazon SQS queue or Amazon SNS topic destination for
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 specified age. 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, split the batch in
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 specified number of retries.
896
- # The default value is infinite (-1). When set to infinite (-1), failed
897
- # records are retried until the record expires.
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 processing window. The
901
- # range is between 1 second and 900 seconds.
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 type enums applied
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,214 @@ 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
+ #
3265
+ #
3266
+ # [1]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-response-streaming.html
3267
+ #
3268
+ # @option params [required, String] :function_name
3269
+ # The name of the Lambda function.
3270
+ #
3271
+ # **Name formats**
3272
+ #
3273
+ # * **Function name** – `my-function`.
3274
+ #
3275
+ # * **Function ARN** –
3276
+ # `arn:aws:lambda:us-west-2:123456789012:function:my-function`.
3277
+ #
3278
+ # * **Partial ARN** – `123456789012:function:my-function`.
3279
+ #
3280
+ # The length constraint applies only to the full ARN. If you specify
3281
+ # only the function name, it is limited to 64 characters in length.
3282
+ #
3283
+ # @option params [String] :invocation_type
3284
+ # Use one of the following options:
3285
+ #
3286
+ # * `RequestResponse` (default) – Invoke the function synchronously.
3287
+ # Keep the connection open until the function returns a response or
3288
+ # times out. The API operation response includes the function response
3289
+ # and additional data.
3290
+ #
3291
+ # * `DryRun` – Validate parameter values and verify that the IAM user or
3292
+ # role has permission to invoke the function.
3293
+ #
3294
+ # @option params [String] :log_type
3295
+ # Set to `Tail` to include the execution log in the response. Applies to
3296
+ # synchronously invoked functions only.
3297
+ #
3298
+ # @option params [String] :client_context
3299
+ # Up to 3,583 bytes of base64-encoded data about the invoking client to
3300
+ # pass to the function in the context object.
3301
+ #
3302
+ # @option params [String] :qualifier
3303
+ # The alias name.
3304
+ #
3305
+ # @option params [String, StringIO, File] :payload
3306
+ # The JSON that you want to provide to your Lambda function as input.
3307
+ #
3308
+ # You can enter the JSON directly. For example, `--payload '\{ "key":
3309
+ # "value" \}'`. You can also specify a file path. For example,
3310
+ # `--payload file://payload.json`.
3311
+ #
3312
+ # @return [Types::InvokeWithResponseStreamResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
3313
+ #
3314
+ # * {Types::InvokeWithResponseStreamResponse#status_code #status_code} => Integer
3315
+ # * {Types::InvokeWithResponseStreamResponse#executed_version #executed_version} => String
3316
+ # * {Types::InvokeWithResponseStreamResponse#event_stream #event_stream} => Types::InvokeWithResponseStreamResponseEvent
3317
+ # * {Types::InvokeWithResponseStreamResponse#response_stream_content_type #response_stream_content_type} => String
3318
+ #
3319
+ # @example EventStream Operation Example
3320
+ #
3321
+ # You can process event once it arrives immediately, or wait until
3322
+ # full response complete and iterate through eventstream enumerator.
3323
+ #
3324
+ # To interact with event immediately, you need to register #invoke_with_response_stream
3325
+ # with callbacks, callbacks can be register for specifc events or for all events,
3326
+ # callback for errors in the event stream is also available for register.
3327
+ #
3328
+ # Callbacks can be passed in by `:event_stream_handler` option or within block
3329
+ # statement attached to #invoke_with_response_stream call directly. Hybrid pattern of both
3330
+ # is also supported.
3331
+ #
3332
+ # `:event_stream_handler` option takes in either Proc object or
3333
+ # Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent object.
3334
+ #
3335
+ # Usage pattern a): callbacks with a block attached to #invoke_with_response_stream
3336
+ # Example for registering callbacks for all event types and error event
3337
+ #
3338
+ # client.invoke_with_response_stream( # params input# ) do |stream|
3339
+ # stream.on_error_event do |event|
3340
+ # # catch unmodeled error event in the stream
3341
+ # raise event
3342
+ # # => Aws::Errors::EventError
3343
+ # # event.event_type => :error
3344
+ # # event.error_code => String
3345
+ # # event.error_message => String
3346
+ # end
3347
+ #
3348
+ # stream.on_event do |event|
3349
+ # # process all events arrive
3350
+ # puts event.event_type
3351
+ # ...
3352
+ # end
3353
+ #
3354
+ # end
3355
+ #
3356
+ # Usage pattern b): pass in `:event_stream_handler` for #invoke_with_response_stream
3357
+ #
3358
+ # 1) create a Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent object
3359
+ # Example for registering callbacks with specific events
3360
+ #
3361
+ # handler = Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent.new
3362
+ # handler.on_payload_chunk_event do |event|
3363
+ # event # => Aws::Lambda::Types::PayloadChunk
3364
+ # end
3365
+ # handler.on_invoke_complete_event do |event|
3366
+ # event # => Aws::Lambda::Types::InvokeComplete
3367
+ # end
3368
+ #
3369
+ # client.invoke_with_response_stream( # params input #, event_stream_handler: handler)
3370
+ #
3371
+ # 2) use a Ruby Proc object
3372
+ # Example for registering callbacks with specific events
3373
+ #
3374
+ # handler = Proc.new do |stream|
3375
+ # stream.on_payload_chunk_event do |event|
3376
+ # event # => Aws::Lambda::Types::PayloadChunk
3377
+ # end
3378
+ # stream.on_invoke_complete_event do |event|
3379
+ # event # => Aws::Lambda::Types::InvokeComplete
3380
+ # end
3381
+ # end
3382
+ #
3383
+ # client.invoke_with_response_stream( # params input #, event_stream_handler: handler)
3384
+ #
3385
+ # Usage pattern c): hybird pattern of a) and b)
3386
+ #
3387
+ # handler = Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent.new
3388
+ # handler.on_payload_chunk_event do |event|
3389
+ # event # => Aws::Lambda::Types::PayloadChunk
3390
+ # end
3391
+ # handler.on_invoke_complete_event do |event|
3392
+ # event # => Aws::Lambda::Types::InvokeComplete
3393
+ # end
3394
+ #
3395
+ # client.invoke_with_response_stream( # params input #, event_stream_handler: handler) do |stream|
3396
+ # stream.on_error_event do |event|
3397
+ # # catch unmodeled error event in the stream
3398
+ # raise event
3399
+ # # => Aws::Errors::EventError
3400
+ # # event.event_type => :error
3401
+ # # event.error_code => String
3402
+ # # event.error_message => String
3403
+ # end
3404
+ # end
3405
+ #
3406
+ # Besides above usage patterns for process events when they arrive immediately, you can also
3407
+ # iterate through events after response complete.
3408
+ #
3409
+ # Events are available at resp.event_stream # => Enumerator
3410
+ # For parameter input example, please refer to following request syntax
3411
+ #
3412
+ # @example Request syntax with placeholder values
3413
+ #
3414
+ # resp = client.invoke_with_response_stream({
3415
+ # function_name: "NamespacedFunctionName", # required
3416
+ # invocation_type: "RequestResponse", # accepts RequestResponse, DryRun
3417
+ # log_type: "None", # accepts None, Tail
3418
+ # client_context: "String",
3419
+ # qualifier: "Qualifier",
3420
+ # payload: "data",
3421
+ # })
3422
+ #
3423
+ # @example Response structure
3424
+ #
3425
+ # resp.status_code #=> Integer
3426
+ # resp.executed_version #=> String
3427
+ # All events are available at resp.event_stream:
3428
+ # resp.event_stream #=> Enumerator
3429
+ # resp.event_stream.event_types #=> [:payload_chunk, :invoke_complete]
3430
+ #
3431
+ # For :payload_chunk event available at #on_payload_chunk_event callback and response eventstream enumerator:
3432
+ # event.payload #=> String
3433
+ #
3434
+ # For :invoke_complete event available at #on_invoke_complete_event callback and response eventstream enumerator:
3435
+ # event.error_code #=> String
3436
+ # event.error_details #=> String
3437
+ # event.log_result #=> String
3438
+ #
3439
+ # resp.response_stream_content_type #=> String
3440
+ #
3441
+ # @see http://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/InvokeWithResponseStream AWS API Documentation
3442
+ #
3443
+ # @overload invoke_with_response_stream(params = {})
3444
+ # @param [Hash] params ({})
3445
+ def invoke_with_response_stream(params = {}, options = {}, &block)
3446
+ params = params.dup
3447
+ event_stream_handler = case handler = params.delete(:event_stream_handler)
3448
+ when EventStreams::InvokeWithResponseStreamResponseEvent then handler
3449
+ when Proc then EventStreams::InvokeWithResponseStreamResponseEvent.new.tap(&handler)
3450
+ when nil then EventStreams::InvokeWithResponseStreamResponseEvent.new
3451
+ else
3452
+ msg = "expected :event_stream_handler to be a block or "\
3453
+ "instance of Aws::Lambda::EventStreams::InvokeWithResponseStreamResponseEvent"\
3454
+ ", got `#{handler.inspect}` instead"
3455
+ raise ArgumentError, msg
3456
+ end
3457
+
3458
+ yield(event_stream_handler) if block_given?
3459
+
3460
+ req = build_request(:invoke_with_response_stream, params)
3461
+
3462
+ req.context[:event_stream_handler] = event_stream_handler
3463
+ req.handlers.add(Aws::Binary::DecodeHandler, priority: 95)
3464
+
3465
+ req.send_request(options, &block)
3466
+ end
3467
+
3213
3468
  # Returns a list of [aliases][1] for a Lambda function.
3214
3469
  #
3215
3470
  #
@@ -3347,6 +3602,8 @@ module Aws::Lambda
3347
3602
  #
3348
3603
  # * **Amazon MQ** – The ARN of the broker.
3349
3604
  #
3605
+ # * **Amazon DocumentDB** – The ARN of the DocumentDB change stream.
3606
+ #
3350
3607
  # @option params [String] :function_name
3351
3608
  # The name of the Lambda function.
3352
3609
  #
@@ -3563,6 +3820,7 @@ module Aws::Lambda
3563
3820
  # resp.function_url_configs[0].cors.expose_headers[0] #=> String
3564
3821
  # resp.function_url_configs[0].cors.max_age #=> Integer
3565
3822
  # resp.function_url_configs[0].auth_type #=> String, one of "NONE", "AWS_IAM"
3823
+ # resp.function_url_configs[0].invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"
3566
3824
  # resp.next_marker #=> String
3567
3825
  #
3568
3826
  # @see http://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListFunctionUrlConfigs AWS API Documentation
@@ -4531,9 +4789,9 @@ module Aws::Lambda
4531
4789
  #
4532
4790
  # * **Function** - The Amazon Resource Name (ARN) of a Lambda function.
4533
4791
  #
4534
- # * **Queue** - The ARN of an SQS queue.
4792
+ # * **Queue** - The ARN of a standard SQS queue.
4535
4793
  #
4536
- # * **Topic** - The ARN of an SNS topic.
4794
+ # * **Topic** - The ARN of a standard SNS topic.
4537
4795
  #
4538
4796
  # * **Event Bus** - The ARN of an Amazon EventBridge event bus.
4539
4797
  #
@@ -5046,6 +5304,8 @@ module Aws::Lambda
5046
5304
  #
5047
5305
  # * [ Apache Kafka][6]
5048
5306
  #
5307
+ # * [ Amazon DocumentDB][7]
5308
+ #
5049
5309
  # The following error handling options are available only for stream
5050
5310
  # sources (DynamoDB and Kinesis):
5051
5311
  #
@@ -5069,17 +5329,19 @@ module Aws::Lambda
5069
5329
  # For information about which configuration parameters apply to each
5070
5330
  # event source, see the following topics.
5071
5331
  #
5072
- # * [ Amazon DynamoDB Streams][7]
5332
+ # * [ Amazon DynamoDB Streams][8]
5073
5333
  #
5074
- # * [ Amazon Kinesis][8]
5334
+ # * [ Amazon Kinesis][9]
5075
5335
  #
5076
- # * [ Amazon SQS][9]
5336
+ # * [ Amazon SQS][10]
5077
5337
  #
5078
- # * [ Amazon MQ and RabbitMQ][10]
5338
+ # * [ Amazon MQ and RabbitMQ][11]
5079
5339
  #
5080
- # * [ Amazon MSK][11]
5340
+ # * [ Amazon MSK][12]
5081
5341
  #
5082
- # * [ Apache Kafka][12]
5342
+ # * [ Apache Kafka][13]
5343
+ #
5344
+ # * [ Amazon DocumentDB][14]
5083
5345
  #
5084
5346
  #
5085
5347
  #
@@ -5089,12 +5351,14 @@ module Aws::Lambda
5089
5351
  # [4]: https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-eventsourcemapping
5090
5352
  # [5]: https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html
5091
5353
  # [6]: https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html
5092
- # [7]: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params
5093
- # [8]: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params
5094
- # [9]: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params
5095
- # [10]: https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params
5096
- # [11]: https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms
5097
- # [12]: https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms
5354
+ # [7]: https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html
5355
+ # [8]: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html#services-ddb-params
5356
+ # [9]: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html#services-kinesis-params
5357
+ # [10]: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#services-sqs-params
5358
+ # [11]: https://docs.aws.amazon.com/lambda/latest/dg/with-mq.html#services-mq-params
5359
+ # [12]: https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-parms
5360
+ # [13]: https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-kafka-parms
5361
+ # [14]: https://docs.aws.amazon.com/lambda/latest/dg/with-documentdb.html#docdb-configuration
5098
5362
  #
5099
5363
  # @option params [required, String] :uuid
5100
5364
  # The identifier of the event source mapping.
@@ -5143,6 +5407,8 @@ module Aws::Lambda
5143
5407
  #
5144
5408
  # * **Amazon MQ (ActiveMQ and RabbitMQ)** – Default 100. Max 10,000.
5145
5409
  #
5410
+ # * **DocumentDB** – Default 100. Max 10,000.
5411
+ #
5146
5412
  # @option params [Types::FilterCriteria] :filter_criteria
5147
5413
  # An object that defines the filter criteria that determine whether
5148
5414
  # Lambda should process an event. For more information, see [Lambda
@@ -5159,10 +5425,10 @@ module Aws::Lambda
5159
5425
  # seconds in increments of seconds.
5160
5426
  #
5161
5427
  # For streams and Amazon SQS event sources, the default batching window
5162
- # is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, and Amazon MQ
5163
- # event sources, the default batching window is 500 ms. Note that
5164
- # because you can only change `MaximumBatchingWindowInSeconds` in
5165
- # increments of seconds, you cannot revert back to the 500 ms default
5428
+ # is 0 seconds. For Amazon MSK, Self-managed Apache Kafka, Amazon MQ,
5429
+ # and DocumentDB event sources, the default batching window is 500 ms.
5430
+ # Note that because you can only change `MaximumBatchingWindowInSeconds`
5431
+ # in increments of seconds, you cannot revert back to the 500 ms default
5166
5432
  # batching window after you have changed it. To restore the default
5167
5433
  # batching window, you must create a new event source mapping.
5168
5434
  #
@@ -5171,37 +5437,39 @@ module Aws::Lambda
5171
5437
  # `MaximumBatchingWindowInSeconds` to at least 1.
5172
5438
  #
5173
5439
  # @option params [Types::DestinationConfig] :destination_config
5174
- # (Streams only) An Amazon SQS queue or Amazon SNS topic destination for
5175
- # discarded records.
5440
+ # (Kinesis and DynamoDB Streams only) A standard Amazon SQS queue or
5441
+ # standard Amazon SNS topic destination for discarded records.
5176
5442
  #
5177
5443
  # @option params [Integer] :maximum_record_age_in_seconds
5178
- # (Streams only) Discard records older than the specified age. The
5179
- # default value is infinite (-1).
5444
+ # (Kinesis and DynamoDB Streams only) Discard records older than the
5445
+ # specified age. The default value is infinite (-1).
5180
5446
  #
5181
5447
  # @option params [Boolean] :bisect_batch_on_function_error
5182
- # (Streams only) If the function returns an error, split the batch in
5183
- # two and retry.
5448
+ # (Kinesis and DynamoDB Streams only) If the function returns an error,
5449
+ # split the batch in two and retry.
5184
5450
  #
5185
5451
  # @option params [Integer] :maximum_retry_attempts
5186
- # (Streams only) Discard records after the specified number of retries.
5187
- # The default value is infinite (-1). When set to infinite (-1), failed
5188
- # records are retried until the record expires.
5452
+ # (Kinesis and DynamoDB Streams only) Discard records after the
5453
+ # specified number of retries. The default value is infinite (-1). When
5454
+ # set to infinite (-1), failed records are retried until the record
5455
+ # expires.
5189
5456
  #
5190
5457
  # @option params [Integer] :parallelization_factor
5191
- # (Streams only) The number of batches to process from each shard
5192
- # concurrently.
5458
+ # (Kinesis and DynamoDB Streams only) The number of batches to process
5459
+ # from each shard concurrently.
5193
5460
  #
5194
5461
  # @option params [Array<Types::SourceAccessConfiguration>] :source_access_configurations
5195
5462
  # An array of authentication protocols or VPC components required to
5196
5463
  # secure your event source.
5197
5464
  #
5198
5465
  # @option params [Integer] :tumbling_window_in_seconds
5199
- # (Streams only) The duration in seconds of a processing window. The
5200
- # range is between 1 second and 900 seconds.
5466
+ # (Kinesis and DynamoDB Streams only) The duration in seconds of a
5467
+ # processing window for DynamoDB and Kinesis Streams event sources. A
5468
+ # value of 0 seconds indicates no tumbling window.
5201
5469
  #
5202
5470
  # @option params [Array<String>] :function_response_types
5203
- # (Streams and Amazon SQS) A list of current response type enums applied
5204
- # to the event source mapping.
5471
+ # (Kinesis, DynamoDB Streams, and Amazon SQS) A list of current response
5472
+ # type enums applied to the event source mapping.
5205
5473
  #
5206
5474
  # @option params [Types::ScalingConfig] :scaling_config
5207
5475
  # (Amazon SQS only) The scaling configuration for the event source. For
@@ -5914,9 +6182,9 @@ module Aws::Lambda
5914
6182
  #
5915
6183
  # * **Function** - The Amazon Resource Name (ARN) of a Lambda function.
5916
6184
  #
5917
- # * **Queue** - The ARN of an SQS queue.
6185
+ # * **Queue** - The ARN of a standard SQS queue.
5918
6186
  #
5919
- # * **Topic** - The ARN of an SNS topic.
6187
+ # * **Topic** - The ARN of a standard SNS topic.
5920
6188
  #
5921
6189
  # * **Event Bus** - The ARN of an Amazon EventBridge event bus.
5922
6190
  #
@@ -6002,6 +6270,24 @@ module Aws::Lambda
6002
6270
  #
6003
6271
  # [1]: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
6004
6272
  #
6273
+ # @option params [String] :invoke_mode
6274
+ # Use one of the following options:
6275
+ #
6276
+ # * `BUFFERED` – This is the default option. Lambda invokes your
6277
+ # function using the `Invoke` API operation. Invocation results are
6278
+ # available when the payload is complete. The maximum payload size is
6279
+ # 6 MB.
6280
+ #
6281
+ # * `RESPONSE_STREAM` – Your function streams payload results as they
6282
+ # become available. Lambda invokes your function using the
6283
+ # `InvokeWithResponseStream` API operation. The maximum response
6284
+ # payload size is 20 MB, however, you can [request a quota
6285
+ # increase][1].
6286
+ #
6287
+ #
6288
+ #
6289
+ # [1]: https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html
6290
+ #
6005
6291
  # @return [Types::UpdateFunctionUrlConfigResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
6006
6292
  #
6007
6293
  # * {Types::UpdateFunctionUrlConfigResponse#function_url #function_url} => String
@@ -6010,6 +6296,7 @@ module Aws::Lambda
6010
6296
  # * {Types::UpdateFunctionUrlConfigResponse#cors #cors} => Types::Cors
6011
6297
  # * {Types::UpdateFunctionUrlConfigResponse#creation_time #creation_time} => Time
6012
6298
  # * {Types::UpdateFunctionUrlConfigResponse#last_modified_time #last_modified_time} => Time
6299
+ # * {Types::UpdateFunctionUrlConfigResponse#invoke_mode #invoke_mode} => String
6013
6300
  #
6014
6301
  # @example Request syntax with placeholder values
6015
6302
  #
@@ -6025,6 +6312,7 @@ module Aws::Lambda
6025
6312
  # expose_headers: ["Header"],
6026
6313
  # max_age: 1,
6027
6314
  # },
6315
+ # invoke_mode: "BUFFERED", # accepts BUFFERED, RESPONSE_STREAM
6028
6316
  # })
6029
6317
  #
6030
6318
  # @example Response structure
@@ -6044,6 +6332,7 @@ module Aws::Lambda
6044
6332
  # resp.cors.max_age #=> Integer
6045
6333
  # resp.creation_time #=> Time
6046
6334
  # resp.last_modified_time #=> Time
6335
+ # resp.invoke_mode #=> String, one of "BUFFERED", "RESPONSE_STREAM"
6047
6336
  #
6048
6337
  # @see http://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UpdateFunctionUrlConfig AWS API Documentation
6049
6338
  #
@@ -6067,7 +6356,7 @@ module Aws::Lambda
6067
6356
  params: params,
6068
6357
  config: config)
6069
6358
  context[:gem_name] = 'aws-sdk-lambda'
6070
- context[:gem_version] = '1.92.0'
6359
+ context[:gem_version] = '1.93.0'
6071
6360
  Seahorse::Client::Request.new(handlers, context)
6072
6361
  end
6073
6362