Additional Details¶
Instantiation¶
A Fidelius object can be instantiated with varying levels of configuration. The default constructor uses the DefaultAWSCredentialsProviderChain and default ClientConfiguration.
The region is set from the AWS_DEFAULT_REGION environment variable, or "us-east-1" if the variable is not set.
// Default Constructor FideliusClient fideliusClient = new FideliusClient();
-
Network-related settings (proxy, timeout, etc.) can be set by configuring and passing the ClientConfiguration object. If only proxy needs to be configured then the environment variables CRED_PROXY and CRED_PORT can be set and use the default ClientConfiguration.
-
Authentication is configured by passing in an AWSCredentialsProvider
-
AWS Region can be specified by passing the appropriate string value. See: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/regions/Regions.html
Example 1: Passing Proxy and Port with custom ClientConfiguration¶
ClientConfiguration clientConf = new ClientConfiguration() .withProxyHost("proxy.company.com") .withProxyPort(8081); AWSCredentialsProvider provider = new DefaultAWSCredentialsProviderChain(); String region = Regions.US_EAST_1.getName(); FideliusClient fideliusClient = new FideliusClient(clientConf, provider, region);
Example 2: Setting proxy environment variables and using default ClientConfiguration¶
- Linux
export CRED_PROXY=proxy.company.com export CRED_PORT=8081
- Windows
//windows set CRED_PROXY=proxy.company.com set CRED_PORT=8081
FideliusClient fideliusClient = new FideliusClient(); // or AWSCredentialsProvider provider = new DefaultAWSCredentialsProviderChain(); FideliusClient fideliusClient = new FideliusClient(Regions.US_EAST_1.getName());