Skip to content

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

Open
@knightdna

Description

@knightdna

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions