Open Gtofig opened 2 years ago
I don't see an issue with adding an optional timeout?
property to IFunction
.
I'll let one of the CDK maintainers comment. I have been a bit confused trying to understand why some properties are omitted in the resource interface, but present in the construct class.
Hi, @markmansur. Adding a timeout?
property to IFunction
seems appropriate in this case. Feel free to submit a PR to address this issue.
I've created PR, which attempts to address this issue: https://github.com/aws/aws-cdk/pull/21272
Describe the feature
Validate that SQS Queue visibility timeout is larger than Lambda function timeout when adding SQS queue as event source to Lambda.
Use Case
When adding SQS as event source to Lambda, AWS requires Queue visibility timeout to be larger than Lambda timeout, otherwise CloudFormation deployment will fail. At the moment, developer will only find out about this issue during deployment. Instead, CDK should fail at synthesis time if timeout condition is not satisfied.
Proposed Solution
I had a quick look at the code, and it's not immediately obvious how to implement this, because the place where binding happens uses
IFunction
interface, which does not exposetimeout
property.If we could add
timeout
property toIFunction
, then validation could be done in thebind
method of theSqsEventSource
class linked above.I'm happy to implement the fix, but want to hear what people think the right way to implement it would be.
Other Information
No response
Acknowledgements
CDK version used
1.157.0
Environment details (OS name and version, etc.)
Ubuntu 20