Closed flaviostutz closed 4 years ago
So, what do you think about placing this option at the "config" node of the rules json? Something like:
{
"_config": {
"seed": 123,
"default_condition": true,
"lazy_evaluation": false,
"flatten": true,
},
"_items": [{
"provider": "aws",
"_condition": "randomPerc(10, input:customerid)",
"_items": [{
"region": "sa-east-1",
"login": "login.sa-east-1.test.com",
"bootcamp": "bootcamp.sa-east-1.test.com",
"_condition": "input:_ip_country=='Brazil'"
},
{
"region": "us-west-1",
"login": "login.us-west-1.test.com",
"events": "events.us-west-1.test.com",
"bootcamp": "bootcamp.us-west-1.test.com"
}
]
},
{
"provider": "azure",
"_condition": "randomPercRange(10, 50, input:customerid)",
"_items": [{
"region": "azure-brazil",
"login": "login.azure-brazil.test.com",
"_condition": "input:_ip_country=='Brazil'"
},
{
"region": "azure-ny",
"login": "login.azure-ny.test.com",
"events": "events.azure-ny.test.com",
"bootcamp": "bootcamp.azure-ny.test.com"
}
]
},
{
"provider": "vpsdime",
"_items": [{
"region": "vpsdime",
"login": "login.vpsdime.test.com",
"events": "events.azure-ny.test.com",
"bootcamp": "bootcamp.azure-ny.test.com"
}]
}
]
}
I suggest "lazy_evaluation" default value to be "false" because we will stop throwing errors when a required input is not present, so that it will be much harder to detect when the caller is sending wrong values to ruller.
What do you think?
This discussion is a continuation of https://github.com/flaviostutz/ruller/issues/5.