Argument of type 'Function' is not assignable to parameter of type 'IFunction'.
See original GitHub issueOS: macOS 10.14.6 aws-cdk/core: 1.0.0 aws-cdk/aws-lambda: 1.0.0 aws-cdk/aws-events: 1.1.0 aws-cdk/aws-events-targets: 1.1.0 cdk: 1.0.0 (build d89592e)
I am trying to create a stack similar to the lambda-cron example.
While adding lambda function to rule, it is erring out.
Add a lambda function as a target:
rule.addTarget(new targets.LambdaFunction(queueConsumer));
queueConsumer
is a lambda function (aws-cdk/aws-lambda.Function
) that consumes messages from a SQS queue.
Error while adding the target
Argument of type 'Function' is not assignable to parameter of type 'IFunction'.
Is there any way to get the IFunction object from the lambda.Function object?
Issue Analytics
- State:
- Created 4 years ago
- Comments:39 (19 by maintainers)
Top Results From Across the Web
How to resolve AWS CDK error "Argument of type 'Function' is ...
This error Argument of type 'SomeClass' is not assignable to parameter of type 'ISomeClass' typically occurs when version of CDK ...
Read more >awslabs/aws-cdk - Gitter
error TS2345 : Argument of type 'Function' is not assignable to parameter of type 'IFunction'. Function extends FunctionBase which implements IFunction…
Read more >Argument of type Not Assignable to type Construct in AWS CDK
The reason we get the "Argument of type is not assignable to parameter of type Construct" error in CDK is because we have...
Read more >AWS CDK - interface IFunction
The principal to grant permissions to. isBoundToVpc. Type: boolean. Whether or not this Lambda function was bound to a VPC. If this ...
Read more >AWS CDKで”Argument of type 'this' is not assignable to ...
AWS CDKで”Argument of type 'this' is not assignable to parameter of type 'Construct'.”が出た時はpackage.jsonを見ようという話. タイトル落ちですが、覚書です。
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
A somewhat dirty workaround that worked for me:
Basically using
require
instead ofimport
solved the problem