Hi,
I’m currently deploying a cloud function. sls deploy throws RESOURCE_ERROR error. Following is my folder structure:
index.js
exports.testFunction = (event, context, callback) => {
console.info({event, context})
callback();
};
serverless.yaml:
service: sample
provider:
name: google
stage: ${env:NODE_ENV}
runtime: nodejs14
region: asia-southeast2
project: sample
credentials: …/key.json
frameworkVersion: ‘2’
plugins:
- serverless-webpack
- serverless-google-cloudfunctions
custom:
webpack:
includeModules:
packagePath: ‘…/package.json’
packager: ‘yarn’
package:
patterns:
- ‘!.gitignore’
functions:
testFunction:
handler: testFunction
events:
- event:
eventType: providers/cloud.pubsub/eventTypes/topic.publish
resource: projects/*/topics/test
Error:
{“ResourceType”:“gcp-types/cloudfunctions-v1:projects.locations.functions”,“ResourceErrorCode”:“400”,“ResourceErrorMessage”:“Build failed: function.js does not exist; Error ID: 7485c5b6”}
Can someone provide any suggestions?
Thanks in advance!