AWS Lambda Java SDK连接超时问题

时间:2018-05-21 17:44:40

标签: java amazon-web-services aws-lambda aws-java-sdk

我有一个java程序,我想调用AWS Lambda:

String database = "database-name";
String name = "table-name";
String lambdaName = "hive-nebula-directory-lambda-qa";
DefaultAWSCredentialsProviderChain defaultProvider = new DefaultAWSCredentialsProviderChain();
AWSCredentials defaultCreds = defaultProvider.getCredentials();

AWSLambda lambdaClient = AWSLambdaClientBuilder.standard()
        .withRegion("us-east-1")
        .withCredentials(defaultProvider)
        .build();
String payload = "{'RequestType':'Database.Table','Request':'" + database + "." + name + "'}";
InvokeRequest request = new InvokeRequest().withFunctionName(lambdaName);
InvokeResult response = lambdaClient.invoke(request);
System.out.println(response);

程序在invoke语句上失败并显示错误:

com.amazonaws.SdkClientException: Unable to execute HTTP request:
Connect to lambda.us-east-1.amazonaws.com:443 
[lambda.us-east-1.amazonaws.com/54.209.234.7, 
lambda.us-east-1.amazonaws.com/54.86.49.162, 
lambda.us-east-1.amazonaws.com/54.88.170.138, 
lambda.us-east-1.amazonaws.com/54.236.156.247, 
lambda.us-east-1.amazonaws.com/54.85.154.34, 
lambda.us-east-1.amazonaws.com/54.88.193.25, 
lambda.us-east-1.amazonaws.com/54.88.112.102, 
lambda.us-east-1.amazonaws.com/107.23.102.90] 
failed: connect timed out

我已经使用python boto3库正确调用lambda并直接使用AWS CLI调用,因此我确信默认凭据设置正确。

为什么连接超时的任何想法?

0 个答案:

没有答案