Skip to content
v2.278.0

IpPreference Enum ​

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.

Example ​

ts
const mesh = new appmesh.Mesh(this, 'AppMesh', {
  meshName: 'myAwsMesh',
  serviceDiscovery: {
    ipPreference: appmesh.IpPreference.IPV4_ONLY,
  },
});
python
mesh = appmesh.Mesh(self, "AppMesh",
    mesh_name="myAwsMesh",
    service_discovery=appmesh.MeshServiceDiscovery(
        ip_preference=appmesh.IpPreference.IPV4_ONLY
    )
)
java
Mesh mesh = Mesh.Builder.create(this, "AppMesh")
        .meshName("myAwsMesh")
        .serviceDiscovery(MeshServiceDiscovery.builder()
                .ipPreference(IpPreference.IPV4_ONLY)
                .build())
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var mesh = new Mesh(this, "AppMesh", new MeshProps {
    MeshName = "myAwsMesh",
    ServiceDiscovery = new MeshServiceDiscovery {
        IpPreference = IpPreference.IPV4_ONLY
    }
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
mesh := appmesh.NewMesh(this, jsii.String("AppMesh"), &MeshProps{
	MeshName: jsii.String("myAwsMesh"),
	ServiceDiscovery: &MeshServiceDiscovery{
		IpPreference: appmesh.IpPreference_IPV4_ONLY,
	},
})

Members ​

MemberDescription
IPV4_ONLYUse IPv4 when sending traffic to a local application.
IPV4_PREFERREDUse IPv4 when sending traffic to a local application.
IPV6_ONLYUse IPv6 when sending traffic to a local application.
IPV6_PREFERREDUse IPv6 when sending traffic to a local application.

Referenced by ​