@@ -96,17 +96,17 @@ class SamFunction(SamResourceMacro):
96
96
resource_type = "AWS::Serverless::Function"
97
97
property_types = {
98
98
"FunctionName" : PropertyType (False , one_of (IS_STR , IS_DICT )),
99
- "Handler" : PropertyType (False , IS_STR ),
100
- "Runtime" : PropertyType (False , IS_STR ),
101
- "CodeUri" : PropertyType (False , one_of ( IS_STR , IS_DICT ) ),
102
- "ImageUri" : PropertyType (False , IS_STR ),
103
- "PackageType" : PropertyType (False , IS_STR ),
104
- "InlineCode" : PropertyType (False , one_of ( IS_STR , IS_DICT ) ),
99
+ "Handler" : PassThroughProperty (False ),
100
+ "Runtime" : PassThroughProperty (False ),
101
+ "CodeUri" : PassThroughProperty (False ),
102
+ "ImageUri" : PassThroughProperty (False ),
103
+ "PackageType" : PassThroughProperty (False ),
104
+ "InlineCode" : PassThroughProperty (False ),
105
105
"DeadLetterQueue" : PropertyType (False , IS_DICT ),
106
- "Description" : PropertyType (False , IS_STR ),
106
+ "Description" : PassThroughProperty (False ),
107
107
"MemorySize" : PassThroughProperty (False ),
108
- "Timeout" : PropertyType (False , is_type ( int ) ),
109
- "VpcConfig" : PropertyType (False , IS_DICT ),
108
+ "Timeout" : PassThroughProperty (False ),
109
+ "VpcConfig" : PassThroughProperty (False ),
110
110
"Role" : PropertyType (False , IS_STR ),
111
111
"AssumeRolePolicyDocument" : PropertyType (False , IS_DICT ),
112
112
"Policies" : PropertyType (False , one_of (IS_STR , IS_DICT , list_of (one_of (IS_STR , IS_DICT )))),
@@ -116,25 +116,25 @@ class SamFunction(SamResourceMacro):
116
116
"Events" : PropertyType (False , dict_of (IS_STR , IS_DICT )),
117
117
"Tags" : PropertyType (False , IS_DICT ),
118
118
"Tracing" : PropertyType (False , one_of (IS_DICT , IS_STR )),
119
- "KmsKeyArn" : PropertyType (False , one_of ( IS_DICT , IS_STR ) ),
119
+ "KmsKeyArn" : PassThroughProperty (False ),
120
120
"DeploymentPreference" : PropertyType (False , IS_DICT ),
121
- "ReservedConcurrentExecutions" : PropertyType (False , any_type () ),
121
+ "ReservedConcurrentExecutions" : PassThroughProperty (False ),
122
122
"Layers" : PropertyType (False , list_of (one_of (IS_STR , IS_DICT ))),
123
123
"EventInvokeConfig" : PropertyType (False , IS_DICT ),
124
- "EphemeralStorage" : PropertyType (False , IS_DICT ),
124
+ "EphemeralStorage" : PassThroughProperty (False ),
125
125
# Intrinsic functions in value of Alias property are not supported, yet
126
126
"AutoPublishAlias" : PropertyType (False , one_of (IS_STR )),
127
127
"AutoPublishCodeSha256" : PropertyType (False , one_of (IS_STR )),
128
128
"AutoPublishAliasAllProperties" : Property (False , is_type (bool )),
129
- "VersionDescription" : PropertyType (False , IS_STR ),
130
- "ProvisionedConcurrencyConfig" : PropertyType (False , IS_DICT ),
131
- "FileSystemConfigs" : PropertyType (False , list_of ( IS_DICT ) ),
132
- "ImageConfig" : PropertyType (False , IS_DICT ),
133
- "CodeSigningConfigArn" : PropertyType (False , IS_STR ),
134
- "Architectures" : PropertyType (False , list_of ( one_of ( IS_STR , IS_DICT )) ),
129
+ "VersionDescription" : PassThroughProperty (False ),
130
+ "ProvisionedConcurrencyConfig" : PassThroughProperty (False ),
131
+ "FileSystemConfigs" : PassThroughProperty (False ),
132
+ "ImageConfig" : PassThroughProperty (False ),
133
+ "CodeSigningConfigArn" : PassThroughProperty (False ),
134
+ "Architectures" : PassThroughProperty (False ),
135
135
"SnapStart" : PropertyType (False , IS_DICT ),
136
136
"FunctionUrlConfig" : PropertyType (False , IS_DICT ),
137
- "RuntimeManagementConfig" : PropertyType (False , IS_DICT ),
137
+ "RuntimeManagementConfig" : PassThroughProperty (False ),
138
138
}
139
139
140
140
FunctionName : Optional [Intrinsicable [str ]]
@@ -543,7 +543,6 @@ def _construct_lambda_function(self) -> LambdaFunction:
543
543
544
544
lambda_function .RuntimeManagementConfig = self .RuntimeManagementConfig # type: ignore[attr-defined]
545
545
self ._validate_package_type (lambda_function )
546
- self ._validate_architectures (lambda_function )
547
546
return lambda_function
548
547
549
548
def _add_event_invoke_managed_policy (
@@ -666,36 +665,6 @@ def _validate_package_type_image() -> None:
666
665
# Call appropriate validation function based on the package type.
667
666
return _validate_per_package_type [packagetype ]()
668
667
669
- def _validate_architectures (self , lambda_function : LambdaFunction ) -> None :
670
- """
671
- Validates Function based on the existence of architecture type
672
-
673
- parameters
674
- ----------
675
- lambda_function: LambdaFunction
676
- Object of function properties supported on AWS Lambda
677
-
678
- Raises
679
- ------
680
- InvalidResourceException
681
- Raised when the Architectures property is invalid
682
- """
683
-
684
- architectures = [X86_64 ] if lambda_function .Architectures is None else lambda_function .Architectures
685
-
686
- if is_intrinsic (architectures ):
687
- return
688
-
689
- if (
690
- not isinstance (architectures , list )
691
- or len (architectures ) != 1
692
- or (not is_intrinsic (architectures [0 ]) and (architectures [0 ] not in [X86_64 , ARM64 ]))
693
- ):
694
- raise InvalidResourceException (
695
- lambda_function .logical_id ,
696
- "Architectures needs to be a list with one string, either `{}` or `{}`." .format (X86_64 , ARM64 ),
697
- )
698
-
699
668
def _validate_dlq (self , dead_letter_queue : Dict [str , Any ]) -> None :
700
669
"""Validates whether the DeadLetterQueue LogicalId is validation
701
670
:raise: InvalidResourceException
0 commit comments