title: AWS .NET SDK How to specify region when using Localstack
body: <h1>How do I instantiate a .NET AWSSDK SQS client that has both a custom Region and ServiceURL?</h1>
  <hr>
  <h3>More information:</h3>
  <p>I have a queue set up in localstack that I can verify is there through an <code>sqs list-queues</code> query using the CLI:</p>
  <pre><code>&gt; aws --endpoint-url=http://localhost:4566 --region=ap-southeast-2 sqs list-queues
  
  {
      &quot;QueueUrls&quot;: [
          &quot;http://localhost:4566/000000000000/question-renderer-requests-errors&quot;,
          &quot;http://localhost:4566/000000000000/question-renderer-requests&quot;
      ]
  }
  </code></pre>
  <p>The queues are in region <code>ap-southeast-2</code>, however when I try to access the queues through the SDK, it can't find anything:</p>
  <pre><code>var cred = new BasicAWSCredentials(&quot;test&quot;, &quot;test&quot;);
  
  var sqsClientConfig = new AmazonSQSConfig()
  {
      RegionEndpoint = RegionEndpoint.APSoutheast2,
      ServiceURL = &quot;http://localhost:4566&quot;
  };
  
  var sqsClient = new AmazonSQSClient(cred, sqsClientConfig);
  
  var queues = await sqsClient.ListQueuesAsync(new ListQueuesRequest());
  </code></pre>
  <p>I discovered that <code>RegionEndpoint</code> and <code>ServiceURL</code> are mutually exclusive:</p>
  <blockquote>
  <p>RegionEndpoint and ServiceURL are mutually exclusive properties.
  Whichever property is set last will cause the other to automatically
  be reset to null.</p>
  </blockquote>
  <p>I need the service endpoint set to <code>http://localhost:4566</code> to point to localstack, how do I also set the region endpoint? Am I going the right way about this?</p>
  <p>Update:
  I googled for the default region which is us-east-1, and when I put the queue in there the SDK managed to find it - so it must be a region configuring issue.</p>