I have been using the endpoint address as localhost:4566 and recently faced an issue that S3 did not work when using this address.
From this answer, I had 2 solutions, #1 change the option to use PathStyle when running the server locally #2 change the LocalStack endpoint address to localhost.localstack.cloud:4566
So in my case #2 worked well and I am happy with it. The thing is, if using this address is perfect, why do most of the examples in the documents use localhost:4566? Can you replace it with localhost.localstack.cloud:4566?
If not, is there anything I have to worry about when using localhost.localstack.cloud:4566? like this address will be unavailable someday?
Hi @seungduk , thanks for reporting. localhost.localstack.cloud is pretty much the recommended endpoint - especially for S3, in order to enable host-based bucket endpoints (as you’ve already pointed out). For most of the other services, it should be fine to use localhost:4566 as well.
You can generally rely on the localhost.localstack.cloud domain to be publicly resolvable, and we also publish an SSL certificate that is automatically used inside LocalStack, in order to enable HTTPS endpoints with valid certificates.
The main reason to use localhost instead of localhost.localstack.cloud is that some users are behind a corporate firewall or an internet service provider that does not allow resolving localhost.localstack.cloud properly. Hence, we are using localhost in most of our docs, to provide this fallback option to users.
Hope that helps - please let us know if there are any other questions… Thanks!