SQS queueUrl returns "...localhost:4566" rather than "...localhost.localstack.cloud:some-ext-port"

On my m1 mac, in a JUnit integration test, given :
container = new LocalStackContainer(3.2.0).withServices(SQS)
portBindings(some-ext-port:4566), where some-ext-port is a valid external port

  1. The SQS queueUrl returned to the aws client is of the form “sqs.queue_name.localhost:4566”. However, 4566 is the internal container port and won’t work for the integration test, and my understanding is that the queueUrl should be of the form “sqs.queue_name.localhost.localstack.cloud:some-ext-port”.

  2. I have tried the various combinations of setting SQS_ENDPOINT_STRATEGY (standard, domain), LOCALSTACK_HOST, HOSTNAME_EXTERNAL and the result is the same - the queueUrl is unusable. In fact if I set LOCALSTACK_HOST to “localhost.localstack.cloud:some-ext-port”, then queue creation no longer works via the awslocal command but there are no errors returned. The ALLOW_NONSTANDARD_REGIONS env var seems to not change the behavior - I have tried witih the default region and my own region name. The port bindings don’t seem to matter either, I have tried with the default bindings.

  3. For a combination of params in that allow queue creation to work, I attempt to ping the queueUrl hostname returned by localstack (…localstack:4566), but it is not reachable. The desired queueUrl hostname (…localhost.localstack.cloud:some-ext-port) - is reachable. So, it looks like the network is set up to allow proper mapping from “…localhost.localstack.cloud” to the localstack container.

  4. running “awslocal --region my-region sqs list-queues” returns the created queue but the queueUrl displayed is the one with “…localhost:4566”

How do I go about configuring the container so that it returns a usable queueUrl for the AWS client used in the JUnit integration test?