Localstack: configure aws-sdk-cpp to connect to localstack

Created on 4 Oct 2017  路  1Comment  路  Source: localstack/localstack

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 );

needs-triaging question

Most helpful comment

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

>All comments

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
Was this page helpful?
0 / 5 - 0 ratings