Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Update docs for upstream resolution patterns #950

Merged
merged 2 commits into from
Dec 7, 2023

Conversation

simonrw
Copy link
Contributor

@simonrw simonrw commented Dec 5, 2023

Motivation

With localstack/localstack#9692 we deprecated the use of DNS_LOCAL_NAME_PATTERNS since it had a confusing name. Instead of adding domain name patterns to resolve to LocalStack, it added domain names to the skiplist of names that should always be resolved upstream. In particular, with transparent endpoint injection enabled, s3.amazonaws.com would resolve to LocalStack, and DNS_LOCAL_NAME_PATTERNS could force LocalStack to resolve the name from its upstream resolver.

Changes

  • Update all usages of DNS_LOCAL_NAME_PATTERNS to use the new DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM variable

TODO

@simonrw simonrw self-assigned this Dec 5, 2023
Copy link

github-actions bot commented Dec 5, 2023

🎊 PR Preview has been successfully built and deployed to https://localstack-docs-preview-pr-950.surge.sh 🎊

@simonrw simonrw marked this pull request as ready for review December 6, 2023 16:26
Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we always provide an explicit migration path when deprecating variables.

Added some other minor suggestions

@@ -309,7 +309,8 @@ To learn more about these configuration options, see [DNS Server]({{< ref "dns-s
| `DNS_ADDRESS` | `0.0.0.0` (default) | Address the LocalStack should bind the DNS server on (port 53 tcp/udp). Value `0` to disable.
| `DNS_SERVER` | Default upstream DNS or `8.8.8.8` (default) | Fallback DNS server for queries not handled by LocalStack.
| `DNS_RESOLVE_IP` | `127.0.0.1` (default) | IP address the DNS server should return as A record for queries handled by LocalStack. If customized, this value will be returned in preference to the DNS server response.
| `DNS_LOCAL_NAME_PATTERNS` | `.*(ecr\|lambda).*.amazonaws.com` (example) | Skiplist of hostnames that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
| `DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM` | | Skiplist of domain names that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
| `DNS_LOCAL_NAME_PATTERNS` | `.*(ecr\|lambda).*.amazonaws.com` (example) | **Deprecated since 3.0.0** Skiplist of domain names that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be 3.0.2 (technically 🤔 )

(sidenote: It would be useful to add the version since it is supported in the future. Lots of 🚧 in config management ...)

@@ -309,7 +309,8 @@ To learn more about these configuration options, see [DNS Server]({{< ref "dns-s
| `DNS_ADDRESS` | `0.0.0.0` (default) | Address the LocalStack should bind the DNS server on (port 53 tcp/udp). Value `0` to disable.
| `DNS_SERVER` | Default upstream DNS or `8.8.8.8` (default) | Fallback DNS server for queries not handled by LocalStack.
| `DNS_RESOLVE_IP` | `127.0.0.1` (default) | IP address the DNS server should return as A record for queries handled by LocalStack. If customized, this value will be returned in preference to the DNS server response.
| `DNS_LOCAL_NAME_PATTERNS` | `.*(ecr\|lambda).*.amazonaws.com` (example) | Skiplist of hostnames that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
| `DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM` | | Skiplist of domain names that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
| `DNS_LOCAL_NAME_PATTERNS` | `.*(ecr\|lambda).*.amazonaws.com` (example) | **Deprecated since 3.0.0** Skiplist of domain names that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a migration path?
Renamed to DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM

@@ -309,7 +309,8 @@ To learn more about these configuration options, see [DNS Server]({{< ref "dns-s
| `DNS_ADDRESS` | `0.0.0.0` (default) | Address the LocalStack should bind the DNS server on (port 53 tcp/udp). Value `0` to disable.
| `DNS_SERVER` | Default upstream DNS or `8.8.8.8` (default) | Fallback DNS server for queries not handled by LocalStack.
| `DNS_RESOLVE_IP` | `127.0.0.1` (default) | IP address the DNS server should return as A record for queries handled by LocalStack. If customized, this value will be returned in preference to the DNS server response.
| `DNS_LOCAL_NAME_PATTERNS` | `.*(ecr\|lambda).*.amazonaws.com` (example) | Skiplist of hostnames that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
| `DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM` | | Skiplist of domain names that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider linking to the DNS server page for more details: https://docs.localstack.cloud/user-guide/tools/dns-server/#skip-localstack-dns-resolution

@@ -309,7 +309,8 @@ To learn more about these configuration options, see [DNS Server]({{< ref "dns-s
| `DNS_ADDRESS` | `0.0.0.0` (default) | Address the LocalStack should bind the DNS server on (port 53 tcp/udp). Value `0` to disable.
| `DNS_SERVER` | Default upstream DNS or `8.8.8.8` (default) | Fallback DNS server for queries not handled by LocalStack.
| `DNS_RESOLVE_IP` | `127.0.0.1` (default) | IP address the DNS server should return as A record for queries handled by LocalStack. If customized, this value will be returned in preference to the DNS server response.
| `DNS_LOCAL_NAME_PATTERNS` | `.*(ecr\|lambda).*.amazonaws.com` (example) | Skiplist of hostnames that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
| `DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM` | | Skiplist of domain names that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing example value (better provide the example with the current config)

@@ -309,7 +309,8 @@ To learn more about these configuration options, see [DNS Server]({{< ref "dns-s
| `DNS_ADDRESS` | `0.0.0.0` (default) | Address the LocalStack should bind the DNS server on (port 53 tcp/udp). Value `0` to disable.
| `DNS_SERVER` | Default upstream DNS or `8.8.8.8` (default) | Fallback DNS server for queries not handled by LocalStack.
| `DNS_RESOLVE_IP` | `127.0.0.1` (default) | IP address the DNS server should return as A record for queries handled by LocalStack. If customized, this value will be returned in preference to the DNS server response.
| `DNS_LOCAL_NAME_PATTERNS` | `.*(ecr\|lambda).*.amazonaws.com` (example) | Skiplist of hostnames that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
| `DNS_NAME_PATTERNS_TO_RESOLVE_UPSTREAM` | | Skiplist of domain names that should *NOT* be resolved to the LocalStack container, as a comma-separated list of Python-flavored regex patterns.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: ideally, we adjust the explanation to the new naming (rather than skip, explain that these are always resolved by upstream)

@simonrw simonrw requested a review from joe4dev December 7, 2023 16:12
Copy link
Member

@joe4dev joe4dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@simonrw simonrw merged commit 676c260 into main Dec 7, 2023
@simonrw simonrw deleted the document-dns-upstream-config branch December 7, 2023 16:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants