serverless-aliyun-function-compute-wnj
Version:
Provider plugin for the Serverless Framework v1.x which adds support for Aliyun Function Compute
25 lines (19 loc) • 643 B
JavaScript
;
/* eslint no-use-before-define: 0 */
const _ = require('lodash');
const BbPromise = require('bluebird');
module.exports = {
mergeServiceResources() {
const resources = this.serverless.service.resources;
if ((typeof resources === 'undefined') || _.isEmpty(resources)) {return BbPromise.resolve();}
_.mergeWith(
this.serverless.service.provider.compiledConfigurationTemplate,
{ Resources: resources && resources.resources },
mergeCustomizer);
return BbPromise.resolve();
},
};
const mergeCustomizer = (objValue, srcValue) => {
objValue.FunctionResources=srcValue;
return objValue;
};