AWS_CONFIG_FILE doesn't work, is it by-design?

I set up AWS_CONFIG_FILE and AWS_SHARED_CREDENTIALS_FILE on my machine like these:

  • AWS_CONFIG_FILE
[default]
region = ap-northeast-2
output = json
  • AWS_SHARED_CREDENTIALS_FILE
[default]
aws_access_key_id = XXX
aws_secret_access_key = XXX

Whenever I try to connect to GameLift Service with these configuration files on AWS CLI, both of the files works well.

But if I try to do it on C++ SDK, AWS_SHARED_CREDENTIALS_FILE works well, but AWS_CONFIG_FILE doesn’t work.
I should have configure region in source code like GomokuMatchmaker:

	void MatchMaker::SetUpAwsClient(const std::string& region)
{
Aws::Client::ClientConfiguration config;
config.region = region;
mGLClient = Aws::MakeShared<Aws::GameLift::GameLiftClient>("GameLiftMatchMaker", config);
}

Is it by-design,
Or I’m missing something?

Thanks. (*)

The client is constructed using the common approach of the AWS C++ SDK so our client is no different than other AWS clients.

It does seem the AW C++ SDK does not use the AWS_CONFIG_FILE where as the CLI does:

https://stackoverflow.com/questions/44139784/cant-set-region-in-aws-c-sdk

Region has to be explicitly set or you can use the AWSConfigFileProfileConfigLoader to read in these values.