You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
App Mesh has released IPv6 support. This has been exposed in the form of IP preferences which have been added to the Mesh and Virtual Node resources. IP preferences are optional for both resources and there is no default IP preference that is applied by App Mesh.
The following are samples of App Mesh resources with IP preferences configured.
```
# Mesh
"spec": {
"serviceDiscovery": {
"ipPreference": "IPv6_PREFERRED"
}
}
```
```
# Virtual Node
"spec": {
"listeners": [
{
"healthCheck": {
"healthyThreshold": 2,
"intervalMillis": 5000,
"path": "/ping",
"protocol": "http",
"timeoutMillis": 2000,
"unhealthyThreshold": 2
},
"portMapping": {
"port": 9080,
"protocol": "http"
}
}
],
"serviceDiscovery": {
"dns": {
"hostname": "colorteller-red.default.svc.cluster.local",
"ipPreference": "IPv4_ONLY"
}
}
}
```
IP preferences on a Mesh apply the preference to all Virtual Nodes contained within that Mesh. IP preferences set on a Virtual Node will only apply to that particular Virtual Node. Additionally, Virtual Node IP preferences will override the Mesh IP preference if there is one present.
There are three areas in which the IP preference impacts how Envoy configuration generation. Firstly, setting any IP preference will change the Envoy's listeners (ingress and egress) to bind to IPv4 and IPv6 allowing the Envoy to serve all traffic from both IP versions. Secondly, the IP version specified in the name of the preference will be the IP version used for sending traffic to the local application for Envoys running as a sidecar to an application. (IPv4_ONLY/PREFERRED - IPv4, IPv6_ONLY/PREFERRED - IPv6) Lastly, it will impact how each service discovery option will be treated. For CloudMap service discovery, ONLY options will only return IPs from CloudMap for the matching version type and PREFERRED options will first used the primary IP version first and fall back to the other IP version for the IPs returned from CloudMap. For DNS service discovery, it will be similar to CloudMap service discovery in terms of only using one IP version or fall back behavior. However, this will come in the form of changing the Envoy's DNS resolver to exhibit this behavior when performing DNS resolution.
This is a summarized version of the feature. For more details, a more thorough write up can be found here: https://github.com/aws/aws-app-mesh-examples/tree/main/walkthroughs/howto-ipv6#ip-preferences-in-meshes-and-virtual-nodesCloses#20737
### All Submissions:
* [Y] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)
### Adding new Unconventional Dependencies:
* [N] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)
### New Features
* [Y] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
* [Y] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
An `ipPreference` can be specified as part of a Virtual Node's service discovery. An IP preference defines how clients for this Virtual Node will interact with it.
442
+
443
+
There a four different IP preferences available to use which each specify what IP versions this Virtual Node will use and prefer.
444
+
445
+
-`IPv4_ONLY` - Only use IPv4. For CloudMap service discovery, only IPv4 addresses returned from CloudMap will be used. For DNS service discovery, Envoy's DNS resolver will only resolve DNS queries for IPv4.
446
+
447
+
-`IPv4_PREFERRED` - Prefer IPv4 and fall back to IPv6. For CloudMap service discovery, an IPv4 address will be used if returned from CloudMap. Otherwise, an IPv6 address will be used if available. For DNS service discovery, Envoy's DNS resolver will first attempt to resolve DNS queries using IPv4 and fall back to IPv6.
448
+
449
+
-`IPv6_ONLY` - Only use IPv6. For CloudMap service discovery, only IPv6 addresses returned from CloudMap will be used. For DNS service discovery, Envoy's DNS resolver will only resolve DNS queries for IPv6.
450
+
451
+
-`IPv6_PREFERRED` - Prefer IPv6 and fall back to IPv4. For CloudMap service discovery, an IPv6 address will be used if returned from CloudMap. Otherwise, an IPv4 address will be used if available. For DNS service discovery, Envoy's DNS resolver will first attempt to resolve DNS queries using IPv6 and fall back to IPv4.
452
+
453
+
```ts
454
+
const mesh =newappmesh.Mesh(stack, 'mesh', {
455
+
meshName: 'mesh-with-preference',
456
+
});
457
+
458
+
// Virtual Node with DNS service discovery and an IP preference
0 commit comments