Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing composability demonstration #2

Open
eladb opened this issue Feb 27, 2019 · 1 comment
Open

missing composability demonstration #2

eladb opened this issue Feb 27, 2019 · 1 comment

Comments

@eladb
Copy link

eladb commented Feb 27, 2019

Instead of ad hoc functions for "wrapping a lambda with a hit counter", I rather we show what it looks like in Go to define a reusable construct that can be then shared and composed together into higher level components. This is an important part of the CDK and we are missing it.

func WrapLambdaWithHitCounter(stack cdk.StackIface, id string, downstreamFn awslambda.FunctionIface) *awslambda.Function {

@jasdel
Copy link
Owner

jasdel commented Feb 27, 2019

Thanks, Could you describe more about creating a reusable construct? I'd like to understand the difference more. In the WrapLambdaHitCounter func of the example, it returns a composed lambda function construct, (awslambda.Function). This example function could be used by users to add any hit counter as Lambda middle ware to their stack. Of course a real world usage of this would most likely be different based on use case, such as having configuration passed in specific to how the hit counter is configured, such as the table name used.

Also it would be very helpful if you could describe the functionality that is missing. I think that will help evaluate this issue more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants