我正在试用适用于Eclipse的AWS无服务器工具套件,以使用API网关作为输入事件来创建简单的lambda函数。
这是我在AWS上关注的教程: https://docs.aws.amazon.com/toolkit-for-eclipse/v1/user-guide/lambda-tutorial.html
尽管与本教程不同,我使用了AWS无服务器工具提供的“文章”模板。
一切正常,但有一个方面,即当我部署并运行云形成堆栈时,它会创建一个APIgateway端点,该端点不包含queryString参数,现在我可以手动包含它,但我不想这样做,而是希望它包括通过云形成。
我尝试将其作为“ RequestParameters”包含进来:
{
"Description": "Simple article service.",
"Resources": {
"GetArticle": {
"Type": "AWS::Serverless::Function",
"Properties": {
"Handler": "com.serverless.demo.function.GetSteps",
"Runtime" : "java8",
"Events": {
"GetResource": {
"Type": "Api",
"Properties": {
"Path": "/,",
"Method": "get",
"RequestParameters" : { "inputString":true }
}
}
}
}
}
}
}
但是当我部署时,出现错误:
RequestParameters is not defined for resource of Type :API