adhorn / aws-lambda-chaos-injection

Chaos Injection library for AWS Lambda
MIT License
99 stars 13 forks source link

Support for local configuration file #5

Closed alexcasalboni closed 4 years ago

alexcasalboni commented 5 years ago

Using SSM is great, but maybe someone would prefer not having additional latency just to read the configuration.

Supporting a local configuration file or even just reading the configuration from an environment variable could be a useful alternative.

adhorn commented 5 years ago

The problem with that is that during an experiment, you would have to redeploy the lambda function to stop it. Having the "isEnabled" in SSM gives the "Big Red Button" to stop the experiment almost instantly. Remember that this is for chaos experiments.

Open to ideas though - but I don't want to have to redeploy or do it via the console.

gunnargrosch commented 5 years ago

I agree with Adrian on this. There is the option of having the configuration as an environment variable and updating that using cli with 'aws lambda update-function-configuration --environment Variables="{whatever=whatever}"'. The problem with that is that you have to specify every env parameter in the command or else they will be removed, which feels like a certain way of messing things up.

alexcasalboni commented 5 years ago

That makes sense.

Can you think of a different scenario where we don't need a shared configuration on SSM at all? Maybe the case in which I configure everything "inline"? See #1, #3 and #4.

Or even in that case we'd need at least one shared parameter for isEnabled?

gunnargrosch commented 5 years ago

Correct. The on/off button is still needed.

adhorn commented 5 years ago

Happy to support something else than SSM- but we need a Big Red Button

alexcasalboni commented 5 years ago

If the experiment involves only one or two functions at a time, I can imagine some customers may prefer using env variables and re-deploying the function rather than adding 30+ms of latency to each invocation (unless they are injecting latency anyway ^_^ )

Even though the point that @gunnargrosch made about re-setting all environment variables is very true, I think it's about providing that option instead of forcing SSM.

adhorn commented 5 years ago

Not convinced - I will try to figure out something