I have a technical question about how the AWS Lambda client determines the endpoint URL when invoking a function using client.invoke() in Java SDK 1.x. My Lambda function is deployed inside a VPC, and I want to understand how the SDK constructs the URL used for DNS resolution and how it maps to a specific IP.
Specifically, I’m trying to determine whether there is an equivalent to the private S3 bucket VPC endpoint (e.g., https://bucket.<VPC_endpoint_DNS_name> ) for Lambda functions. I’d also like to know how the SDK resolves the endpoint for both public and private Lambda functions and whether there is a way to retrieve the exact URL being used during invocation.
Any insights on how Lambda endpoints are structured, especially for private functions within a VPC, would be helpful.
Thanks
I tried looking into the AWSClientBuilder library & found this:
AWSLambdaClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
this.advancedConfig = clientParams.getAdvancedConfig();
this.init();
}
private void init() {
this.setServiceNameIntern("lambda");
this.setEndpointPrefix("lambda");
this.setEndpoint("lambda.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
this.requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/lambda/request.handlers"));
this.requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/lambda/request.handler2s"));
this.requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
But here the endpoint is hardcoded & it doesn't mention anything about how it constructs endpoint when lambda function is inside a VPC