lambda: AliasOptions and VersionOptions should not extend EventInvokeConfigOptions #6966
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p1
In v2.0 we should change the way we model event invoke configuration in AWS Lambda.
Originally posted by @iph in #6771
This was already there but since we are changing it to AliasOptions, it's strange to see EventInvokeConfigOptions as the base object here, as the two are two separate objects in cfn. Technically an alias can have an event invoke config and there is no mixin for typescript (unsure, I'm new to the language) so this was the best way? It seems brittle to tie that together because there will be additional concepts. Are we going to have multi-extends clauses per concept that is added to a qualifier that aliases supports? Will that work with JSII?
To me, it's about the degree of freedom. The kind of object relationship looks more like this:
An event config you can move freely from the underlying version/alias. This is super awesome because we've seen customers who accidentally create a like million message async invoke backlog, and event invoke config is a way to drain the backlog rapidly. If we were to put that object onto a version, which is immutable, then a customer would have to override their deployment systems to move the alias for "live" extremely forward in time to $LATEST potentially.
Again, it's technically correct today: all options in event invoke config are optional and you can attach an event invoke config to an alias, so this works out. The two, over time, will diverge in responsibilities due to their degrees of freedom that Lambda team intentionally decided to separate at an object level and it sparks a saddened emotion to see them tied together.
The text was updated successfully, but these errors were encountered: