I am looking to write a test with the aws-sdk-cpp so that it connects to localstack.
From cli I can do:
aws --endpoint-url=http://localhost:4576 sqs list-queues
How to achieve this with aws-sdk-cpp ?
I have tried to override the url in config, but this way the client times out:
Aws::Client::ClientConfiguration config;
clientConfiguration.endpointOverride = "http://localhost:4576";
sqsClient = Aws::SQS::SQSClient( credentialsProvider, config );
This fixed it:
clientConfiguration.endpointOverride = "localhost:4576"; // remove the http:// part
clientConfiguration.scheme = Aws::Http::Scheme::HTTP; // the default is HTTPS, which will cause signature-v4 to sign with localhost, and it won't match
Most helpful comment
This fixed it: