/
lambda.ex
5910 lines (4611 loc) · 158 KB
/
lambda.ex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
# See https://github.com/aws-beam/aws-codegen for more details.
defmodule AWS.Lambda do
@moduledoc """
Lambda
## Overview
Lambda is a compute service that lets you run code without provisioning or
managing servers.
Lambda runs your code on a high-availability compute infrastructure and performs
all of the
administration of the compute resources, including server and operating system
maintenance, capacity provisioning
and automatic scaling, code monitoring and logging. With Lambda, you can run
code for virtually any
type of application or backend service. For more information about the Lambda
service, see [What is Lambda](https://docs.aws.amazon.com/lambda/latest/dg/welcome.html) in the
**Lambda Developer Guide**.
The *Lambda API Reference* provides information about
each of the API methods, including details about the parameters in each API
request and
response.
You can use Software Development Kits (SDKs), Integrated Development Environment
(IDE) Toolkits, and command
line tools to access the API. For installation instructions, see [Tools for Amazon Web Services](http://aws.amazon.com/tools/).
For a list of Region-specific endpoints that Lambda supports,
see [Lambda endpoints and quotas
](https://docs.aws.amazon.com/general/latest/gr/lambda-service.html/) in the
*Amazon Web Services General Reference.*.
When making the API calls, you will need to
authenticate your request by providing a signature. Lambda supports signature
version 4. For more information,
see [Signature Version 4 signing process](https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)
in the
*Amazon Web Services General Reference.*.
## CA certificates
Because Amazon Web Services SDKs use the CA certificates from your computer,
changes to the certificates on the Amazon Web Services servers
can cause connection failures when you attempt to use an SDK. You can prevent
these failures by keeping your
computer's CA certificates and operating system up-to-date. If you encounter
this issue in a corporate
environment and do not manage your own computer, you might need to ask an
administrator to assist with the
update process. The following list shows minimum operating system and Java
versions:
*
Microsoft Windows versions that have updates from January 2005 or later
installed contain at least one
of the required CAs in their trust list.
*
Mac OS X 10.4 with Java for Mac OS X 10.4 Release 5 (February 2007), Mac OS X
10.5 (October 2007), and
later versions contain at least one of the required CAs in their trust list.
*
Red Hat Enterprise Linux 5 (March 2007), 6, and 7 and CentOS 5, 6, and 7 all
contain at least one of the
required CAs in their default trusted CA list.
*
Java 1.4.2_12 (May 2006), 5 Update 2 (March 2005), and all later versions,
including Java 6 (December
2006), 7, and 8, contain at least one of the required CAs in their default
trusted CA list.
When accessing the Lambda management console or Lambda API endpoints, whether
through browsers or
programmatically, you will need to ensure your client machines support any of
the following CAs:
*
Amazon Root CA 1
*
Starfield Services Root Certificate Authority - G2
*
Starfield Class 2 Certification Authority
Root certificates from the first two authorities are available from [Amazon trust services](https://www.amazontrust.com/repository/), but keeping your
computer
up-to-date is the more straightforward solution. To learn more about
ACM-provided certificates, see [Amazon Web Services Certificate Manager FAQs.](http://aws.amazon.com/certificate-manager/faqs/#certificates)
"""
alias AWS.Client
alias AWS.Request
@typedoc """
## Example:
list_functions_by_code_signing_config_response() :: %{
"FunctionArns" => list(String.t()()),
"NextMarker" => String.t()
}
"""
@type list_functions_by_code_signing_config_response() :: %{String.t() => any()}
@typedoc """
## Example:
account_usage() :: %{
"FunctionCount" => float(),
"TotalCodeSize" => float()
}
"""
@type account_usage() :: %{String.t() => any()}
@typedoc """
## Example:
function_event_invoke_config() :: %{
optional("DestinationConfig") => destination_config(),
optional("FunctionArn") => String.t(),
optional("LastModified") => non_neg_integer(),
optional("MaximumEventAgeInSeconds") => integer(),
optional("MaximumRetryAttempts") => integer()
}
"""
@type function_event_invoke_config() :: %{String.t() => any()}
@typedoc """
## Example:
list_aliases_response() :: %{
"Aliases" => list(alias_configuration()()),
"NextMarker" => String.t()
}
"""
@type list_aliases_response() :: %{String.t() => any()}
@typedoc """
## Example:
unsupported_media_type_exception() :: %{
"Type" => String.t(),
"message" => String.t()
}
"""
@type unsupported_media_type_exception() :: %{String.t() => any()}
@typedoc """
## Example:
kms_disabled_exception() :: %{
"Message" => String.t(),
"Type" => String.t()
}
"""
@type kms_disabled_exception() :: %{String.t() => any()}
@typedoc """
## Example:
list_aliases_request() :: %{
optional("FunctionVersion") => String.t(),
optional("Marker") => String.t(),
optional("MaxItems") => integer()
}
"""
@type list_aliases_request() :: %{String.t() => any()}
@typedoc """
## Example:
function_code() :: %{
"ImageUri" => String.t(),
"S3Bucket" => String.t(),
"S3Key" => String.t(),
"S3ObjectVersion" => String.t(),
"ZipFile" => binary()
}
"""
@type function_code() :: %{String.t() => any()}
@typedoc """
## Example:
invalid_security_group_id_exception() :: %{
"Message" => String.t(),
"Type" => String.t()
}
"""
@type invalid_security_group_id_exception() :: %{String.t() => any()}
@typedoc """
## Example:
update_event_source_mapping_request() :: %{
optional("BatchSize") => integer(),
optional("BisectBatchOnFunctionError") => boolean(),
optional("DestinationConfig") => destination_config(),
optional("DocumentDBEventSourceConfig") => document_db_event_source_config(),
optional("Enabled") => boolean(),
optional("FilterCriteria") => filter_criteria(),
optional("FunctionName") => String.t(),
optional("FunctionResponseTypes") => list(list(any())()),
optional("MaximumBatchingWindowInSeconds") => integer(),
optional("MaximumRecordAgeInSeconds") => integer(),
optional("MaximumRetryAttempts") => integer(),
optional("ParallelizationFactor") => integer(),
optional("ScalingConfig") => scaling_config(),
optional("SourceAccessConfigurations") => list(source_access_configuration()()),
optional("TumblingWindowInSeconds") => integer()
}
"""
@type update_event_source_mapping_request() :: %{String.t() => any()}
@typedoc """
## Example:
runtime_version_config() :: %{
"Error" => runtime_version_error(),
"RuntimeVersionArn" => String.t()
}
"""
@type runtime_version_config() :: %{String.t() => any()}
@typedoc """
## Example:
snap_start() :: %{
"ApplyOn" => list(any())
}
"""
@type snap_start() :: %{String.t() => any()}
@typedoc """
## Example:
tag_resource_request() :: %{
required("Tags") => map()
}
"""
@type tag_resource_request() :: %{String.t() => any()}
@typedoc """
## Example:
get_code_signing_config_request() :: %{}
"""
@type get_code_signing_config_request() :: %{}
@typedoc """
## Example:
remove_layer_version_permission_request() :: %{
optional("RevisionId") => String.t()
}
"""
@type remove_layer_version_permission_request() :: %{String.t() => any()}
@typedoc """
## Example:
delete_function_code_signing_config_request() :: %{}
"""
@type delete_function_code_signing_config_request() :: %{}
@typedoc """
## Example:
environment_response() :: %{
"Error" => environment_error(),
"Variables" => map()
}
"""
@type environment_response() :: %{String.t() => any()}
@typedoc """
## Example:
provisioned_concurrency_config_list_item() :: %{
"AllocatedProvisionedConcurrentExecutions" => integer(),
"AvailableProvisionedConcurrentExecutions" => integer(),
"FunctionArn" => String.t(),
"LastModified" => String.t(),
"RequestedProvisionedConcurrentExecutions" => integer(),
"Status" => list(any()),
"StatusReason" => String.t()
}
"""
@type provisioned_concurrency_config_list_item() :: %{String.t() => any()}
@typedoc """
## Example:
update_alias_request() :: %{
optional("Description") => String.t(),
optional("FunctionVersion") => String.t(),
optional("RevisionId") => String.t(),
optional("RoutingConfig") => alias_routing_configuration()
}
"""
@type update_alias_request() :: %{String.t() => any()}
@typedoc """
## Example:
list_functions_response() :: %{
"Functions" => list(function_configuration()()),
"NextMarker" => String.t()
}
"""
@type list_functions_response() :: %{String.t() => any()}
@typedoc """
## Example:
put_function_concurrency_request() :: %{
required("ReservedConcurrentExecutions") => integer()
}
"""
@type put_function_concurrency_request() :: %{String.t() => any()}
@typedoc """
## Example:
policy_length_exceeded_exception() :: %{
"Type" => String.t(),
"message" => String.t()
}
"""
@type policy_length_exceeded_exception() :: %{String.t() => any()}
@typedoc """
## Example:
list_provisioned_concurrency_configs_response() :: %{
"NextMarker" => String.t(),
"ProvisionedConcurrencyConfigs" => list(provisioned_concurrency_config_list_item()())
}
"""
@type list_provisioned_concurrency_configs_response() :: %{String.t() => any()}
@typedoc """
## Example:
list_code_signing_configs_response() :: %{
"CodeSigningConfigs" => list(code_signing_config()()),
"NextMarker" => String.t()
}
"""
@type list_code_signing_configs_response() :: %{String.t() => any()}
@typedoc """
## Example:
amazon_managed_kafka_event_source_config() :: %{
"ConsumerGroupId" => String.t()
}
"""
@type amazon_managed_kafka_event_source_config() :: %{String.t() => any()}
@typedoc """
## Example:
invoke_with_response_stream_response() :: %{
"EventStream" => list(),
"ExecutedVersion" => String.t(),
"ResponseStreamContentType" => String.t(),
"StatusCode" => integer()
}
"""
@type invoke_with_response_stream_response() :: %{String.t() => any()}
@typedoc """
## Example:
filter_criteria() :: %{
"Filters" => list(filter()())
}
"""
@type filter_criteria() :: %{String.t() => any()}
@typedoc """
## Example:
function_code_location() :: %{
"ImageUri" => String.t(),
"Location" => String.t(),
"RepositoryType" => String.t(),
"ResolvedImageUri" => String.t()
}
"""
@type function_code_location() :: %{String.t() => any()}
@typedoc """
## Example:
get_account_settings_request() :: %{}
"""
@type get_account_settings_request() :: %{}
@typedoc """
## Example:
create_alias_request() :: %{
optional("Description") => String.t(),
optional("RoutingConfig") => alias_routing_configuration(),
required("FunctionVersion") => String.t(),
required("Name") => String.t()
}
"""
@type create_alias_request() :: %{String.t() => any()}
@typedoc """
## Example:
resource_in_use_exception() :: %{
"Message" => String.t(),
"Type" => String.t()
}
"""
@type resource_in_use_exception() :: %{String.t() => any()}
@typedoc """
## Example:
get_layer_version_policy_response() :: %{
"Policy" => String.t(),
"RevisionId" => String.t()
}
"""
@type get_layer_version_policy_response() :: %{String.t() => any()}
@typedoc """
## Example:
get_account_settings_response() :: %{
"AccountLimit" => account_limit(),
"AccountUsage" => account_usage()
}
"""
@type get_account_settings_response() :: %{String.t() => any()}
@typedoc """
## Example:
get_policy_request() :: %{
optional("Qualifier") => String.t()
}
"""
@type get_policy_request() :: %{String.t() => any()}
@typedoc """
## Example:
get_layer_version_response() :: %{
optional("CompatibleArchitectures") => list(list(any())()),
optional("CompatibleRuntimes") => list(list(any())()),
optional("Content") => layer_version_content_output(),
optional("CreatedDate") => String.t(),
optional("Description") => String.t(),
optional("LayerArn") => String.t(),
optional("LayerVersionArn") => String.t(),
optional("LicenseInfo") => String.t(),
optional("Version") => float()
}
"""
@type get_layer_version_response() :: %{String.t() => any()}
@typedoc """
## Example:
put_function_event_invoke_config_request() :: %{
optional("DestinationConfig") => destination_config(),
optional("MaximumEventAgeInSeconds") => integer(),
optional("MaximumRetryAttempts") => integer(),
optional("Qualifier") => String.t()
}
"""
@type put_function_event_invoke_config_request() :: %{String.t() => any()}
@typedoc """
## Example:
invoke_async_request() :: %{
required("InvokeArgs") => binary()
}
"""
@type invoke_async_request() :: %{String.t() => any()}
@typedoc """
## Example:
list_layers_response() :: %{
"Layers" => list(layers_list_item()()),
"NextMarker" => String.t()
}
"""
@type list_layers_response() :: %{String.t() => any()}
@typedoc """
## Example:
source_access_configuration() :: %{
"Type" => list(any()),
"URI" => String.t()
}
"""
@type source_access_configuration() :: %{String.t() => any()}
@typedoc """
## Example:
get_layer_version_policy_request() :: %{}
"""
@type get_layer_version_policy_request() :: %{}
@typedoc """
## Example:
list_code_signing_configs_request() :: %{
optional("Marker") => String.t(),
optional("MaxItems") => integer()
}
"""
@type list_code_signing_configs_request() :: %{String.t() => any()}
@typedoc """
## Example:
layer_version_content_output() :: %{
"CodeSha256" => String.t(),
"CodeSize" => float(),
"Location" => String.t(),
"SigningJobArn" => String.t(),
"SigningProfileVersionArn" => String.t()
}
"""
@type layer_version_content_output() :: %{String.t() => any()}
@typedoc """
## Example:
list_tags_response() :: %{
"Tags" => map()
}
"""
@type list_tags_response() :: %{String.t() => any()}
@typedoc """
## Example:
invocation_response() :: %{
"ExecutedVersion" => String.t(),
"FunctionError" => String.t(),
"LogResult" => String.t(),
"Payload" => binary(),
"StatusCode" => integer()
}
"""
@type invocation_response() :: %{String.t() => any()}
@typedoc """
## Example:
delete_function_url_config_request() :: %{
optional("Qualifier") => String.t()
}
"""
@type delete_function_url_config_request() :: %{String.t() => any()}
@typedoc """
## Example:
ec2_access_denied_exception() :: %{
"Message" => String.t(),
"Type" => String.t()
}
"""
@type ec2_access_denied_exception() :: %{String.t() => any()}
@typedoc """
## Example:
update_function_url_config_request() :: %{
optional("AuthType") => list(any()),
optional("Cors") => cors(),
optional("InvokeMode") => list(any()),
optional("Qualifier") => String.t()
}
"""
@type update_function_url_config_request() :: %{String.t() => any()}
@typedoc """
## Example:
self_managed_kafka_event_source_config() :: %{
"ConsumerGroupId" => String.t()
}
"""
@type self_managed_kafka_event_source_config() :: %{String.t() => any()}
@typedoc """
## Example:
snap_start_not_ready_exception() :: %{
"Message" => String.t(),
"Type" => String.t()
}
"""
@type snap_start_not_ready_exception() :: %{String.t() => any()}
@typedoc """
## Example:
get_function_configuration_request() :: %{
optional("Qualifier") => String.t()
}
"""
@type get_function_configuration_request() :: %{String.t() => any()}
@typedoc """
## Example:
get_function_response() :: %{
"Code" => function_code_location(),
"Concurrency" => concurrency(),
"Configuration" => function_configuration(),
"Tags" => map()
}
"""
@type get_function_response() :: %{String.t() => any()}
@typedoc """
## Example:
logging_config() :: %{
"ApplicationLogLevel" => list(any()),
"LogFormat" => list(any()),
"LogGroup" => String.t(),
"SystemLogLevel" => list(any())
}
"""
@type logging_config() :: %{String.t() => any()}
@typedoc """
## Example:
untag_resource_request() :: %{
required("TagKeys") => list(String.t()())
}
"""
@type untag_resource_request() :: %{String.t() => any()}
@typedoc """
## Example:
delete_function_concurrency_request() :: %{}
"""
@type delete_function_concurrency_request() :: %{}
@typedoc """
## Example:
image_config() :: %{
"Command" => list(String.t()()),
"EntryPoint" => list(String.t()()),
"WorkingDirectory" => String.t()
}
"""
@type image_config() :: %{String.t() => any()}
@typedoc """
## Example:
update_function_url_config_response() :: %{
"AuthType" => list(any()),
"Cors" => cors(),
"CreationTime" => String.t(),
"FunctionArn" => String.t(),
"FunctionUrl" => String.t(),
"InvokeMode" => list(any()),
"LastModifiedTime" => String.t()
}
"""
@type update_function_url_config_response() :: %{String.t() => any()}
@typedoc """
## Example:
too_many_requests_exception() :: %{
"Reason" => list(any()),
"Type" => String.t(),
"message" => String.t(),
"retryAfterSeconds" => String.t()
}
"""
@type too_many_requests_exception() :: %{String.t() => any()}
@typedoc """
## Example:
get_function_code_signing_config_request() :: %{}
"""
@type get_function_code_signing_config_request() :: %{}
@typedoc """
## Example:
destination_config() :: %{
"OnFailure" => on_failure(),
"OnSuccess" => on_success()
}
"""
@type destination_config() :: %{String.t() => any()}
@typedoc """
## Example:
snap_start_timeout_exception() :: %{
"Message" => String.t(),
"Type" => String.t()
}
"""
@type snap_start_timeout_exception() :: %{String.t() => any()}
@typedoc """
## Example:
put_provisioned_concurrency_config_request() :: %{
required("ProvisionedConcurrentExecutions") => integer(),
required("Qualifier") => String.t()
}
"""
@type put_provisioned_concurrency_config_request() :: %{String.t() => any()}
@typedoc """
## Example:
delete_layer_version_request() :: %{}
"""
@type delete_layer_version_request() :: %{}
@typedoc """
## Example:
create_code_signing_config_response() :: %{
"CodeSigningConfig" => code_signing_config()
}
"""
@type create_code_signing_config_response() :: %{String.t() => any()}
@typedoc """
## Example:
invoke_response_stream_update() :: %{
"Payload" => binary()
}
"""
@type invoke_response_stream_update() :: %{String.t() => any()}
@typedoc """
## Example:
list_function_event_invoke_configs_response() :: %{
"FunctionEventInvokeConfigs" => list(function_event_invoke_config()()),
"NextMarker" => String.t()
}
"""
@type list_function_event_invoke_configs_response() :: %{String.t() => any()}
@typedoc """
## Example:
get_function_concurrency_response() :: %{
"ReservedConcurrentExecutions" => integer()
}
"""
@type get_function_concurrency_response() :: %{String.t() => any()}
@typedoc """
## Example:
delete_event_source_mapping_request() :: %{}
"""
@type delete_event_source_mapping_request() :: %{}
@typedoc """
## Example:
recursive_invocation_exception() :: %{
"Message" => String.t(),
"Type" => String.t()
}
"""
@type recursive_invocation_exception() :: %{String.t() => any()}
@typedoc """
## Example:
invalid_runtime_exception() :: %{
"Message" => String.t(),
"Type" => String.t()
}
"""
@type invalid_runtime_exception() :: %{String.t() => any()}
@typedoc """
## Example:
get_function_concurrency_request() :: %{}
"""
@type get_function_concurrency_request() :: %{}
@typedoc """
## Example:
get_alias_request() :: %{}
"""
@type get_alias_request() :: %{}
@typedoc """
## Example:
on_failure() :: %{
"Destination" => String.t()
}
"""
@type on_failure() :: %{String.t() => any()}
@typedoc """
## Example:
list_event_source_mappings_response() :: %{
"EventSourceMappings" => list(event_source_mapping_configuration()()),
"NextMarker" => String.t()
}
"""
@type list_event_source_mappings_response() :: %{String.t() => any()}
@typedoc """
## Example:
get_runtime_management_config_request() :: %{
optional("Qualifier") => String.t()
}
"""