Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

General configuration using Aws::SDKOptions in the AWS SDK for C++

Focus mode
General configuration using Aws::SDKOptions in the AWS SDK for C++ - AWS SDK for C++

The Aws::SDKOptions struct contains SDK configuration options. Aws::SDKOptions focuses on general SDK configuration, whereas the ClientConfiguration struct focuses on configuration of communicating with AWS services.

An instance of Aws::SDKOptions is passed to the Aws::InitAPI and Aws::ShutdownAPI methods. The same instance should be sent to both methods.

The following samples demonstrate some of the available options.

  • Turn logging on using the default logger

    Aws::SDKOptions options; options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Info; Aws::InitAPI(options); { // make your SDK calls here. } Aws::ShutdownAPI(options);
  • Override the default HTTP client factory

    Aws::SDKOptions options; options.httpOptions.httpClientFactory_create_fn = [](){ return Aws::MakeShared<MyCustomHttpClientFactory>( "ALLOC_TAG", arg1); }; Aws::InitAPI(options); { // make your SDK calls here. } Aws::ShutdownAPI(options);
    Note

    httpOptions takes a closure (also called an anonymous function or lambda expression) rather than a std::shared_ptr. Each of the SDK factory functions operates in this manner because at the time at which the factory memory allocation occurs, the memory manager has not yet been installed. By passing a closure to the method, the memory manager will be called to perform the memory allocation when it is safe to do so. A simple technique to accomplish this procedure is by using a Lambda expression.

  • Use a global SIGPIPE handler

    If you build the SDK for C++ with curl and OpenSSL, you must specify a signal handler. If you don’t use your own custom signal handler, set installSigPipeHandler to true.

    Aws::SDKOptions options; options.httpOptions.installSigPipeHandler = true; Aws::InitAPI(options); { // make your SDK calls here. } Aws::ShutdownAPI(options);

    When installSigPipeHandler is true, the SDK for C++ uses a handler that ignores SIGPIPE signals. For more information on SIGPIPE, see Operation Error Signals on the GNU Operating System website. For more information on the curl handler, see CURLOPT_NOSIGNAL explained on the curl website.

    The underlying libraries of curl and OpenSSL can send a SIGPIPE signal to notify when the remote side closes a connection. These signals must be handled by the application. For more information this curl functionality, see libcurl thread safety on the curl website. This behavior is not automatically built-in to the SDK because signal handlers are global for each application and the library is a dependency for the SDK.

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.