-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathlambda.aws.txt
5195 lines (4180 loc) · 304 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 ==> #2025-03-17
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|Python|Java|Ruby|DotNet, Custom|Deno
#Environment: memory, CPU, envvar, /tmp, EFS, VPC, logging, insights
#Invoke: instance, sync|async, dry, streaming, URL, destination, mock, test event
#Event source: batch size|duration, filters, concurrency
#Errors: timeout, retries, dead letter, tracing, recursion
#Concurrency: total, reserved, provisioned
#API Gateway, Step Functions, EventBridge, local
┌─────────┐
│ 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
┌──────────┐
│ AUTH │
└──────────┘
Lambda_FullAccess #AWS managed POLICY. Grants all Lambda PACTIONs
#Also related IAM, CloudFormation, CloudWatch Metrics|Logs, X-Ray, StateMachine, EC2, KMS 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 6e4 seconds (~17h) 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
KAFKA PROVISIONED POLLERS ==> #~34$/month (min 1h) per poller
#Proportional to duration
#Priced per group of 4 pollers (EPU , "Event Poller Unit")
#Free if EVENT_SOURCE.ProvisionedPollerConfig not set
SNAPSTART ==> #4$/month (min 3h) per FUNC_VERSION, with MemorySize 1GB
#1$ per 7e3 FUNC_INSTANCEs, with MemorySize 1GB
#In both cases, price is proportional to duration + MemorySize
#Free with Java
/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
┌─────────────┐
│ METRICS │
└─────────────┘
DVAR FunctionName #'FUNCTION'. Available with all CloudWatch METRICs
#FUNCTION is also sent as a metric TELEMETRY_ENTITY
DVAR Resource #'FUNCTION:QUALIFIER'. Available with all CloudWatch METRICs
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
CFACADE.monitorLambda
(CXMONITORING_OPTS) #See cdk-monitoring-constructs doc
CXMONITORING_OPTS.lambdaFunction #ICANYFUNC
METRIC_ATTRS['Lambda.Function'] #'FUNCTION'
┌──────────────────────┐
│ 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
┌──────────────────────────┐
│ ACCOUNT SETTINGS API │
└──────────────────────────┘
GET /account-settings #Req: empty
GetAccountSettings() #Res: ACCOUNT_SETTINGS
┌──────────────┐
│ FUNCTION │
└──────────────┘
FUNCTION #AWS Lambda function, including all its FUNC_VERSIONs
FUNCTION.Configuration #FUNC_VERSION
FUNC_VERSION #FUNCTION's specific version
#WAIT (GetFunction(), every 1s, timeout 20s) 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
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(), every 1s, timeout 5m) 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(), every 1s, timeout 5m) FunctionUpdatedV2: when 'Successful'
FUNC_VERSION
.LastUpdateStatusReason #STR
FUNC_VERSION
.LastUpdateStatusReasonCode #STR
┌──────────────────┐
│ FUNCTION API │
└──────────────────┘
POST /functions #Req: NEW_FUNC_VERSION
CreateFunction() # - no RevisionId
# - also Tags
#Res: FUNC_VERSION
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 CLI │
└──────────────────┘
CLI wizard 'new-function' #For CreateFunction()
┌──────────────────┐
│ FUNCTION IAC │
└──────────────────┘
AWS::Lambda::Function #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.Description
#Can use CDK --hotswap
┌──────────────────┐
│ FUNCTION SAM │
└──────────────────┘
AWS::Serverless::Function #Expands to Lambda FUNCTION and its ROLE
#Optionally, expands to Lambda:
# - FUNC_VERSION
# - ALIAS
# - FUNC_URL
# - EVENT_INVOKE
#Optionally, also to:
# - SQS QUEUE
# - SNS TOPIC
# - CodeDeploy APPLICATION, DEPLOYMENT_GROUP, ROLE
#Optionally, also to TRIGGERs:
# - Lambda EVENT_SOURCE
# - API Gateway INTEGRATION (and API, RESOURCE, METHOD, REQVALID)
# - S3 NOTIFICATIONS
# - CloudWatch Logs SUBSCRIPTION
# - SNS SUBSCRIPTION
# - EventBridge RULE
# - EventBridge SCHEDULE
# - IoT TOPIC_RULE
#Missing features:
# - ALIAS.RoutingConfig
# - RESOURCE-specific tags
#Includes RESPROPs:
# - Description
# - VersionDescription
# - only if RESPROP AutoPublishAlias set
┌───────────────────────┐
│ FUNCTION COMPOSER │
└───────────────────────┘
FUNCTION ENHANCED COMPONENT ==> #For AWS::Serverless::Function
#Optionally, also Application AutoScaling SCALING_POLICY + SCALABLE_TARGET
#Can "export to Infrastructure Composer" from Lambda UI
# - this creates a TEMPLATE using the FUNCTION's RESPROPs
#Not in "console mode"
┌──────────────────────┐
│ FUNCTION TOOLKIT │
└──────────────────────┘
DELETE FUNCTION ==> #Can be done from "Explorer"
┌────────────────────────────┐
│ FUNCTION SINGLETON IAC │
└────────────────────────────┘
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()|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 #Must be used instead of ICANYFUNC.node, so it works with CSINGLETON_FUNC
CSINGLETON_FUNC
.addDependency|addMetadata(...) #Must be used instead of CFUNCTION.node.addDependency|addMetadata(...), so it works with CSINGLETON_FUNC
CSINGLETON_FUNC
.dependOn(CONSTRUCT) #Inverse of addDependency()
┌─────────────────────┐
│ FUNCTION PULUMI │
└─────────────────────┘
NEW_FUNC_VERSION #FUNCTION|[NEW_]FUNC_VERSION are merged
#Can use skipDestroy
┌─────────────────┐
│ 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'
FUNC_VERSION.RevisionId #'REVISION_ID' (see aws_network doc)
FUNC_VERSION.CodeSha256 #STR. SHA256 checksum
#Can be used with a similar purpose
┌─────────────────────┐
│ IDENTIFIERS IAC │
└─────────────────────┘
AWS::Lambda::Function #Includes RESPROPs: FunctionName
#Includes RESATTRs: Arn
AWS::Lambda::Version #Includes RESPROPs: CodeSha256
ICANYFUNC.functionArn #FUNC_VERSION_ARN
ICANYFUNC.functionName
ICFUNCTION_OPTS.functionName #'FUNCTION'
CFUNC_VERSION_OPTS.codeSha256 #FUNC_VERSION.*
┌─────────────────────┐
│ IDENTIFIERS SAM │
└─────────────────────┘
AWS::Serverless::Function #Includes RESPROPs:
# - FunctionName
# - AutoPublishCodeSha256: FUNC_VERSION.CodeSha256
# - only if RESPROP AutoPublishAlias set
#Includes RESATTRs: Arn
┌─────────────────┐
│ LAMBDA@EDGE │
└─────────────────┘
FUNC_VERSION.MasterArn #Main FUNC_VERSION_ARN
#Cannot use VERSION_NUM '$LATEST'
#Cannot use FUNC_VERSION.Environment.Variables
┌─────────────────────┐
│ LAMBDA@EDGE IAC │
└─────────────────────┘
ICFUNC_VERSION.edgeArn #FUNC_VERSION_ARN. FUNC_VERSION.MasterArn
CFUNC_VERSION.edgeArn #Same but as 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 │
└─────────────┘
NEW_FUNC_VERSION.Publish #BOOL (def: false)
#Whether should also call PublishVersion()
#WAIT (GetFunctionConfiguration(), every 5s, timeout 26m) PublishedVersionActive: when published
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'
$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
┌─────────────────┐
│ VERSION API │
└─────────────────┘
POST /functions/SHORT_FUNC_ARN #Req: FUNC_VERSION
/versions # - only RevisionId, CodeSha256, Description
PublishVersion() #Res: FUNC_VERSION
#Not logged by CloudTrail
┌─────────────────┐
│ VERSION IAC │
└─────────────────┘
AWS::Lambda::Function
new Function(...CARGS, OPTS) #Represents FUNCTION + $LATEST FUNC_VERSION (not a specific VERSION_NUM)
#Can use CDK --hotswap
AWS::Lambda::Version #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
#With Cloud Control, cannot update (replace only)
new Version(...CARGS, OPTS) #CFUNC_VERSION. CKRESOURCE wrapping FUNC_VERSION
#Not for $LATEST (except when using ICANYFUNC.latestVersion)
#Inherits CANYFUNC
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::Version: 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
FFLAG @aws-cdk/aws-lambda: #If true (recommended): only consider known FUNCTION RESPROPs
recognizeVersionProps #Must set to false if using RESPROPs not known to CDK
┌─────────────────┐
│ VERSION SAM │
└─────────────────┘
AWS::Serverless::Function #Includes RESPROPs:
# - AutoPublishAlias 'ALIAS' (def: none)
# - creates FUNC_VERSION:
# - 'RESOURCE' is 'FUNCTIONVersionHASH', 'SAM_RESOURCE' is 'FUNCTION.Version'
# - RESOURCE.DeletionPolicy 'Retain'
# - AutoPublishAliasAllProperties BOOL:
# - skip creating a FUNC_VERSION if none of the following AWS::Serverless::Function RESPROPs changed:
# - false (def): *Code*, ImageUri, Environment, MemorySize, SnapStart, AutoPublishCodeSha256
# - true: any
# - only if AutoPublishAlias set
HOT RELOADING ==> #Supported by:
# - `sam sync` (see its doc)
# - contents is cached using:
# - PackageType Zip: zip file
# - also does an API call to check FUNC_VERSION.CodeSha256
# - PackageType Image: local IMAGE hash
# - CDK: FUNC[_VERSION].Code|Environment|Description, ALIAS.FunctionVersion
┌─────────────────────┐
│ VERSION METRICS │
└─────────────────────┘
DVAR ExecutedVersion #VERSION_NUM. Available with all CloudWatch METRICs
┌───────────┐
│ ALIAS │
└───────────┘
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, i.e. meant for transitioning between 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'
┌───────────────┐
│ ALIAS API │
└───────────────┘
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 IAC │
└───────────────┘
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
#Can use CDK --hotswap
ICALIAS.lambda #ICFUNCTION
OPTS.description #ALIAS.*
OPTS.additionalVersions #OBJ_ARR: version ICFUNC_VERSION, weight NUM. ALIAS.RoutingConfig.AdditionalVersionWeights
┌───────────────┐
│ ALIAS SAM │
└───────────────┘
AWS::Serverless::Function #Includes RESPROPs: AutoPublishAlias 'ALIAS' (def: none)
# - creates ALIAS: 'RESOURCE' is 'FUNCTIONAliasALIAS', 'SAM_RESOURCE' is 'FUNCTION.Alias'
┌──────────┐
│ 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
#Can use `aws cloudformation package`
#Can use `sam package`:
# - value must be 'DIR' (not 'PATH.zip')
# - S3 'OBJECT' name is hash of all contents + filenames
# - with `sam build`: should be 'PATH', not S3 'URL'
┌──────────────┐
│ CODE IAC │
└──────────────┘
AWS::Lambda::Function #Includes RESPROPs: PackageType, Code
CFUNCTION_OPTS.code #CCODE. FUNCTION.Code|ImageConfig
#Can use CDK --hotswap
┌──────────────┐
│ CODE SAM │
└──────────────┘
AWS::Serverless::Function #Includes RESPROPs: PackageType
┌─────────────────┐
│ CODE PULUMI │
└─────────────────┘
NEW_FUNC_VERSION.Code #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"
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
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
ACCOUNT_LIMIT.CodeSizeUnzipped #NUM (in bytes). Max size when extracting a single FUNCTION|LAYER's .zip archive (with|without S3)
#Max 250MB
#In UI, also max 3MB per file
[NEW_]FUNC_CODE.SourceKMSKeyArn #AWS KMS key ARN. Encrypt .zip file at rest
#Def: automatically created
FUNC_VERSION.KMSKeyArn #See below. Encrypt files after being unzipped
┌─────────────────┐
│ CODE ZIP UI │
└─────────────────┘
BLUEPRINT ==> #Sample NEW_FUNC_CODE.ZipFile for a given Runtime.
#Only available through the UI
EDITOR ==> #VSCode is available to edit files in UI
┌───────────────────┐
│ CODE ZIP AUTH │
└───────────────────┘
kms:Decrypt|GenerateDataKey #If custom NEW_FUNC_CODE.SourceKMSKeyArn, must be allowed
# - on KMS KEY
# - for SERVICE lambda.amazonaws.com
# - COND_KEY kms:EncryptionContext:aws:lambda:FunctionArn FUNC_ARN
┌──────────────────┐
│ CODE ZIP SDK │
└──────────────────┘
NEW_FUNC_CODE.ZipFile #INPUT_BLOB
┌──────────────────┐
│ CODE ZIP CLI │
└──────────────────┘
NEW_FUNC_CODE.ZipFile #FILE
┌──────────────────┐
│ CODE ZIP IAC │
└──────────────────┘
AWS::Lambda::Function #Includes RESPROPs: Code: ZipFile, S3Bucket, S3Key, S3ObjectVersion, SourceKMSKeyArn
Code.fromInline(STR)->CCODE #NEW_FUNC_CODE.ZipFile
Code.fromBucketV2
(ICBUCKET, 'OBJECT[, OPTS])
->CCODE #NEW_FUNC_CODE.S3Bucket|S3Key|S3ObjectVersion|sourceKMSKey, as direct values
OPTS.objectVersion #'VERSION_ID'. NEW_FUNC_CODE.S3ObjectVersion
OPTS.sourceKMSKey #IKMS_KEY. NEW_FUNC_CODE.sourceKMSKey
Code.fromCfnParameters
([OPTS])->CCODE #NEW_FUNC_CODE.S3Bucket|S3Key|sourceKMSKey, as STACK PARAMs
OPTS.bucketNameParam #CPARAM (def: new one). NEW_FUNC_CODE.S3Bucket
OPTS.objectKeyParam #CPARAM (def: new one). NEW_FUNC_CODE.S3Key
OPTS.sourceKMSKey #IKMS_KEY. NEW_FUNC_CODE.sourceKMSKey
CPARAM
.bucketNameParam|objectKeyParam #CPARAM_LID
CPARAM.assign(S3_CLOCATION)->OBJ #Keys: CPARAM_LID, values: S3_CLOCATION.bucketName|objectKey
Code.fromAsset('PATH'[, OPTS]) #NEW_FUNC_CODE.S3Bucket|S3Key|sourceKMSKey, as local DIR|archive
->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 OPTS.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 OPTS.bundling used)
OPTS.sourceKMSKey #IKMS_KEY. NEW_FUNC_CODE.sourceKMSKey
OPTS.* #HFOPTS.*
Code.fromCustomCommand
('PATH', STR_ARR[, OPTS])->CCOPTS#Like Code.fromAsset() but first calls child_process.spawnSync(...STR_ARR, OPTS.commandOptions)
Code.fromDockerBuild #Like Code.fromAsset() but first:
('PATH'[, OPTS])->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 ZIP SAM │
└──────────────────┘
AWS::Serverless::Function #Includes RESPROPs:
# - InlineCode STR: NEW_FUNC_CODE.ZipFile
# - if set, `sam package` is noop
# - CodeUri S3 'URI' or OBJ: Bucket|Key|Version
# - can use `aws cloudformation package`
# - can use `sam package` (same comments as AWS::Lambda::Function)
# - SourceKMSKeyArn
┌───────────────────┐
│ CODE ZIP LINT │
└───────────────────┘
cfn-lint E3678 #If NEW_FUNC_CODE.ZipFile set, validate Runtime is specified
cfn-lint E3677 #If NEW_FUNC_CODE.ZipFile set, validate Runtime is node|python
┌──────────────────────┐
│ CODE ZIP TOOLKIT │
└──────────────────────┘
UPLOAD CODE ==> #Can be done as a command, using .zip or DIR
DOWNLOAD CODE ==> #Can be done from "Explorer"
┌────────────────┐
│ 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
[NEW_]FUNC_CODE.ImageUri #'URI' to the container image in AWS ECR
#Can use `sam package` (not `aws cloudformation package`)
FUNC_CODE.ResolvedImageUri #'URI' to the container image, after optimization, used internally by API
#API optimizes image after upload, for performance
FUNC_VERSION.KMSKeyArn #See below. Encrypts FUNC_CODE.ResolvedImageUri (not ImageUri)
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 (called "AWS [managed] base image for Lambda")
RUNTIME[:VERSION[-ARCH]] #Follow every constraint, including implementing the custom runtime API
#Exposes following ENVVARs: LAMBDA_TASK_ROOT, LAMBDA_RUNTIME_DIR
#RUNTIME can be "provided" (called "OS-only base image")
┌────────────────────┐
│ CODE IMAGE IAC │
└────────────────────┘
AWS::Lambda::Function #Includes RESPROPs: ImageConfig, Code: ImageUri
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 + FUNC_VERSION.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 + FUNC_VERSION.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.*
┌────────────────────┐
│ CODE IMAGE SAM │
└────────────────────┘
AWS::Serverless::Function #Includes RESPROPs: ImageUri, ImageConfig
┌────────────────┐
│ LAYER MAIN │
└────────────────┘
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 MAIN API │
└────────────────────┘
GET /layers #Req: LAYER_VERSION
ListLayers() # - only CompatibleRuntime, CompatibleArchitecture
#Res: Layers LAYER_ARR
# - no LatestMatchingVersion.Content
┌───────────────────┐
│ LAYER VERSION │
└───────────────────┘
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
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
#Can use `aws cloudformation package`
#Can use `sam package`:
# - value must be 'DIR' (not 'PATH.zip')
# - S3 'OBJECT' name is hash of all contents + filenames
# - with `sam build`: should be 'PATH', not S3 'URL'
LAYER_VERSION_INPUT.ZipFile|S3* #Like NEW_FUNC_CODE.*
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|...
/bin
/lib #Preferred location for LAYERs shared binaries|libraries
┌────────────────────────┐
│ LAYER VERSION AUTH │
└────────────────────────┘
COND_KEY lambda:Layer #LAYER_VERSION_ARN_ARR. Only with CreateFunction|UpdateFunctionConfiguration()
┌───────────────────────┐
│ LAYER VERSION API │
└───────────────────────┘
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 IAC │
└───────────────────────┘
AWS::Lambda::LayerVersion #RESPROPs:
# - LayerName 'LAYER'|LAYER_ARN
# - Description, LicenseInfo
# - Content LAYER_CONTENT_INPUT (no ZipFile)
#RESATTRs: LayerVersionArn
#With Cloud Control, cannot update (replace only)
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