Lambda Netcore 3.1 why cloudsearchdomain search hang when it is deployed?

0

hello,
i have a lambda net core 3.1 +apigateway that must launch a search on a cloudsearchdomain.
i use this code :

using (var client = new AmazonCloudSearchDomainClient(searchServiceConfig))
{
....
LambdaLogger.Log("launch search");
Task<SearchResponse> task = client.SearchAsync(request);
 task.Wait();                                        //// hang here
 LambdaLogger.Log("parse result");/// this message don&#39;t appear in the cloudwatch log
SearchResponse response = task.Result;
LambdaLogger.Log("after parse result");
totalResult = response.Hits.Found;

when i test this code :
in a windows app : OK
with Mock Lambda Test Tools : OK
deployed in lambda on aws infrastruture : KO the code don't pass the task.Wait() instruction.
any idea for unblock this problem ?

WANAOJD
asked 4 years ago145 views
1 Answer
0

it was not a problem with async method. it was a problem with vpc

WANAOJD
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions