mirror of
https://github.com/serverless/serverless.git
synced 2026-01-18 14:58:43 +00:00
24 lines
635 B
JavaScript
24 lines
635 B
JavaScript
'use strict';
|
|
|
|
const _ = require('lodash');
|
|
|
|
module.exports = {
|
|
normalizeCloudFormationTemplate(template) {
|
|
const normalizedTemplate = _.cloneDeep(template);
|
|
|
|
// reset all the S3Keys for AWS::Lambda::Function resources
|
|
_.forEach(normalizedTemplate.Resources, (value) => {
|
|
if (value.Type && value.Type === 'AWS::Lambda::Function') {
|
|
const newVal = value;
|
|
newVal.Properties.Code.S3Key = '';
|
|
}
|
|
if (value.Type && value.Type === 'AWS::Lambda::LayerVersion') {
|
|
const newVal = value;
|
|
newVal.Properties.Content.S3Key = '';
|
|
}
|
|
});
|
|
|
|
return normalizedTemplate;
|
|
},
|
|
};
|