Skip to content

Can't invoke a Lambda function that takes an int as a parameter with dotnet lambda invoke-function #1197

@bjhogan

Description

@bjhogan

Describe the bug

There doesn't seem to be a way to invoke a Lambda function using dotnet lambda invoke-function when the parameter to the function is an int.

Create a new Lambda function -

dotnet new lambda.EmptyFunction --name TakesANumber

Change the FunctionHandler to -

public string FunctionHandler(int input, ILambdaContext context)
{
    return $"you sent {input}";
}

Can't find a way to invoke this function using dotnet lambda invoke-function --payload ...

Have tried payloads with a variety of quotes, decimal places, etc.

Expected Behavior

Ability to invoke a function with a int payload.

Current Behavior

Cannot invoke function with an int payload.

Reproduction Steps

See description.

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

Amazon Lambda Tools for .NET Core applications (5.4.2)

Targeted .NET Platform

.NET 6

Operating System and version

Windows 10

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions