17
17
)
18
18
19
19
PROPERTIES_STEM = "sam-resource-function"
20
+ DEPLOYMENT_PREFERENCE_STEM = "sam-property-function-deploymentpreference"
20
21
21
22
alexaskilleventproperties = get_prop ("sam-property-function-alexaskill" )
22
23
apiauth = get_prop ("sam-property-function-apifunctionauth" )
26
27
codeuri = get_prop ("sam-property-function-functioncode" )
27
28
cognitoeventproperties = get_prop ("sam-property-function-cognito" )
28
29
deadletterconfig = get_prop ("sam-property-function-deadletterconfig" )
29
- deploymentpreference = get_prop ("sam-property-function-deploymentpreference" )
30
+ deploymentpreference = get_prop (DEPLOYMENT_PREFERENCE_STEM )
30
31
dlq = get_prop ("sam-property-function-deadletterqueue" )
31
32
documentdbeventproperties = get_prop ("sam-property-function-documentdb" )
32
33
dynamodbeventproperties = get_prop ("sam-property-function-dynamodb" )
46
47
kinesiseventproperties = get_prop ("sam-property-function-kinesis" )
47
48
mqeventproperties = get_prop ("sam-property-function-mq" )
48
49
mskeventproperties = get_prop ("sam-property-function-msk" )
49
- prop = get_prop ("sam-resource-function" )
50
+ prop = get_prop (PROPERTIES_STEM )
50
51
requestmodel = get_prop ("sam-property-function-requestmodel" )
51
52
requestparameters = get_prop ("sam-property-function-requestparameter" )
52
53
resourcepolicy = get_prop ("sam-property-api-resourcepolicystatement" )
@@ -89,7 +90,11 @@ class DeploymentPreference(BaseModel):
89
90
Hooks : Optional [Hooks ] = deploymentpreference ("Hooks" )
90
91
PassthroughCondition : Optional [SamIntrinsicable [bool ]] = deploymentpreference ("PassthroughCondition" )
91
92
Role : Optional [SamIntrinsicable [str ]] = deploymentpreference ("Role" )
92
- TriggerConfigurations : Optional [PassThroughProp ] = deploymentpreference ("TriggerConfigurations" )
93
+ TriggerConfigurations : Optional [PassThroughProp ] = passthrough_prop (
94
+ DEPLOYMENT_PREFERENCE_STEM ,
95
+ "TriggerConfigurations" ,
96
+ ["AWS::CodeDeploy::DeploymentGroup" , "Properties" , "TriggerConfigurations" ],
97
+ )
93
98
Type : Optional [SamIntrinsicable [str ]] = deploymentpreference (
94
99
"Type"
95
100
) # TODO: Should investigate whether this is a required field. This is a required field on documentation. However, we don't seem to use this field.
@@ -494,28 +499,38 @@ class ScheduleV2Event(BaseModel):
494
499
495
500
496
501
class Properties (BaseModel ):
497
- Architectures : Optional [Architectures ] = prop ("Architectures" )
502
+ Architectures : Optional [Architectures ] = passthrough_prop (
503
+ PROPERTIES_STEM ,
504
+ "Architectures" ,
505
+ ["AWS::Lambda::Function" , "Properties" , "Architectures" ],
506
+ )
498
507
AssumeRolePolicyDocument : Optional [AssumeRolePolicyDocument ] = prop ("AssumeRolePolicyDocument" )
499
508
AutoPublishAlias : Optional [AutoPublishAlias ] = prop ("AutoPublishAlias" )
500
509
AutoPublishAliasAllProperties : Optional [AutoPublishAliasAllProperties ] = prop ("AutoPublishAliasAllProperties" )
501
510
AutoPublishCodeSha256 : Optional [SamIntrinsicable [str ]] = prop ("AutoPublishCodeSha256" )
502
- CodeSigningConfigArn : Optional [SamIntrinsicable [str ]] = prop ("CodeSigningConfigArn" )
511
+ CodeSigningConfigArn : Optional [SamIntrinsicable [str ]] = passthrough_prop (
512
+ PROPERTIES_STEM ,
513
+ "CodeSigningConfigArn" ,
514
+ ["AWS::Lambda::Function" , "Properties" , "CodeSigningConfigArn" ],
515
+ )
503
516
CodeUri : Optional [CodeUriType ] = prop ("CodeUri" )
504
517
DeadLetterQueue : Optional [DeadLetterQueueType ] = prop ("DeadLetterQueue" )
505
518
DeploymentPreference : Optional [DeploymentPreference ] = prop ("DeploymentPreference" )
506
- Description : Optional [Description ] = prop ("Description" )
519
+ Description : Optional [Description ] = passthrough_prop (
520
+ PROPERTIES_STEM ,
521
+ "Description" ,
522
+ ["AWS::Lambda::Function" , "Properties" , "Description" ],
523
+ )
507
524
# TODO: Make the notation shorter; resource type and SAM/CFN property names usually same
508
525
Environment : Optional [Environment ] = passthrough_prop (
509
526
PROPERTIES_STEM ,
510
527
"Environment" ,
511
- "AWS::Lambda::Function" ,
512
- "Environment" ,
528
+ ["AWS::Lambda::Function" , "Properties" , "Environment" ],
513
529
)
514
530
EphemeralStorage : Optional [EphemeralStorage ] = passthrough_prop (
515
531
PROPERTIES_STEM ,
516
532
"EphemeralStorage" ,
517
- "AWS::Lambda::Function" ,
518
- "EphemeralStorage" ,
533
+ ["AWS::Lambda::Function" , "Properties" , "EphemeralStorage" ],
519
534
)
520
535
EventInvokeConfig : Optional [EventInvokeConfig ] = prop ("EventInvokeConfig" )
521
536
Events : Optional [
@@ -544,22 +559,32 @@ class Properties(BaseModel):
544
559
],
545
560
]
546
561
] = prop ("Events" )
547
- FileSystemConfigs : Optional [PassThroughProp ] = prop ("FileSystemConfigs" )
562
+ FileSystemConfigs : Optional [PassThroughProp ] = passthrough_prop (
563
+ PROPERTIES_STEM ,
564
+ "FileSystemConfigs" ,
565
+ ["AWS::Lambda::Function" , "Properties" , "FileSystemConfigs" ],
566
+ )
548
567
FunctionName : Optional [PassThroughProp ] = passthrough_prop (
549
568
PROPERTIES_STEM ,
550
569
"FunctionName" ,
551
- "AWS::Lambda::Function" ,
552
- "FunctionName" ,
570
+ ["AWS::Lambda::Function" , "Properties" , "FunctionName" ],
553
571
)
554
572
FunctionUrlConfig : Optional [FunctionUrlConfig ] = prop ("FunctionUrlConfig" )
555
573
Handler : Optional [Handler ] = passthrough_prop (
556
574
PROPERTIES_STEM ,
557
575
"Handler" ,
558
- "AWS::Lambda::Function" ,
559
- "Handler" ,
576
+ ["AWS::Lambda::Function" , "Properties" , "Handler" ],
577
+ )
578
+ ImageConfig : Optional [PassThroughProp ] = passthrough_prop (
579
+ PROPERTIES_STEM ,
580
+ "ImageConfig" ,
581
+ ["AWS::Lambda::Function" , "Properties" , "ImageConfig" ],
582
+ )
583
+ ImageUri : Optional [PassThroughProp ] = passthrough_prop (
584
+ PROPERTIES_STEM ,
585
+ "ImageUri" ,
586
+ ["AWS::Lambda::Function.Code" , "ImageUri" ],
560
587
)
561
- ImageConfig : Optional [PassThroughProp ] = prop ("ImageConfig" )
562
- ImageUri : Optional [PassThroughProp ] = prop ("ImageUri" )
563
588
InlineCode : Optional [PassThroughProp ] = prop ("InlineCode" )
564
589
KmsKeyArn : Optional [KmsKeyArn ] = prop ("KmsKeyArn" )
565
590
Layers : Optional [Layers ] = prop ("Layers" )
@@ -568,29 +593,25 @@ class Properties(BaseModel):
568
593
RolePath : Optional [RolePath ] = passthrough_prop (
569
594
PROPERTIES_STEM ,
570
595
"RolePath" ,
571
- "AWS::IAM::Role" ,
572
- "Path" ,
596
+ ["AWS::IAM::Role" , "Properties" , "Path" ],
573
597
)
574
598
PermissionsBoundary : Optional [PermissionsBoundary ] = passthrough_prop (
575
599
PROPERTIES_STEM ,
576
600
"PermissionsBoundary" ,
577
- "AWS::IAM::Role" ,
578
- "PermissionsBoundary" ,
601
+ ["AWS::IAM::Role" , "Properties" , "PermissionsBoundary" ],
579
602
)
580
603
Policies : Optional [Union [str , DictStrAny , List [Union [str , DictStrAny ]]]] = prop ("Policies" )
581
604
ProvisionedConcurrencyConfig : Optional [ProvisionedConcurrencyConfig ] = passthrough_prop (
582
605
PROPERTIES_STEM ,
583
606
"ProvisionedConcurrencyConfig" ,
584
- "AWS::Lambda::Alias" ,
585
- "ProvisionedConcurrencyConfig" ,
607
+ ["AWS::Lambda::Alias" , "Properties" , "ProvisionedConcurrencyConfig" ],
586
608
)
587
609
ReservedConcurrentExecutions : Optional [ReservedConcurrentExecutions ] = prop ("ReservedConcurrentExecutions" )
588
610
Role : Optional [SamIntrinsicable [str ]] = prop ("Role" )
589
611
Runtime : Optional [Runtime ] = passthrough_prop (
590
612
PROPERTIES_STEM ,
591
613
"Runtime" ,
592
- "AWS::Lambda::Function" ,
593
- "Runtime" ,
614
+ ["AWS::Lambda::Function" , "Properties" , "Runtime" ],
594
615
)
595
616
SnapStart : Optional [SnapStart ] = prop ("SnapStart" )
596
617
RuntimeManagementConfig : Optional [RuntimeManagementConfig ] = prop ("RuntimeManagementConfig" )
@@ -605,14 +626,12 @@ class Globals(BaseModel):
605
626
Handler : Optional [Handler ] = passthrough_prop (
606
627
PROPERTIES_STEM ,
607
628
"Handler" ,
608
- "AWS::Lambda::Function" ,
609
- "Handler" ,
629
+ ["AWS::Lambda::Function" , "Properties" , "Handler" ],
610
630
)
611
631
Runtime : Optional [Runtime ] = passthrough_prop (
612
632
PROPERTIES_STEM ,
613
633
"Runtime" ,
614
- "AWS::Lambda::Function" ,
615
- "Runtime" ,
634
+ ["AWS::Lambda::Function" , "Properties" , "Runtime" ],
616
635
)
617
636
CodeUri : Optional [CodeUriType ] = prop ("CodeUri" )
618
637
DeadLetterQueue : Optional [DeadLetterQueueType ] = prop ("DeadLetterQueue" )
@@ -623,8 +642,7 @@ class Globals(BaseModel):
623
642
Environment : Optional [Environment ] = passthrough_prop (
624
643
PROPERTIES_STEM ,
625
644
"Environment" ,
626
- "AWS::Lambda::Function" ,
627
- "Environment" ,
645
+ ["AWS::Lambda::Function" , "Properties" , "Environment" ],
628
646
)
629
647
Tags : Optional [Tags ] = prop ("Tags" )
630
648
Tracing : Optional [Tracing ] = prop ("Tracing" )
@@ -635,25 +653,26 @@ class Globals(BaseModel):
635
653
RolePath : Optional [RolePath ] = passthrough_prop (
636
654
PROPERTIES_STEM ,
637
655
"RolePath" ,
638
- "AWS::IAM::Role" ,
639
- "Path" ,
656
+ ["AWS::IAM::Role" , "Properties" , "Path" ],
640
657
)
641
658
PermissionsBoundary : Optional [PermissionsBoundary ] = passthrough_prop (
642
659
PROPERTIES_STEM ,
643
660
"PermissionsBoundary" ,
644
- "AWS::IAM::Role" ,
645
- "PermissionsBoundary" ,
661
+ ["AWS::IAM::Role" , "Properties" , "PermissionsBoundary" ],
646
662
)
647
663
ReservedConcurrentExecutions : Optional [ReservedConcurrentExecutions ] = prop ("ReservedConcurrentExecutions" )
648
664
ProvisionedConcurrencyConfig : Optional [ProvisionedConcurrencyConfig ] = prop ("ProvisionedConcurrencyConfig" )
649
665
AssumeRolePolicyDocument : Optional [AssumeRolePolicyDocument ] = prop ("AssumeRolePolicyDocument" )
650
666
EventInvokeConfig : Optional [EventInvokeConfig ] = prop ("EventInvokeConfig" )
651
- Architectures : Optional [Architectures ] = prop ("Architectures" )
667
+ Architectures : Optional [Architectures ] = passthrough_prop (
668
+ PROPERTIES_STEM ,
669
+ "Architectures" ,
670
+ ["AWS::Lambda::Function" , "Properties" , "Architectures" ],
671
+ )
652
672
EphemeralStorage : Optional [EphemeralStorage ] = passthrough_prop (
653
673
PROPERTIES_STEM ,
654
674
"EphemeralStorage" ,
655
- "AWS::Lambda::Function" ,
656
- "EphemeralStorage" ,
675
+ ["AWS::Lambda::Function" , "Properties" , "EphemeralStorage" ],
657
676
)
658
677
SnapStart : Optional [SnapStart ] = prop ("SnapStart" )
659
678
RuntimeManagementConfig : Optional [RuntimeManagementConfig ] = prop ("RuntimeManagementConfig" )
0 commit comments