sqs: add ability to define the external port #1047
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First, thanks for your amazing work on
localstack
!Please treat this as a start of a conversation rather than a full-featured PR. I'm not certain that this is the right direction and would love your feedback.
Motivation
The issue I'm having is that I'm running
localstack
behind a proxy, which is running on a specific host (which is covered byHOSTNAME_EXTERNAL
, but is also on a different port from that of the proxy. So, when SQS returns the queue URL it returns theHOSTNAME_EXTERNAL
that I set, but returns the local port and not the port that the client requests the proxy with.[proxy:80]
->[localstack:4576]
->[elasticmq:4561]
What I've done at the moment, is I've set my SQS port to
:80
(which is what my proxy wants). This works, but in my opinion is more of a workaround because any other service needs to return a URL pointing back to itself, I will not be able to also put it on:80
as it will be taken by SQS.Proposed solution
So, the solution I'm proposing is to define a
<SERVICE>_PORT_EXTERNAL
and use that along withHOSTNAME_EXTERNAL
. Alternatively (and if there are no plans to useHOSTNAME_EXTERNAL
as a single external hostname for all services) we can change it to something like<SERVICE>_EXTERNAL_URI
, which would be ahost:port
combination specific to a service.