LambdaDeployFunction task - [error]Error: Function:my-function does not exist, cannot update code only

Today I discovered an issue with the AWS Toolkit for Azure DevOps, specifically the AWS Lambda Deploy Function.
The task task: LambdaDeployFunction@1 will incorrectly report that your function cannot be found, even if it does exist.

# note: AWS Toolkit for Azure DevOps version: 1.7.0
##[error]Error: Function:my-function does not exist, cannot update code only

I tried another way of accessing the function using:

aws lambda get-function --function-name my-function

This then produced the following error:

An error occurred (AccessDeniedException) when calling the GetFunction operation: User: arn:aws:sts::myrole is not authorized
to perform: lambda:GetFunction on resource: arn:aws:lambda:<path>:function:my-function

So I actually had a permissions error, if we looks at the code for the LambdaDeployFunction task, we can see that testFunctionExists surpresses all exceptions.

This issue has been raised on github via aws-toolkit-azure-devops.

Updated: