mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
Refactor merging of custom provider resources
This commit is contained in:
parent
eb8546a1f6
commit
6513a1c6fe
@ -93,14 +93,7 @@ module.exports = {
|
||||
|
||||
// check if the user has added some "custom provider resources"
|
||||
// and merge them into the CloudFormation template if there are any
|
||||
|
||||
_.forEach(this.serverless.service.resources, (resourceValue, resourceKey) => {
|
||||
if (typeof resourceValue === 'string') {
|
||||
coreCloudFormationTemplate[resourceKey] = resourceValue;
|
||||
} else if (typeof resourceValue === 'object') {
|
||||
_.merge(coreCloudFormationTemplate[resourceKey], resourceValue);
|
||||
}
|
||||
});
|
||||
_.merge(coreCloudFormationTemplate, this.serverless.service.resources);
|
||||
|
||||
this.serverless.service.resources = coreCloudFormationTemplate;
|
||||
|
||||
|
||||
@ -214,7 +214,7 @@ describe('createStack', () => {
|
||||
expect(awsDeploy.serverless.service.resources.Outputs.FakeOutput2)
|
||||
.to.deep.equal(customResourcesMock.Outputs.FakeOutput2);
|
||||
expect(awsDeploy.serverless.service.resources.CustomDefinition)
|
||||
.to.deep.equal(customResourcesMock.Outputs.CustomDefinition);
|
||||
.to.deep.equal(customResourcesMock.CustomDefinition);
|
||||
|
||||
awsDeploy.sdk.request.restore();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user