The specified provider "google" does not exist

Zameer Ansari

I'm trying to set up a serverless project which will be hosted on the Google cloud platform. Here is what the serverless.yml looks like

plugins: # List of plugins of use on application
    - serverless-offline # Get your serverless configuration and run the server local
    - serverless-plugin-typescript-express

# Project name on the infrastructure created
service: ansaar-auth

provider:
  name: google # Provider name, where the infrastructure has be created
  runtime: nodejs # The node version where the lambda functions going to run
  project: ansaar-auth
  credentials: ~/.gcloud/auth.json
  # stage: dev # Control the environment of application
  # region: us-east-1 # Default region where the lambda functions running

  functions: # The array with definitions of lambda functions of the your application 
  getUsers: # Lambda function name
    handler: src/server.handler # The function name mapped of the application
    events: # Array of events that call the function
      - http: # Type of event, the http event selected, it's event is a endpoint mapped on api gateway
          path: users
          method: get

The credentials are set according to the docs however for some reasons the deployment is not working and always throws the below error:

Serverless Error ---------------------------------------

  The specified provider "google" does not exist.

Does anyone know how to fix it and successfully deploy the project to GCP?

Aaron Stuyvenberg

In order to use Google cloud functions, please install the serverless-google-cloudfunctions plugin.

You can generate a sample serverless.yml using serverless create --template google-nodejs --path gcp

It should look like this:

service: gcp

provider:
  name: google
  stage: dev
  runtime: nodejs8
  region: us-central1
  project: my-project
  # The GCF credentials can be a little tricky to set up. Luckily we've documented this for you here:
  # https://serverless.com/framework/docs/providers/google/guide/credentials/
  #
  # the path to the credentials file needs to be absolute
  credentials: ~/.gcloud/keyfile.json

plugins:
  - serverless-google-cloudfunctions

# needs more granular excluding in production as only the serverless provider npm
# package should be excluded (and not the whole node_modules directory)
package:
  exclude:
    - node_modules/**
    - .gitignore
    - .git/**

functions:
  first:
    handler: http
    events:
      - http: path

Here's the full quickstart guide: https://serverless.com/framework/docs/providers/google/guide/quick-start/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

What does mean "specified for property 'resDir' does not exist."

How to check if specified id does not exist in two tables in MySQL?

Eclipse: The specified JRE installation does not exist

Eclipse: Referenced classpath provider does not exist

specified JRE installation does not exist

Android specified for property 'signingConfig.storeFile' does not exist

The specified LocalDb instance does not exist

Android Studio Gradle Build error - specified for property 'manifest' does not exist

LocalDB instance specified does not exist

Error : This identity pool does not support the specified developer provider

The specified deps.json '$$$' does not exist

Serverless: The specified bucket does not exist

The specified project directory ''" does not exist

Invalid provider type specified when trying to access google analytics

azure blob storage getting error - the specified resource does not exist

Duplicity specified archive directory does not exist

Maven clean fails: The specified JRE installation does not exist

How to resolve "specified origin access identity does not exist or is not valid"

CosmosDB Entity with the specified id does not exist

Win32Exception: The specified service does not exist as an installed service

What does cut return if the specified field does not exist?

specified destination directory does not exist

Error "network provider does not exist, accuracy=3" when requesting provider

ng g c c-name => Specified module does not exist

Azure Cosmos Python "Entity with the specified id does not exist in the system

"The specified share does not exist" with file upload to Azure

Specified "public" directory {path} does not exist

Azure: The specified container does not exist, Dapr with ContainerApps

Nest could not find PrismaService element (this provider does not exist in the current context)