Closed jric closed 1 year ago
Thanks for the issue! indeed the resource is created as part of the events described for the lambda function. This was added at https://github.com/aws/aws-sam-cli/pull/2907 to address https://github.com/aws/serverless-application-model/issues/2152
This issue have been fixed in SAM CLI 1.67.0 release.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Description:
The out-of-the box template results in an ominous warning when running "sam build".
Steps to reproduce:
I followed the tutorial at https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-hello-world.html but selected Node as the build environment and Typescript as the application template:
sam init
1 - AWS Quick Start Templates
1 - Hello World Example
N
(most popular runtime and package type10 - nodejs16.x
1 - Zip
2 - Hello World Example TypeScript
N
(X-Ray tracing)sam-app
(name)cd sam-app
sam build
Observed result:
Your template contains a resource with logical ID "ServerlessRestApi", which is a reserved logical ID in AWS SAM. It could result in unexpected behaviors and is not recommended.
Checking the
template.yaml
file, I see no resource defined asServerlessRestApi
, leading me to believe the warning is issued incorrectly. I do see a reference toServerlessRestApi
and a comment about it being animplicit resource created out of Events key under Serverless::Function
.Full
--debug
output included below.Expected result:
No warnings.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
:SAM CLI, version 1.59.0
us-west-2
Full --debug output
sam build --debug