我正在使用 eclipse 创建一个无服务器应用程序。在尝试清理我的部署模板时,我正在尝试使用 Globals。但是,我发现在部署我的 Java 函数时忽略了内存大小属性。
以下是我的 SAM 模板中的一部分:
"Globals":{
"Function": {
"Tags" : {
"Client" : { "Ref": "Client"},
"Stage" : { "Ref" : "NameExt" }
},
"Runtime" : "java8",
"MemorySize" : "1024",
"Timeout" : 300,
"Environment" : {
"Variables" : {
"REGION" : { "Ref" : "AWS::Region" },
"STAGE" : { "Ref" : "NameExt" }
}
}
}
},
"Resources": {
"RunReports" : {
"Type" : "AWS::Serverless::Function",
"Properties" : {
"Handler" : "APIReports",
"FunctionName" : "RunReport",
"Policies" : [ "AmazonDynamoDBFullAccess", "AmazonS3FullAccess" ],
"Events" : {
"GetResource" : {
"Type" : "Api",
"Properties" : {
"Path" : "/commands/report",
"Method" : "Get"
}
}
}
}
},
},
部署项目时,使用eclipse,将Function的MemorySize设置为512。
任何帮助,非常感谢。干杯,