From fc5fa5e830153e70e2df49bd23f7dfaaac5bafbd Mon Sep 17 00:00:00 2001 From: Sam Liu Date: Tue, 21 Feb 2023 10:23:01 -0800 Subject: [PATCH] fix: Make pass-through properties pass-through in serverless::function --- samtranslator/model/sam_resources.py | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index 90be9547ed..43d3e504ab 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -96,17 +96,17 @@ class SamFunction(SamResourceMacro): resource_type = "AWS::Serverless::Function" property_types = { "FunctionName": PropertyType(False, one_of(IS_STR, IS_DICT)), - "Handler": PropertyType(False, IS_STR), - "Runtime": PropertyType(False, IS_STR), - "CodeUri": PropertyType(False, one_of(IS_STR, IS_DICT)), - "ImageUri": PropertyType(False, IS_STR), - "PackageType": PropertyType(False, IS_STR), - "InlineCode": PropertyType(False, one_of(IS_STR, IS_DICT)), + "Handler": PassThroughProperty(False), + "Runtime": PassThroughProperty(False), + "CodeUri": PassThroughProperty(False), + "ImageUri": PassThroughProperty(False), + "PackageType": PassThroughProperty(False), + "InlineCode": PassThroughProperty(False), "DeadLetterQueue": PropertyType(False, IS_DICT), - "Description": PropertyType(False, IS_STR), + "Description": PassThroughProperty(False), "MemorySize": PassThroughProperty(False), - "Timeout": PropertyType(False, is_type(int)), - "VpcConfig": PropertyType(False, IS_DICT), + "Timeout": PassThroughProperty(False), + "VpcConfig": PassThroughProperty(False), "Role": PropertyType(False, IS_STR), "AssumeRolePolicyDocument": PropertyType(False, IS_DICT), "Policies": PropertyType(False, one_of(IS_STR, IS_DICT, list_of(one_of(IS_STR, IS_DICT)))), @@ -116,25 +116,25 @@ class SamFunction(SamResourceMacro): "Events": PropertyType(False, dict_of(IS_STR, IS_DICT)), "Tags": PropertyType(False, IS_DICT), "Tracing": PropertyType(False, one_of(IS_DICT, IS_STR)), - "KmsKeyArn": PropertyType(False, one_of(IS_DICT, IS_STR)), + "KmsKeyArn": PassThroughProperty(False), "DeploymentPreference": PropertyType(False, IS_DICT), "ReservedConcurrentExecutions": PropertyType(False, any_type()), "Layers": PropertyType(False, list_of(one_of(IS_STR, IS_DICT))), "EventInvokeConfig": PropertyType(False, IS_DICT), - "EphemeralStorage": PropertyType(False, IS_DICT), + "EphemeralStorage": PassThroughProperty(False), # Intrinsic functions in value of Alias property are not supported, yet "AutoPublishAlias": PropertyType(False, one_of(IS_STR)), "AutoPublishCodeSha256": PropertyType(False, one_of(IS_STR)), "AutoPublishAliasAllProperties": Property(False, is_type(bool)), - "VersionDescription": PropertyType(False, IS_STR), - "ProvisionedConcurrencyConfig": PropertyType(False, IS_DICT), - "FileSystemConfigs": PropertyType(False, list_of(IS_DICT)), - "ImageConfig": PropertyType(False, IS_DICT), - "CodeSigningConfigArn": PropertyType(False, IS_STR), - "Architectures": PropertyType(False, list_of(one_of(IS_STR, IS_DICT))), + "VersionDescription": PassThroughProperty(False), + "ProvisionedConcurrencyConfig": PassThroughProperty(False), + "FileSystemConfigs": PassThroughProperty(False), + "ImageConfig": PassThroughProperty(False), + "CodeSigningConfigArn": PassThroughProperty(False), + "Architectures": PassThroughProperty(False), "SnapStart": PropertyType(False, IS_DICT), "FunctionUrlConfig": PropertyType(False, IS_DICT), - "RuntimeManagementConfig": PropertyType(False, IS_DICT), + "RuntimeManagementConfig": PassThroughProperty(False), } FunctionName: Optional[Intrinsicable[str]]