serverless/serverless-google-cloudfunctions

Deployment status is incorrect when the function name is specified in the serverless.yml

Open

#224 创建于 2020年7月2日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)JavaScript (124 fork)auto 404
help wanted

仓库指标

Star
 (275 star)
PR 合并指标
 (PR 指标待抓取)

描述

In case we don't want to have the deployed function name with serviceName-stage-functionName pattern, and would prefer to have functionName only, we can specify the name directly in the serverless.yml.

service: my-service

provider:
  name: google
  stage: 'prod'
  runtime: 'nodejs10'
  region: us-central1
  project: my-project
  credentials: credentials.json

functions:
  myFunction:
    name: myFunction
    handler: myFunction
    memorySize: 128
    timeout: 120s
    events:
      - http: path

In that case the function name will be myFunction instead of my-service-prod-myFunction, and the URL will be https://my-project-us-central1.cloudfunctions.net/myFunction instead of https://my-project-us-central1.cloudfunctions.net/my-service-prod-myFunction.

However, despite a successful and correct deployment in the GCP, at the end of the execution, it displays the following error message,

Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Compiling function "myFunction"...
Serverless: Uploading artifacts...
Serverless: Artifacts successfully uploaded...
Serverless: Updating deployment...
Serverless: Checking deployment update progress...
.....................................................................
Serverless: Done...
 
  Serverless Error ---------------------------------------
 
  Function "Function" doesn't exist in this Service
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

贡献者指南