I want to invoke an aws lambda function through java code using the aws lamdba sdk while specifying a proxy above the client. How can I achieve such scenario? I did not manage to locate any documentation on aws docs.
I am using
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>lambda</artifactId>
<version>2.21.10</version>
</dependency>
I have something like this, and i want to specify a proxy here. Any idea?
@PostConstruct
public void init() {
lambdaClient = LambdaClient.builder()
// specify a proxy here maybe or a custom httpclient ?
.region(Region.EU_SOUTH_1)
.build();
}
2
Answers
You can easily build your own custom http client for the AWS SDK:
This is documented in the AWS SDK Jave V2 Developer Guide. This topic contains information on how to configure the Apache-based HTTP client. See this topic:
Configure the Apache-based HTTP client