I am trying to call a lambda function. user configuration file: ``` [default] region = us-west-2 ``` ARN: arn:aws:lambda:us-west-2:468131460318:function:sct_mail_20161103144602 I use the following code: ``` ... Aws::SDKOptions options; Aws::InitAPI(options); LambdaClient client; InvokeRequest invokeRequest; invokeRequest.SetFunctionName("arn:aws:lambda:us-west-2:468131460318:function:sct_mail_20161103144602"); invokeRequest.SetInvocationType(InvocationType::RequestResponse); InvokeOutcome invokeOutcome = client.Invoke(invokeRequest); ... ``` I receive an error: Functions from 'us-west-2' are not reachable in this region ('us-east-1') Region which is specified in the configuration is not used when working with lambda? How to use region settings from config file? EC2 instance, Amazon Linux, AWS_SDK_VERSION_STRING "1.0.24" Thanks!
Activity
JonathanHenson commentedon Nov 15, 2016
You need to set the client configuration in your LambdaClient constructor. See Aws::Client::ClientConfiguration. If you want to load the config from your profile config file or from EC2 Metadata service, see: https://sdk.amazonaws.com/cpp/api/LATEST/class_aws_1_1_config_1_1_a_w_s_profile_config_loader.html