-
Notifications
You must be signed in to change notification settings - Fork 7
/
processors-pipeline.js
37 lines (27 loc) · 1.29 KB
/
processors-pipeline.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Main processing pipline
function processData(data,program) {
var ret;
// -- Processors Pipline --
// Parse the input file as JSON (future: YAML support)
var textParser = require("./processors/textParser");
ret = textParser.process(data);
// Expand parameters with concrete values
var parametersExpander = require("./processors/parametersExpander");
ret = parametersExpander.process(ret,program);
// Replace the Fn::GetAtt syntax with Ref syntax for: GroupID, SourceSecurityGroupId and DestinationSecurityGroupId
var referenceFixer = require("./processors/sgReferenceFixer");
ret = referenceFixer.process(ret);
// Expressions Evaluator for resolving intristic functions and runtime values
var expressionsResolver = require("./processors/expressionsEvaluator");
ret = expressionsResolver.process(ret);
// Delete resources with false conditions
var conditionsHandler = require("./processors/conditionsHandler");
ret = conditionsHandler.process(ret);
// Your own custom processors here...
//var customProcessor = require("./processors/sampleProcessor");
//ret = customProcessor.process(ret);
var cleanup = require("./processors/cleanupProcessor");
ret = cleanup.process(ret);
return ret;
}
exports.process = processData;