Configuring service clients in the Amazon SDK for Java 2.x - Amazon SDK for Java 2.x
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Configuring service clients in the Amazon SDK for Java 2.x

To programmatically access Amazon Web Services services, the SDK for Java 2.x uses a client object for each Amazon Web Services service. For example, if your application needs to access Amazon EC2, you create an Amazon EC2 client object—an instance of the Ec2Client class—to interface with that service. You then use the service client to make requests to that Amazon Web Services service. For most applications, you can use a singleton instance of a service client.

There are many ways to configure SDK behavior, but ultimately everything has to do with the behavior of service clients. Any configuration has no effect until your code creates a service client that uses the configuration.

Examples of the configuration that you provide are:

  • How your code authenticates with Amazon when you call a service

  • The Amazon Web Services Region you want a service client to use

  • Retry and timeout settings for service calls

  • HTTP proxy configuration

Refer to the Amazon SDKs and Tools Reference Guide for settings, features, and other foundational concepts common to many of the Amazon SDKs.