Closed
Description
Hi,
I have a question on call lambda functions. In documents says that as the name of the function can be used ARN.
If I try to use ARN instead of the function name in this example:
...
Aws::Lambda::Model::InvokeRequest request;
request.SetInvocationType(InvocationType::RequestResponse);
Aws::Lambda::Model::InvokeResult result;
//request.SetFunctionName("fn_v3"); // It works
request.SetFunctionName("arn:aws:lambda:us-west-2:XXXXXXXXXX:function:fn_v3"); // This does not work
auto payload = Aws::MakeShared<Aws::StringStream>("invokeLambda");
*payload << AWS_TEST_BODY;
request.SetBody(payload);
auto response = lambdaClient.Invoke(request);
...
I get the error:
Error: Unable to parse ExceptionName: InvalidSignatureException:http://internal.
amazon.com/coral/com.amazon.coral.service/ Message: The request signature we cal
culated does not match the signature you provided. Check your AWS Secret Access
Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST /2015-03-31/functions/arn%253Aaws%253Alambda%253Aus-west-2%253AXXXXXXXXX%253A
function%253Afn_v3/invocations
...
If I use the function name, the code works.
Help please understand what the problem is.
Thank you.