# IpPreference

Enum of supported IP preferences.

Used to dictate the IP version for mesh wide and virtual node service discovery.
Also used to specify the IP version that a sidecar Envoy uses when sending traffic to a local application.

- Source: [`aws-appmesh/lib/service-discovery.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-appmesh/lib/service-discovery.ts#L11)
- Type last changed: v2.30.0 · 1 Jul 2022

## Example

```ts
const mesh = new appmesh.Mesh(this, 'AppMesh', {
  meshName: 'myAwsMesh',
  serviceDiscovery: {
    ipPreference: appmesh.IpPreference.IPV4_ONLY,
  },
});
```

## Members

| Member | Description |
| --- | --- |
| `IPV4_ONLY` | Use IPv4 when sending traffic to a local application. |
| `IPV4_PREFERRED` | Use IPv4 when sending traffic to a local application. |
| `IPV6_ONLY` | Use IPv6 when sending traffic to a local application. |
| `IPV6_PREFERRED` | Use IPv6 when sending traffic to a local application. |

## Referenced by

- [`MeshServiceDiscovery`](/v2/docs/aws-cdk-lib.aws_appmesh.MeshServiceDiscovery).ipPreference
