Description
Hi,
I have been using SDB for 5 or 6 years, mostly the PHP SDK and the iOS SDK.
This morning, I tried to use the C++ SDK but I had 2 blocking issues.
Problem #1: Credential issue
Aws::SDKOptions options;
options.loggingOptions.logLevel = Aws::Utils::Logging::LogLevel::Trace;
Aws::InitAPI(options);
Client::ClientConfiguration config;
config.region = Region::US_WEST_1;
auto credentials = Aws::MakeShared<Aws::Auth::DefaultAWSCredentialsProviderChain>("default");
auto sdb = Aws::MakeShared<SimpleDB::SimpleDBClient>("myAllocTag", credentials, config);
SimpleDB::Model::ListDomainsRequest sdbRequest;
auto sdbResult = sdb->ListDomains(sdbRequest);
if (sdbResult.IsSuccess())
std::cout << "SDB: success" << std::endl;
else
std::cerr << "SDB: failure" << std::endl << sdbResult.GetError().GetMessage() << std::endl;
Aws::ShutdownAPI(options);
SDB: failure
Unable to parse ExceptionName: AuthFailure Message: AWS was not able to authenticate the request: access credentials are missing
Note that the dynamo implementation works:
DynamoDB::Model::ListTablesRequest dynamoRequest;
auto dynamoResult = dynamo->ListTables(dynamoRequest);
if (dynamoResult.IsSuccess())
std::cout << "Dynamo: success" << std::endl;
else
std::cerr << "Dynamo: failure" << std::endl << dynamoResult.GetError().GetMessage() << std::endl;
Dynamo: success
I also tried to hardcode the keys (Auth::AWSCredentials credentials("MY_ACCESS_KEY", "MY_SECRET_KEY");), but I still get the same error.
NB: I am 100% sure that the key is correct (I use it successfully with SDB-PHP).
Problem #2: US-EAST-1 does not work!
In my previous example, if I replace: Region::US_WEST_1 by Region::US_EAST_1, I get another error:
Unable to connect to endpoint
It seems that the URI is wrong: sdb->m_uri is "https://sdb.us-east-1.amazonaws.com" instead of "https://sdb.amazonaws.com".
Any help would be appreciated.
-Gilles