-
Notifications
You must be signed in to change notification settings - Fork 131
Rework dns server and transparent endpoint injection #941
Conversation
🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-941.surge.sh 🎊 |
The DNS server page is still under the "transparent endpoint injection" section, is this a conscious decision? I think it would be better either at the top level in the user guide, or at least elevated to the "LocalStack tools" section, though it's not an external tool like the section naming suggests. |
@HarshCasper suggested the same in #866 and that makes sense if it would remain the only subsection I foresee that we are going to have 3 scenarios on how to connect to LocalStack:
Given that only the LS transparent endpoint injection is a real (internal) "tool", it might best to only cover that one here (including
Transparent endpoint injection and Lambda are also not really "external" tools (I think the term is used broadly for extra features beyond AWS emulation). I agree/suggest moving the "DNS server" to the top-level Tools section for now. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a huge improvement thanks, and most of my comments are suggestions I'll let you decide how to proceed, but the DNS_LOCAL_NAME_PATTERNS
section needs updating.
content/en/user-guide/tools/transparent-endpoint-injection/dns-server.md
Outdated
Show resolved
Hide resolved
{{< alert title="Warning" color="warning">}} | ||
Use this configuration with caution because we generally do not recommend connecting to real AWS from within LocalStack. | ||
{{< /alert >}} | ||
|
||
|
||
## Self-signed certificates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this step could remain with the TEI docs, since it is not specific to the DNS server but rather TEI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this option does indeed refer to DNS_LOCAL_NAME_PATTERNS
because skipping LocalStack resolution enables connecting to real AWS 🤔 (at least in it's original use)
I agree that it also fits for disabling transparent endpoint injection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that is disabling transparent endpoint injection, right?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, disabling transparent endpoint injection deserves a bigger warning than partially disabling it through ...
Maybe the thought was that people use alternative ways (custom DNS or manual endpoint injection) if they disable it completely.
👉 I added to both places for now because the effect is ultimately the same
content/en/user-guide/tools/transparent-endpoint-injection/dns-server.md
Outdated
Show resolved
Hide resolved
content/en/user-guide/tools/transparent-endpoint-injection/dns-server.md
Outdated
Show resolved
Hide resolved
content/en/user-guide/tools/transparent-endpoint-injection/dns-server.md
Outdated
Show resolved
Hide resolved
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0" | ||
``` | ||
|
||
If you are using the Java AWS SDK v2 in Lambda, you can opt in to automatically disable SSL validation using the configuration `LAMBDA_DISABLE_JAVA_SDK_V2_CERTIFICATE_VALIDATION=1`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dfangl @dominikschubert sadly, we missed making this breaking change upon v3 announced at the 2.3.0 release:
Transparent endpoint injection for Lambdas running AWS Java SDK v2 is now available with the feature flag LAMBDA_DISABLE_JAVA_SDK_V2_CERTIFICATE_VALIDATION=1 . This will be default behaviour by 3.0.
https://discuss.localstack.cloud/t/localstack-release-v2-3-0/533#other-changes-and-enhancements-14
Should we add it to the Lambda configurations (so we won't miss it at v4)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general config discussion: do we strive to have all defaults 0
for configurations?
If we ever change the default for a single config, it gets inconsistent. Hence avoiding double negations might be clearer in most cases 💭
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, thanks for making this sooo much clearer!
{{< alert title="Warning" color="warning">}} | ||
Use this configuration with caution because we generally do not recommend connecting to real AWS from within LocalStack. | ||
{{< /alert >}} | ||
|
||
|
||
## Self-signed certificates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But that is disabling transparent endpoint injection, right?!
Motivation
The current DNS server page is badly outdated, misleading, and incomplete. With the increasing importance of DNS-based resolution in LocalStack networking, the DNS server page needs to be reworked.
Changes
DISABLE_TRANSPARENT_ENDPOINT_INJECTION
"Transparent Endpoint Injection"
instead of transparent execution modePreview
Discussion
AWS_ENDPOINT_URL
, this could be considered another implementation because it does transparently inject the endpoint. However, the configurationDISABLE_TRANSPARENT_ENDPOINT_INJECTION
could be confusing if we do not clarify that this specific implementation refers to the DNS-based implementation.DNS_SERVER
mentioned to be8.8.8.8
can be confusing because, in the current implementation, the upstream DNS will be used as default (i.e., typically the system DNS). That is also the reason why we need to explicitly set an external DNS server when configuring LocalStack as system DNS because otherwise, we would create an infinite loop ;)TODO
Follow Up
DNS_SKIP_LOCAL_RESOLUTION
Introduce DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM config localstack#9692