这是我的serverless.yml文件:
service: investor-bot
provider:
name: aws
runtime: python3.9
stage: dev
functions:
post:
handler: handler.hello
events:
- http:
path: ita-investor-bot
method: get以下是代码(即使使用此代码,它也不能工作):
def hello(event, context):
return {"statusCode": 200}我导出了我的AWS凭证,并运行了无服务器部署:
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service investor-bot.zip file to S3 (12.77 MB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
.......................................
Serverless: Stack update finished...
Service Information
service: investor-bot
stage: dev
region: us-east-1
stack: investor-bot-dev
resources: 11
api keys:
None
endpoints:
GET - https://933zcto8tc.execute-api.us-east-1.amazonaws.com/dev/ita-investor-bot
functions:
post: investor-bot-dev-post
layers:
None
Serverless: Removing old service artifacts from S3...
Serverless: Deprecation warning: Resolution of lambda version hashes was improved with better algorithm, which will be used in next major release.
Switch to it now by setting "provider.lambdaHashingVersion" to "20201221"
More Info: https://www.serverless.com/framework/docs/deprecations/#LAMBDA_HASHING_VERSION_V2
Toggle on monitoring with the Serverless Dashboard: run "serverless"我在API Gateway中的AWS帐户上看不到任何内容。我无法访问终结点:

发布于 2021-10-29 13:46:26
肯定有一个已部署的API网关。您已经在us-east-1部署了您的堆栈,我最好的猜测是您在另一个区域使用AWS控制台。
登录到AWS控制台后,使用右上角的区域切换器切换到us-east-1,从那里您应该看到您的API网关、lambda函数和cloudwatch日志。
https://stackoverflow.com/questions/69757417
复制相似问题