-
Notifications
You must be signed in to change notification settings - Fork 16
/
lambda.aws.txt
3233 lines (2570 loc) · 179 KB
/
lambda.aws.txt
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
LAMBDA
VERSION ==> #2023-12-06
SUMMARY ==> #Functions: versions, aliases, alias routing, singleton
#Main code: zip (upload|S3) or container, sign, esbuild
#Additional code: layer, internal|external extension
#Runtimes: versions|upgrades, custom, options, Node|Go|Python|Java|Ruby|DotNet, Custom|Deno
#Environment: CPU, memory, envvar, /tmp, EFS, VPC, logging, insights
#Invoke: instance, sync|async, dry, streaming, URL, destination
#Event source: batch size|duration, filters, concurrency
#Errors: timeout, retries, dead letter, tracing
#Concurrency: total, reserved, provisioned
/=+===============================+=\
/ : : \
)==: API :==(
\ :_______________________________: /
\=+===============================+=/
AWS_DOMAIN #'amazonaws.com' or 'api.aws'
FORMAT ==> #Request: REST methods|routes, JSON
#Response: JSON
#Paths all start with ACTION-specific version /YYYY-MM-DD
REQ_ID #x-amzn-request-id [S]
PAGINATION ==> #Req: Marker STR, MaxItems STR (def|max: 1e4)
#Res: NextMarker STR
THROTTLING ==> #Max 15 requests per second, except:
# - GetFunction(): 100 requests per second
# - Invoke(): no limits
Lambda_FullAccess #AWS managed POLICY. Grants all Lambda PACTIONs
Lambda_ReadOnlyAccess #Same but readonly
/=+===============================+=\
/ : : \
)==: PRICING :==(
\ :_______________________________: /
\=+===============================+=/
SUMMARY ==> #Most of the price is proportional to:
# - total duration of INVOCATIONs, especially if INVOCATION duration >15ms
# - number of INVOCATIONs, especially if INVOCATION duration <15ms
# - MemorySize
#Free: 1 INVOCATION per 3s, with 400ms INVOCATION duration, MemorySize 1GB
#Provisioned CONCURRENCY:
# - cheap for FUNC_INSTANCEs run >60% of the time
# - otherwise, quite expensive
#/tmp is cheap
#Use ARM because cheaper
INVOCATIONS ==> #1$ per 5e6 INVOCATIONs
#Free: first 1e6 INVOCATIONs, per month (~1 per 3s)
DURATION ==> #Amount of time spent running FUNCTION|extensions
# - includes initialization, INVOCATIONs and shutdown
# - does not include time frozen, i.e. between INVOCATIONs
# - each INVOCATION's duration is rounded up to 1ms
#1$ per 7.5e3 seconds (~21h) with MemorySize 1GB
# - price is proportional to duration + MemorySize
#Free: 4e5 seconds (~4.5 days) with MemorySize 1GB, per month
#I.e. same price as INVOCATION cost if:
# - 400ms per INVOCATION, with 1GB (in free tier)
# - 15ms per INVOCATION, with 1GB (out of free tier)
#25% more expensive with x86_64
#High duration discount:
# - 10% cheaper over 7.5e9 seconds, with MemorySize 1GB, per month (~3000 FUNC_INSTANCEs fulltime)
# - 20% cheaper over 11.25e9 seconds, with MemorySize 1GB, per month (~7000 FUNC_INSTANCEs fulltime)
PROVISIONED CONCURRENCY ==> #9$ per month, per provisioned CONCURRENCY, with MemorySize 1GB
#Price is proportional to:
# - MemorySize
# - provisioned CONCURRENCY
# - percentage of time it was enabled
# - but not proportional to INVOCATIONs duration
#Impacts INVOCATIONs duration price:
# - 40% cheaper
# - no free tier, nor high duration discount
#Free: none
#Provisioning the CONCURRENCY of a FUNC_INSTANCE can be less|more expensive,
#depending on how much it runs (excuding free tier):
# - 100% of the time: 15% cheaper
# - 60% of the time: same price
# - 30% of the time: 40% more expensive
# - 10% of the time: 2x more expensive
# - 1% of the time: 25x more expensive
#I.e. possible scenarios for a given FUNC_INSTANCE
# - high-utilization: cheaper
# - low-utilization: high fixed cost, in exchange for high latency
/TMP ==> #1$ per 3e7 seconds (~1 year) with EphemeralStorage.Size 1GB
#Price is proportional to Size + total duration (for all INVOCATIONs)
#I.e. when MemorySize === EphemeralStorage.Size, /tmp is 4000 times cheaper than RAM
#Free: none
CODE STORAGE ==> #Free
FUNCTION VERSIONS COUNT ==> #Free
STREAMING DATA TRANSFER ==> #1$/125GB. Free: 6MB
OTHER DATA TRANSFER ==> #Same as EC2
/=+===============================+=\
/ : : \
)==: METRIC CDK :==(
\ :_______________________________: /
\=+===============================+=/
Function.metricAll
('METRIC'[, CMETRIC_OPTS]) #Like new Metric() but sets CMETRIC_OPTS.namespace|metricName
->CMETRIC #Not with CFUNC_VERSION|CALIAS
Function.metricAllMETRIC
([CMETRIC_OPTS])->CMETRIC #Same but also sets CMETRIC_OPTS.statistic
/=+===============================+=\
/ : : \
)==: ACCOUNT SETTINGS :==(
\ :_______________________________: /
\=+===============================+=/
GET /account-settings #Req: empty
GetAccountSettings() #Res: ACCOUNT_SETTINGS
ACCOUNT_SETTINGS #AWS account settings for Lambda
#Not logged by CloudTrail
ACCOUNT_SETTINGS.AccountLimit #ACCOUNT_LIMIT. Maximum limits
ACCOUNT_SETTINGS.AccountUsage #ACCOUNT_USAGE. Current usage
ACCOUNT_USAGE.FunctionCount #NUM. Number of FUNCTIONs
/=+===============================+=\
/ : : \
)==: FUNCTION :==(
\ :_______________________________: /
\=+===============================+=/
POST /functions #Req: NEW_FUNC_VERSION
CreateFunction() # - no RevisionId
# - also Tags
#Res: FUNC_VERSION
#CLI wizard "new-function"
PUT /functions/SHORT_FUNC_ARN #Req: NEW_FUNC_VERSION
/configuration # - no Architectures, PackageType, CodeSigningConfigArn, Publish, Code
UpdateFunctionConfiguration() #Res: FUNC_VERSION
PUT /functions/SHORT_FUNC_ARN #Req: NEW_FUNC_CODE
/code # - also RevisionId|Architectures: like FUNC_VERSION
UpdateFunctionCode() # - also Publish: like NEW_FUNC_VERSION.*
# - DryRun BOOL (def: false)
#Res: FUNC_VERSION
GET /functions
/SHORT_FUNC_VERSION_ARN
/configuration #Req: empty
GetFunctionConfiguration() #Res: FUNC_VERSION
GET /functions
/SHORT_FUNC_VERSION_ARN #Req: empty
GetFunction() #Res: FUNCTION
GET /functions #Req:
ListFunctions() # - FunctionVersion 'ALL': all FUNC_VERSIONs instead of only latest
# - MasterRegion STR: AWS region of FUNC_VERSION.MasterArn
#Res: Functions FUNC_VERSION_ARR
GET /functions/SHORT_FUNC_ARN #Req: FUNC_VERSION
/versions # - only FunctionName
ListVersionsByFunction() #Res: Versions FUNC_VERSION_ARR
DELETE /functions #Req: empty
/SHORT_FUNC_VERSION_ARN #Res: empty
DeleteFunction() #Cannot use an ALIAS_ARN
#If not specifying a VERSION_NUM, deletes FUNCTION + all FUNC_VERSIONs
FUNCTION #AWS Lambda function, including all its FUNC_VERSIONs
FUNCTION.Configuration #FUNC_VERSION
FUNC_VERSION #FUNCTION's specific version
#WAIT (GetFunction()) FunctionExists: when it exists
NEW_FUNC_VERSION #Like FUNC_VERSION, but when being created.
# - no FunctionArn, MasterArn, CodeSha256, Version
# - no CodeSize, LastModified, LastUpdateStatus*, State*, *.Error
# - no RuntimVersionConfig, Signing*, SnapStart.OptimizationStatus, VpcConfig.VpcId
# - Layers LAYER_VERSION_SUMMARY_ARR -> 'LAYER_VERSION_ARN'_ARR
#Also some additional fields, documented here
##With Pulumi:
## - FUNCTION|[NEW_]FUNC_VERSION are merged
## - can use skipDestroy
FUNC_VERSION.LastModified #'DATE'
FUNC_VERSION.Description #STR
FUNC_VERSION.State #STR, among:
# - 'Pending': just created, initializing VPC|EFS|...
# - 'Failed': creation failed
# - 'Active'
# - 'Inactive':
# - idle for a few weeks
# - next INVOCATION fails, but sets State to 'Pending'
#WAIT (GetFunction()) FunctionActiveV2: when 'Active'
FUNC_VERSION.StateReason #STR
FUNC_VERSION.StateReasonCode #STR
FUNC_VERSION.LastUpdateStatus #STR, among:
# - 'InProgress': just updated
# - 'Successful': last update succeeded
# - 'Failed': last update failed
#WAIT (GetFunction()) FunctionUpdatedV2: when 'Successful'
FUNC_VERSION
.LastUpdateStatusReason #STR
FUNC_VERSION
.LastUpdateStatusReasonCode #STR
POST /tags/FUNC_ARN
TagResource()
GET /tags/FUNC_ARN
ListTags()
DELETE /tags/FUNC_ARN
UntagResource() #AWS TAGS
FUNCTION.Tags #Not logged by CloudTrail
AWS::Lambda::Function #RESPROPs: Tags
#Represents FUNCTION + $LATEST FUNC_VERSION
AWS::Lambda::Function[Version] #Includes RESPROPs: Description
[I]CANYFUNC #Base CKRESOURCE inherited by CFUNCTION|CFUNC_VERSION|CALIAS
#I.e. FUNCTION + FUNC_VERSION, $LATEST or not
#In code, called `IFunction` (ICANYFUNC), `FunctionBase` (CANYFUNC)
new Function(...CARGS, OPTS) #CFUNCTION. CKRESOURCE wrapping FUNCTION + $LATEST FUNC_VERSION
#Inherits CANYFUNC
Function.fromFunctionName
(...CARGS, 'FUNCTION')
->ICFUNCTION #
Function.fromFunctionArn
(...CARGS, FUNCTION_ARN)
->ICFUNCTION #
Function.fromFunctionAttributes
(...CARGS, ICFUNCTION_OPTS)
->ICFUNCTION #
ICFUNCTION_OPTS.functionArn #'FUNCTION_ARN'
CFUNCTION_OPTS.description #FUNC_VERSION.*
/=+===============================+=\
/ : : \
)==: FUNCTION SINGLETON CDK :==(
\ :_______________________________: /
\=+===============================+=/
new SingletonLambda(...CARGS,OPTS)#CSINGLETON_FUNC. FUNCTION that is a singleton for current CSTACK
#I.e. if already exists, re-use it instead of creating it
#Wraps an underlying CFUNCTION
# - can use all CFUNCTION[_OPTS].*
# - except CFUNCTION.deadLetter*|timeout|invalidateVersionBasedOn()|addVersion()|addAlias()
# - i.e. can be used as if it was a CFUNCTION
OPTS.uuid #STR. Machine-friendly ID, used for uniqueness
OPTS.lambdaPurpose #STR (def: 'SingletonLambda'). Human-friendly ID, prepended to OPTS.uuid, i.e. also used for uniqueness
ICANYFUNC.permissionsNode #Same as ICANYFUNC.node, but must be used so it works with CSINGLETON_FUNC
CSINGLETON_FUNC
.addDependency(DEPENDABLE,...) #Same as CFUNCTION.node.addDependency(...), but must be used instead with CSINGLETON_FUNC
CSINGLETON_FUNC
.dependOn(CONSTRUCT) #Inverse of addDependency()
/=+===============================+=\
/ : : \
)==: IDENTIFIERS :==(
\ :_______________________________: /
\=+===============================+=/
FUNC_VERSION.FunctionArn #FUNC_ARN. 'arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTION'
SHORT_FUNC_ARN #'[[arn:aws:lambda:REGION:]ACCOUNT_ID:function:]FUNCTION'
FUNC_VERSION.FunctionName #'FUNCTION'
ENVVAR AWS_LAMBDA_FUNCTION_NAME #'FUNCTION'
QUALIFIER #'VERSION_NUM|ALIAS'
[SHORT_]FUNC_VERSION_ARN #'[SHORT_]FUNC_ARN[:QUALIFIER]'
#"Qualified|unqualified ARN": whether QUALIFIER is used
#When [SHORT_]FUNC_VERSION_ARN is in URL path, QUALIFIER can always be specified either:
# - as ':QUALIFIER' suffix to the ARN
# - as ?Qualifier query parameter
#Def QUALIFIER: '$LATEST'
DVAR FunctionName #'FUNCTION'. Available with all CloudWatch METRICs
DVAR Resource #'FUNCTION:QUALIFIER'. Available with all CloudWatch METRICs
REVISION_ID #Changes each time a specific FUNC_VERSION|ALIAS|PERMISSION is updated
#Meant to pass current one to an update call so it fails if there is a concurrent update
FUNC_VERSION.RevisionId #'REVISION_ID'
FUNC_VERSION.CodeSha256 #STR. SHA256 checksum
#Can be used as a REVISION_ID
AWS::Lambda::Function #Includes RESPROPs: FunctionName
#Includes RESATTRs: Arn
AWS::Lambda::FunctionVersion #Includes RESPROPs: CodeSha256
ICANYFUNC.functionArn #FUNC_VERSION_ARN
ICANYFUNC.functionName
ICFUNCTION_OPTS.functionName #'FUNCTION'
CFUNC_VERSION_OPTS.codeSha256 #FUNC_VERSION.*
/=+===============================+=\
/ : : \
)==: LAMBDA@EDGE :==(
\ :_______________________________: /
\=+===============================+=/
FUNC_VERSION.MasterArn #Main FUNC_VERSION_ARN
#Cannot use VERSION_NUM '$LATEST'
#Cannot use FUNC_VERSION.Environment.Variables
CFUNC_VERSION.edgeArn #FUNC_VERSION_ARN, as a STR_TK. FUNC_VERSION.MasterArn
ICFUNC_VERSION.edgeArn #Same but not a STR_TK
ENV_OPTS.removeInEdge #BOOL (def: false). Must be true when using Lambda@Edge
# - which is detected based on whether CFUNC_VERSION.edgeArn is accessed
#This ensures ENVVAR is not passed
/=+===============================+=\
/ : : \
)==: VERSION :==(
\ :_______________________________: /
\=+===============================+=/
POST /functions/SHORT_FUNC_ARN #Req: FUNC_VERSION
/versions # - only RevisionId, CodeSha256, Description
PublishVersion() #Res: FUNC_VERSION
#Not logged by CloudTrail
NEW_FUNC_VERSION.Publish #BOOL (def: false)
#Whether should also call PublishVersion()
FUNC_VERSION #Created by PublishVersion() (which is similar to `git commit`)
FUNC_VERSION.Version #VERSION_NUM. Automatically incremented by PublishVersion(), starting at 1
#Similar to a git commit `hash`
ENVVAR AWS_LAMBDA_FUNCTION_VERSION#'NUM'
DVAR ExecutedVersion #VERSION_NUM. Available with all CloudWatch METRICs
$LATEST #Special VERSION_NUM
#Similar to git `HEAD`
#Default VERSION_NUM of FUNC_VERSION-specific entities|ACTIONs
#New FUNC_VERSIONs are copied from $LATEST during PublishVersion()
#Always exists, including after CreateFunction() or PublishVersion()
#UpdateFunction*() always target $LATEST
# - i.e. once published, FUNC_VERSION.* is read-only
#However other FUNC_VERSION-specific entities can still be updated for any given VERSION_NUM
# - e.g. RUNTIME_MGMT, EVENT_INVOKE, etc.
FUNCTION.* #Configuration that applies to all FUNC_VERSIONs
#As opposed to FUNC_VERSION.*, which is FUNC_VERSION-specific
#Some entities are FUNCTION-specific, i.e. URL uses [SHORT_]FUNC_ARN
#Others are FUNC_VERSION-specific, i.e. URL uses [SHORT_]FUNC_VERSION_ARN
AWS::Lambda::Function #Represents FUNCTION + $LATEST FUNC_VERSION
new Function(...CARGS, OPTS) #Never represents a FUNC_VERSION with a specific VERSION_NUM
AWS::Lambda::FunctionVersion #Represents a FUNC_VERSION with a specific VERSION_NUM (not $LATEST)
#Each create|replace calls PublishVersion()
# - i.e. usually trigger replaces by either:
# - setting RESPROP CodeSha256: published on CODE change
# - putting VERSION_NUM in RESPROP Description: published manually
#RESPROPs: FunctionName
#RESATTRs: FunctionArn, Version
/=+===============================+=\
/ : : \
)==: VERSION CDK :==(
\ :_______________________________: /
\=+===============================+=/
new Version(...CARGS, OPTS) #CFUNC_VERSION. CKRESOURCE wrapping FUNC_VERSION
#Not for $LATEST (except when using ICANYFUNC.latestVersion)
#Inherits CANYFUNC
CFUNCTION.addVersion
('CFUNC_VERSION'[,OPTS.codeSha256
[, OPTS.description
[, OPTS.provisionedConcurrent
Executions[, OPTS.*]]]])
->CFUNC_VERSION #Same but sets OPTS.lambda CFUNCTION
Version.fromVersionArn
(...CARGS, 'CFUNC_VERSION_ARN')
->ICFUNC_VERSION #
Version.fromVersionAttributes
(...CARGS, OPTS)->ICFUNC_VERSION #OPTS: version 'VERSION_NUM', lambda CFUNCTION
ICFUNC_VERSION.functionArn #FUNC_VERSION_ARN
ICFUNC_VERSION.version #'VERSION_NUM'_CSATTR. FUNC_VERSION.Version
#Like AWS::CloudFormation::FunctionVersion: incremented on RESPROP changes
ICFUNC_VERSION.qualifier #Same except undefined with ICANYFUNC.latestVersion
ICFUNC_VERSION.functionName #'FUNCTION:VERSION_NUM'
OPTS|ICFUNC_VERSION.lambda #ICFUNCTION
CFUNC_VERSION_OPTS.description #FUNC_VERSION.*
CFUNC_VERSION_OPTS.removalPolicy #REMOVAL_POLICY (def: destroy)
ICANYFUNC.latestVersion #CFUNC_VERSION with VERSION_NUM '$LATEST'
#Does not provision anything, just forward to the underlying CFUNCTION
CFUNCTION.currentVersion #CFUNC_VERSION which VERSION_NUM is incremented every time any FUNCTION RESPROP changes
#Does so by appending FUNC_VERSION_LID with 'CURRENT_HASH' (hash of FUNCTION RESPROPs)
#Not created unless CFUNCTION.currentVersion accessed
#I.e. helper over `new Version()`, automatically handling publishing new FUNC_VERSIONs
CFUNCTION_OPTS
.currentVersionOptions #CFUNC_VERSION_OPTS used with CFUNCTION.currentVersion
Function.classifyVersionProperty #Add|remove RESPROP to CURRENT_HASH, i.e. which one should publish new FUNC_VERSIONs
('RESPROP', BOOL) #Def: all RESPROPs are included
# - except non-FUNC_VERSION-specific RESPROPs: Tags, ReservedConcurrentExecutions, CodeSigningConfigArn
CFUNCTION #Add a direct value to CURRENT_HASH, i.e. any change to it would publish a new FUNC_VERSION
.invalidateVersionBasedOn(STR) #Meant for FUNCTION changes that are not in its RESPROPs, e.g. value of a SSM PARAM
#Can also be done for code change, since FUNC_CODE mostly contains URIs, not contents, except:
# - Code.fromInline(): since it uses NEW_FUNC_CODE.ZipFile, which is contents
# - Code.fromAsset(): since NEW_FUNC_CODE.S3Key includes 'FILE_HASH'
# - Code.fromBucket|fromCfnParameters(): providing 'OBJECT' includes 'FILE_HASH'
# - Code.fromDockerBuild(): since NEW_FUNC_CODE.imageUri includes 'IMAGE_TAG', which is updated when 'IMAGE_HASH' changes
FFLAG @aws-cdk/aws-lambda:
recognizeLayerVersion #If true (recommended): add any LAYER (and its RESPROPs) to CURRENT_HASH
/=+===============================+=\
/ : : \
)==: ALIAS :==(
\ :_______________________________: /
\=+===============================+=/
POST /functions/SHORT_FUNC_ARN #Req: ALIAS
/aliases # - no AliasArn, RevisionId
CreateAlias() #Res: ALIAS
PUT /functions/SHORT_FUNC_ARN #Req: ALIAS
/aliases/ALIAS # - no AliasArn
UpdateAlias() #Res: ALIAS
GET /functions/SHORT_FUNC_ARN #Req: ALIAS
/aliases/ALIAS # - only Name
GetAlias() #Res: ALIAS
GET /functions/SHORT_FUNC_ARN #Req: ALIAS
/aliases # - only FunctionVersion (def: any)
ListAliases() #Res: Aliases ALIAS_ARR
DELETE /functions/SHORT_FUNC_ARN #Req: ALIAS
/aliases/ALIAS # - only Name
DeleteAlias() #Res: empty
ALIAS #'ALIAS' pointing to a FUNC_VERSION
#Can change its target, similar to a git tag
#Not logged by CloudTrail
ALIAS.AliasArn #ALIAS_ARN. 'arn:aws:lambda:REGION:ACCOUNT_ID:function:FUNCTION:ALIAS'
ALIAS.Name #'ALIAS'
ALIAS.FunctionName #SHORT_FUNC_ARN
ALIAS.FunctionVersion #'VERSION_NUM' (required)
ALIAS.RevisionId #'REVISION_ID'
ALIAS.Description #STR
ALIAS.RoutingConfig #Route some traffic to different FUNC_VERSIONs
.AdditionalVersionWeights # - otherwise, route the rest of the traffic to current ALIAS
# - max 2 FUNC_VERSIONs
#OBJ:
# - key is 'FUNC_VERSION'
# - value is NUM from 0 to 1 (percentage)
#FUNC_VERSIONs must:
# - have same Role|DeadLetterConfig as ALIAS
# - be published
# - not be '$LATEST'
AWS::Lambda::Alias #RESPROPs: Name, FunctionName, FunctionVersion, Description, RoutingConfig
new Alias(...CARGS, OPTS) #CALIAS. CKRESOURCE wrapping ALIAS
#Inherits CANYFUNC
CFUNCTION.addAlias
('ALIAS'[, OPTS])->CALIAS #Same but sets OPTS: aliasName 'ALIAS', version CFUNCTION.currentVersion
Alias.fromAliasAttributes
(...CARGS, OPTS)->ICALIAS #OPTS: aliasName 'ALIAS', aliasVersion ICFUNC_VERSION
ICALIAS.functionArn #ALIAS_ARN. ALIAS.AliasARN
OPTS|ICALIAS.aliasName
ICALIAS.qualifier #'ALIAS'. ALIAS.Name
ICALIAS.functionName #'FUNCTION:ALIAS'
OPTS|ICALIAS.version #ICFUNC_VERSION
ICALIAS.lambda #ICFUNCTION
OPTS.description #ALIAS.*
OPTS.additionalVersions #OBJ_ARR: version ICFUNC_VERSION, weight NUM. ALIAS.RoutingConfig.AdditionalVersionWeights
/=+===============================+=\
/ : : \
)==: CODE :==(
\ :_______________________________: /
\=+===============================+=/
FUNC_VERSION.PackageType #How code is uploaded:
# - 'Zip': .zip file passed either directly or with S3 URL
# - 'Image': container image
#Also called "deployment package"
FUNCTION.Code #FUNC_CODE. Where .zip archive or container image is located
NEW_FUNC_VERSION.Code #NEW_FUNC_CODE
AWS::Lambda::Function #Includes RESPROPs: PackageType, Code
CFUNCTION_OPTS.code #CCODE. FUNCTION.Code|ImageConfig
/=+===============================+=\
/ : : \
)==: CODE PULUMI :==(
\ :_______________________________: /
\=+===============================+=/
NEW_FUNC_VERSION.Code ##With Pulumi:
## - this is an ARCHIVE, and NEW_FUNC_CODE.S3* -> FUNCTION.S3*
## - sourceCodeHash 'HASH' can be used as TRIGGER
CW.lambda.CallbackFunction ##Like Pulumi FUNCTION|[NEW_]FUNC_VERSION except for the following.
##Code is generated from a FUNC value instead of an ARCHIVE file:
## - RPROPS.code -> RPROPS.callback FUNC(...): same signature as in Node runtime
## - using NR.serializeFunction()
## - can use RPROPS.callbackFactory()->RPROPS.callback also instead
## - generated ARCHIVE includes Node modules dependencies
## - using NR.computeCodePathsWorker(OPTS)
## - can pass RPROPS.codePathOptions OPTS
## - RPROPS.handler: always '__index.handler'
## - def RPROPS.runtime: Node 16
## - if FUNC body contains a }VAL{ marked as secret, OUTPUTS.code is too
##Also, a default RPROPS.role is created:
## - available at OUTPUTS.roleInstance ROLE
## - trust policy: sts:AssumeRole for Principal.Service 'lambda.amazonaws.com'
## - attached policies: RPROPS.policies POLICY_ARN or { POLICY: POLICY_ARN, ... }
## - def: AWS managed POLICYs Lambda|CloudWatch[Events]|AmazonS3FullAccess,
## AmazonDynamoDB|AmazonSQS|AmazonKinesisFullAccess, AmazonCognitoPowerUser, AWSXrayWriteOnlyAccess
EFUNC ##Either:
## - inline FUNC: will be handled by CallbackFunction, i.e. easiest
## - CALLBACK_FUNCTION: allow passing [Callback]Function RPROPS
## - Lambda FUNCTION: allow full customization
CW.lambda.isEventHandler(VAL)
->BOOL ##True if EFUNC
CW.lambda
.createFunctionFromEventHandler
('FUNCTION', EFUNC, NCROPTS) ##If EFUNC already FUNCTION, noop.
->FUNCTION ##Otherwise, like new CallbackFunction(...) using RPROPS.callback EFUNC
/=+===============================+=\
/ : : \
)==: CODE ZIP :==(
\ :_______________________________: /
\=+===============================+=/
NEW_FUNC_CODE.ZipFile #Zip archive content, base64-encoded
#Not logged to CloudTrail
#Only with Runtime node|python
#Sometimes called "inline code"
#In CLI: FILE, in SDK: INPUT_BLOB
FUNC_CODE.Location #S3 'URI' to .zip archive
#I.e. when using ZipFile, automatically uploaded to S3, on an AWS managed ACCOUNT
#Only valid 10 minutes
NEW_FUNC_CODE.S3Bucket #STR. S3 'BUCKET' storing the .zip code
#Either:
# - no ZipFile, i.e. must specify S3 location
# - ZipFile, i.e. S3 location automatically allocated
#Can use `aws cloudformation package`
NEW_FUNC_CODE.S3Key #STR. S3 'OBJECT'
#After FUNC_VERSION updated, can delete from S3
NEW_FUNC_CODE.S3ObjectVersion #STR. S3 VERSION_ID
FUNC_CODE.RepositoryType #'S3' or undefined
FUNC_VERSION.CodeSize #NUM (in bytes). Size of the zip archive
ACCOUNT_LIMIT.TotalCodeSize #NUM (in bytes). Max size of all FUNC_VERSION|LAYER_VERSIONs .zip files on S3, per REGION.
#Max 75GB (flexible to a few TBs)
#I.e. should cleanup FUNC_VERSION|LAYER_VERSIONs.
ACCOUNT_USAGE.TotalCodeSize #NUM (in bytes). Current usage of ACCOUNT_LIMIT.TotalCodeSize
ACCOUNT_LIMIT.CodeSizeZipped #NUM (in bytes). Max size when uploading a single FUNCTION|LAYER's .zip archive (without S3)
#i.e. of NEW_FUNC_CODE|LAYER_VERSION_INPUT.ZipFile
#Max 50MB (non-UI), 3MB (UI)
ACCOUNT_LIMIT.CodeSizeUnzipped #NUM (in bytes). Max size when extracting a single FUNCTION|LAYER's .zip archive (with|without S3)
#Max 250MB
BLUEPRINT ==> #Sample NEW_FUNC_CODE.ZipFile for a given Runtime.
#Only available through the UI
/=+===============================+=\
/ : : \
)==: CODE ZIP CDK :==(
\ :_______________________________: /
\=+===============================+=/
Code.fromInline(STR)->CCODE #NEW_FUNC_CODE.ZipFile
Code.fromBucket(ICBUCKET,
'OBJECT', VERSION_ID)->CCODE #NEW_FUNC_CODE.S3Bucket|S3Key|S3ObjectVersion, as direct values
Code.fromCfnParameters
([OPTS])->CCODE #NEW_FUNC_CODE.S3Bucket|S3Key, as STACK PARAMs
OPTS.bucketNameParam #CPARAM (def: new one). NEW_FUNC_CODE.S3Bucket
OPTS.objectKeyParam #CPARAM (def: new one). NEW_FUNC_CODE.S3Key
CPARAM
.bucketNameParam|objectKeyParam #CPARAM_LID
CPARAM.assign(S3_CLOCATION)->OBJ #Keys: CPARAM_LID, values: S3_CLOCATION.bucketName|objectKey
Code.fromAsset #NEW_FUNC_CODE.S3Bucket|S3Key, as local DIR|archive
('PATH'[, HFOPTS])->CCODE #Creates a HFASSET, i.e. uploads to S3 and copies to 'TARGET_PATH' (in ASSEMBLY_DIR)
#'PATH' must be either 'DIR' or *.tar[.gz]|tgz|zip|jar
#Def HFOPTS.deployTime true, i.e. deleted from S3 after `cdk deploy`
#Automatically calls HFASSET.addResourceMetadata(), i.e. adds TEMPLATE.Resources.FUNCTION.Metadata:
# - 'aws:asset:property': 'Code' (in CFUNCTION) or 'Content' (in CLAYER_VERSION)
# - 'aws:asset:path': 'TARGET_PATH'
# - 'aws:asset:is-bundled': BOOL (whether HFOPTS.bundling used)
Code.fromDockerBuild #Like Code.fromAsset() but first:
('PATH')->CCODE # - `docker build PATH`
# - `docker cp CONTAINER_ID:PATH2 PATH3`
OPTS.imagePath #'PATH2', i.e. PATH in CONTAINER with result of `docker build`
#Def: '/asset'
OPTS.outputPath #'PATH3', i.e. local PATH with result of `docker build`
#Passed to Code.fromAsset('PATH3')
OPTS.* #Same as DockerImage.fromBuild(..., OPTS) (see CDK doc)
/=+===============================+=\
/ : : \
)==: CODE IMAGE :==(
\ :_______________________________: /
\=+===============================+=/
CONTAINER IMAGE ==> #Must follow OCI 1.0.0 specification
#Must follow Docker image manifest v2, schema 2
#Must be Linux-based
#Max 10GB uncompressed
#Must use the custom runtime API
#Must not write on the filesystem, except for /tmp
FUNC_CODE.ResolvedImageUri #'URI' to the container image
[NEW_]FUNC_CODE.ImageUri #'URI' to the container image in AWS ECR
FUNC_VERSION[.ImageConfigResponse]#IMAGE. Container image's configuration.
.ImageConfig #Max 16KB
IMAGE.EntryPoint #STR_ARR. Like Docker ENTRYPOINT
IMAGE.Command #STR_ARR. Like Docker CMD, i.e. arguments to EntryPoint
IMAGE.WorkingDirectory #STR. Like Docker WORKDIR
ENV ==> #Automatically filled by FUNC_VERSION.Environment
public.ecr.aws/lambda/ #Recommended base images
RUNTIME[-ARCH] #Follow every constraint, including implementing the custom runtime API
#Exposes following ENVVARs: LAMBDA_TASK_ROOT, LAMBDA_RUNTIME_DIR
AWS::Lambda::Function #Includes RESPROPs: ImageConfig
/=+===============================+=\
/ : : \
)==: CODE IMAGE CDK :==(
\ :_______________________________: /
\=+===============================+=/
new DockerImageFunction
(...CARGS, OPTS) #CFUNCTION with following changes
OPTS.* #Like CFUNCTION
OPTS.runtime #Always Runtime.FROM_IMAGE
OPTS.code #Must be either:
# - DockerImageCode.fromEcr(...): like Code.fromEcrImage(...)
# - DockerImageCode.fromImageAsset(...): like Code.fromAssetImage(...)
# - except HIOPTS.platform's default value uses ICFUNCTION_OPTS.architecture
Code.fromEcrImage #NEW_FUNC_CODE.ImageUri|ImageConfig, as direct values
(ECR_CREPO[, OPTS])->CCODE #Automatically allows PACTIONs to lambda.amazonaws.com:
# - ecr:GetAuthorizationToken
# - ecr:BatchCheckLayerAvailability, ecr:GetDownloadUrlForLayer, ecr:BatchGetImage
OPTS.tagOrDigest #'TAG' or 'sha256:DIGEST' (def: 'latest'), to retrieve NEW_FUNC_CODE.ImageUri
#I.e. CREPO_ARN:TAG or CREPO_ARN@DIGEST
OPTS
.cmd|entrypoint|workingDirectory #IMAGE.*
Code.fromAssetImage #NEW_FUNC_CODE.ImageUri|ImageConfig, as local DIR
('DIR', HIOPTS)->CCODE #Creates a HIASSET, i.e. `docker build`, uploads to ECR and copies to 'TARGET_PATH' (in ASSEMBLY_DIR)
#'DIR' must have a Dockerfile
#Automatically allows PACTIONs to lambda.amazonaws.com, like EcrImageCode
#Automatically calls HIASSET.addResourceMetadata(), i.e. adds TEMPLATE.Resources.FUNCTION.Metadata:
# - 'aws:asset:property': 'Code.ImageUri'
# - 'aws:asset:path': 'TARGET_PATH'
# - 'aws:asset:dockerfile-path': 'PATH'
# - 'aws:asset:docker-*': HIOPTS.* related to IASSET_NEW.docker*, but dash-case'd
OPTS
.cmd|entrypoint|workingDirectory #IMAGE.*
/=+===============================+=\
/ : : \
)==: LAYER MAIN :==(
\ :_______________________________: /
\=+===============================+=/
GET /layers #Req: LAYER_VERSION
ListLayers() # - only CompatibleRuntime, CompatibleArchitecture
#Res: Layers LAYER_ARR
# - no LatestMatchingVersion.Content
LAYER #Lambda layer, as output
#.zip archive with files shared between multiple FUNCTIONs
#E.g. libraries, custom runtime or data|config files
#Mounted at /opt
# - directories|files are merged, with last LAYER having priority
#Only if PackageType 'Zip'
#Not logged by CloudTrail
#Max 5 per FUNCTION
LAYER.LayerArn #LAYER_ARN. 'arn:aws:lambda:REGION:ACCOUNT_ID:layer:LAYER_NAME'
LAYER.LayerName #'LAYER_NAME'
/=+===============================+=\
/ : : \
)==: LAYER VERSION :==(
\ :_______________________________: /
\=+===============================+=/
POST /layers/LAYER/versions #Req: LAYER_VERSION
PublishLayerVersion() # - LayerVersionArn -> LayerName 'LAYER_NAME'|LAYER_ARN
# - no CreatedDate, Version
#Res: LAYER_VERSION
GET /layers/LAYER #Req: LAYER_VERSION
/versions/VERSION_NUM # - LayerVersionArn -> LayerName 'LAYER_NAME'|LAYER_ARN
GetLayerVersion() # - only Version -> VersionNumber
#Res: LAYER_VERSION
GET /layers #Req: LAYER_VERSION
GetLayerVersionByArn() # - LayerVersionArn -> Arn
# - only Version -> find
#Res: LAYER_VERSION
GET /layers/LAYER/versions #Req: LAYER_VERSION
ListLayerVersions() # - LayerVersionArn -> LayerName 'LAYER_NAME'|LAYER_ARN
# - only CompatibleRuntimes, CompatibleArchitectures
#Res: LayerVersions LAYER_VERSION_ARR
# - no Content
DELETE /layers/LAYER #Req: LAYER_VERSION
/versions/VERSION_NUM # - LayerVersionArn -> LayerName 'LAYER_NAME'|LAYER_ARN
DeleteLayerVersion() # - only Version -> VersionNumber
#Res: empty
LAYER_VERSION #Specific version of a LAYER
#Unlike FUNCTION versions:
# - no $LATEST, i.e. always specific version NUM
# - completely immutable
#Only PublishLayerVersion() is logged by CloudTrail
##With Pulumi, can use skipDestroy
LAYER_VERSION.LayerVersionArn #LAYER_VERSION_ARN. 'arn:aws:lambda:REGION:ACCOUNT_ID:layer:LAYER_NAME:NUM'
LAYER_VERSION.Version #NUM
LAYER_VERSION.CreatedDate #'DATE'
LAYER_VERSION.Description #STR
LAYER_VERSION.LicenseInfo #STR. Open-source license identifier
LAYER.LatestMatchingVersion #Most recent LAYER_VERSION
LAYER_VERSION.Content #In input: LAYER_CONTENT_INPUT
#In output: LAYER_CONTENT_OUTPUT
LAYER_VERSION_INPUT.ZipFile|S3* #Like NEW_FUNC_CODE.*
#Can use `aws cloudformation package`
LAYER_VERSION_OUTPUT.CodeSha256|
CodeSize|SigningJobArn|
SigningProfileVersionArn #Like FUNC_VERSION.*
LAYER_VERSION_OUTPUT.Location #Like FUNC_CODE.*
FUNC_VERSION.Layers #LAYER_VERSION_SUMMARY_ARR. Layers to associate to a FUNC_VERSION
LAYER_VERSION_SUMMARY #Like LAYER_VERSION, but fewer fields:
# - LayerVersionArn -> Arn
# - Content.CodeSize|SigningJobArn|SigningProfileVersionArn -> CodeSize|...
COND_KEY lambda:Layer #LAYER_VERSION_ARN_ARR. Only with CreateFunction|UpdateFunctionConfiguration()
/bin
/lib #Preferred location for LAYERs shared binaries|libraries
AWS::Lambda::LayerVersion #RESPROPs:
# - LayerName 'LAYER'|LAYER_ARN
# - Description, LicenseInfo
# - Content LAYER_CONTENT_INPUT (no ZipFile)
#RESATTRs: LayerVersionArn
AWS::Lambda::Function #Includes RESPROPs: Layers LAYER_VERSION_ARN_ARR
new LayerVersion(...CARGS, OPTS) #CLAYER_VERSION. CKRESOURCE wrapping LAYER_VERSION
LayerVersion.fromLayerVersionArn
(...CARGS, 'LAYER_VERSION_ARN')
->ICLAYER_VERSION #
LayerVersion
.fromLayerVersionAttributes
(...CARGS, OPTS)->ICLAYER_VERSION#OPTS: layerVersionArn, compatibleRuntimes
ICLAYER_VERSION.layerVersionArn #LAYER_VERSION.*
OPTS.layerVersionName #'LAYER'
OPTS.description
OPTS.license #LAYER_VERSION.*
OPTS.code #CCODE. Only through S3, not ZipFile nor Docker
OPTS.removalPolicy #REMOVAL_POLICY (def: delete)
CFUNCTION_OPTS.layers #ICLAYER_VERSION_ARR
CFUNCTION
.addLayers(ICLAYER_VERSION,...) #
/=+===============================+=\
/ : : \
)==: EXTENSION :==(
\ :_______________________________: /
\=+===============================+=/
/opt/extensions/FILE #"External extensions", i.e. executable run separately from the runner
# - different process than the FUNC_INSTANCE's
# - initialized|shutdown at the same time as the runner
#Either:
# - shared as LAYER, for PackageType 'Zip'
# - added manually by Dockerfile, if PackageType 'image'
#Max 10 per FUNCTION
#Only partially documented for the moment
EAPI #http://AWS_LAMBDA_RUNTIME_API/2020-01-01/extension
POST EAPI/register #Initializes
POST EAPI/init/error #Initialization error
GET EAPI/event/next #Receives next INVOCATION or Shutdown event
POST EAPI/exit/error #Exit error
TELEMETRY API ==> #Allows extensions to retrieve logs, metrics and traces related to:
# - the execution environment lifecycle|logs
# - the INVOCATIONs logs
# - the extension itself logs
#Done via HTTP|TCP webhooks
AWS/Lambda/
PostRuntimeExtensionDuration #CloudWatch METRIC with NUM of ms spent in external extension after request ended
/=+===============================+=\
/ : : \
)==: RUNTIME :==(
\ :_______________________________: /
\=+===============================+=/
FUNC_VERSION.Runtime #STR. Runtime, among:
# - 'nodejs[VERSION]' with VERSION: 14.x, 16.x, 18.x, 20.x
# - 'goVERSION' with VERSION: 1.x
# - 'pythonVERSION' with VERSION: 3.7, 3.8, 3.9, 3.10, 3.11, 3.12
# - 'javaVERSION' with VERSION: 8.al2, 11, 17, 21
# - 'rubyVERSION' with VERSION: 2.7, 3.2
# - 'dotnetcoreVERSION' with VERSION: 5.0, 6, 8
# - 'provided[VERSION]' with VERSION: .al2, .al2023
#OS:
# - Amazon Linux 1: go*, python3.7, provided (not provided.al2)
# - Amazon Linux 2: all others
# - Amazon Linux 2023: >=nodejs20.x, >=python3.12, >=java21, >=dotnetcore8
#Not if PackageType 'Image'
##With Pulumi can use CW.lambda.Runtime.NodeJS10dX|... 'nodejs10.x|...'
##cfn-lint E2531|W2531: no deprecated Lambda FUNC_VERSION.Runtime
ENVVAR AWS_EXECUTION_ENV #'AWS_Lambda_RUNTIME'
LAYER_VERSION.CompatibleRuntimes #STR_ARR among same values as FUNC_VERSION.Runtime
FUNC_VERSION.Handler #'FILE.METHOD'. Code's entry point function name
#FILE does not include '.EXT'
#Not if PackageType 'Image'
##cfn-lint W2533: FUNC_VERSION.Runtime|Handler required (unless PackageType 'Image')
ENVVAR LAMBDA_RUNTIME_DIR #Path to Runtime files, e.g. /var/runtime
ENVVAR AWS_LAMBDA_EXEC_WRAPPER #'PATH' to an executable script.
#"Wrapper script", executed instead of FUNC_VERSION.Runtime
#Script arguments are same as original Runtime
# - including argv[0], i.e. runtime binary itself
#Not with Amazon Linux 1, nor 'provided.al2'
INTERNAL EXTENSION ==> #Logic that runs inside the FUNC_INSTANCE's process
#Achieved by using ENVVAR AWS_LAMBDA_EXEC_WRAPPER
AWS::Lambda::Function #Includes RESPROPs: Runtime, Handler
AWS::Lambda::LayerVersion #Includes RESPROPs: CompatibleRuntimes
/=+===============================+=\
/ : : \
)==: RUNTIME CDK :==(
\ :_______________________________: /
\=+===============================+=/
CFUNCTION_OPTS.handler #FUNC_VERSION.*
CFUNCTION[_OPTS].runtime #CRUNTIME. FUNC_VERSION.Runtime|PackageType
Runtime.NODEJS[_*_*|LATEST]
Runtime.GO[_*_*]
Runtime.PYTHON[_*_*]
Runtime.JAVA[_*]
Runtime.RUBY[_*_*]
Runtime.DOTNET[_*]
Runtime.PROVIDED[_*] #CRUNTIME with FUNC_VERSION.PackageType 'Zip', i.e. when Runtime
Runtime.FROM_IMAGE #CRUNTIME with FUNC_VERSION.PackageType 'Image', i.e. when no Runtime
Runtime.ALL #All available CRUNTIMEs, as ARR
new Runtime
('NAME'[, FAMILY[, OPTS]]) #CRUNTIME
CRUNTIME.name #'NAME', e.g. 'nodejs20.x'
CRUNTIME.toString()->'NAME' #
CRUNTIME.family #FAMILY, i.e. RuntimeFamily ENUM NODEJS|GO|PYTHON|JAVA|RUBY|DOTNET_CORE|OTHER
CRUNTIME.runtimeEquals
(CRUNTIME2)->BOOL #
OPTS|CRUNTIME.supportsInlineCode #BOOL (def: false). Whether can use NEW_FUNC_CODE.ZipFile, i.e. whether node|python
OPTS|CRUNTIME.isVariable #BOOL (def: false). Target the latest version. Only true with node
OPTS.bundlingDockerImage #ECR 'REPO' (def: 'public.ecr.aws/sam/build-NAME')
#Docker image used when NEW_FUNC_VERSION.PackageType 'Image'
CRUNTIME.bundlingImage #DOCKER_IMAGE (see CDK doc)
ICLAYER_VERSION[_OPTS]
.compatibleRuntimes #CRUNTIME_ARR. LAYER_VERSION.*
/=+===============================+=\
/ : : \
)==: CUSTOM RUNTIME :==(
\ :_______________________________: /
\=+===============================+=/
CUSTOM RUNTIME ==> #When FUNC_VERSION.Runtime 'provided*'
#FUNC_CODE|LAYER must include an executable script at '/bootstrap', which is run
#Only partially documented for the moment
ENVVAR LAMBDA_TASK_ROOT #FUNC_CODE's 'DIR', e.g. /var/task
#Used as cwd, i.e. should change cwd to it during initialization
ENVVAR _HANDLER #FUNC_VERSION.Handler
ENVVAR AWS_LAMBDA_RUNTIME_API #'HOST:PORT' of custom runtime API
RAPI #http://AWS_LAMBDA_RUNTIME_API/2018-06-01/runtime
POST RAPI/init/error #Report error during initialization
GET RAPI/invocation/next #Get next INVOCATION_REQ
#Request body: empty
#Res: INVOCATION_REQ.Payload
POST #Set INVOCATION_RES
RAPI/invocation/REQ_ID/response #Request body: INVOCATION_RES.ResponseBody
#Res: empty
POST RAPI/invocation/REQ_ID/error #Report error during INVOCATION
/=+===============================+=\
/ : : \
)==: RUNTIME VERSION :==(
\ :_______________________________: /
\=+===============================+=/
RUNTIME_VERSION #Minor|patch version of a specific FUNC_VERSION.Runtime
PUT /functions
/SHORT_FUNC_VERSION_ARN #Req: RUNTIME_MGMT
/runtime-management-config # - RuntimeVersionArn: only if UpdateRuntimeOn 'Manual'
PutRuntimeManagementConfig() #Res: RUNTIME_MGMT
GET /functions
/SHORT_FUNC_VERSION_ARN
/runtime-management-config #Req: empty
GetRuntimeManagementConfig() #Res: RUNTIME_MGMT
RUNTIME_MGMT #How RUNTIMEs are upgraded to new RUNTIME_VERSIONs
#Not logged by CloudTrail
RUNTIME_MGMT.FunctionArn #FUNC_VERSION_ARN
RUNTIME_MGMT.UpdateRuntimeOn #STR. How RUNTIME upgrade happens, among:
# - 'Auto' (def):
# - in a first phase, only on newly created|updated FUNCTIONs
# - in a second phase, on all FUNCTIONs
# - 'FunctionUpdate': only on newly created|updated FUNCTIONs
# - 'Manual': pinned to RUNTIME_MGMT.RuntimeVersionArn
RUNTIME_MGMT
.RuntimeVersionArn
FUNC_VERSION.RuntimeVersionConfig #RUNTIME_VERSION_ARN. Runtime specific version
.RuntimeVersionArn #'arn:aws:lambda:REGION::runtime:RUNTIME_VERSION'