aws-cdk-lib.aws_appmesh.DnsResponseType

enum DnsResponseType

LanguageType name
.NETAmazon.CDK.AWS.AppMesh.DnsResponseType
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsappmesh#DnsResponseType
Javasoftware.amazon.awscdk.services.appmesh.DnsResponseType
Pythonaws_cdk.aws_appmesh.DnsResponseType
TypeScript (source)aws-cdk-lib » aws_appmesh » DnsResponseType

Enum of DNS service discovery response type.

Example

// A Virtual Node with a gRPC listener with a connection pool set
declare const mesh: appmesh.Mesh;
const node = new appmesh.VirtualNode(this, 'node', {
  mesh,
  // DNS service discovery can optionally specify the DNS response type as either LOAD_BALANCER or ENDPOINTS.
  // LOAD_BALANCER means that the DNS resolver returns a loadbalanced set of endpoints,
  // whereas ENDPOINTS means that the DNS resolver is returning all the endpoints.
  // By default, the response type is assumed to be LOAD_BALANCER
  serviceDiscovery: appmesh.ServiceDiscovery.dns('node', appmesh.DnsResponseType.ENDPOINTS),
  listeners: [appmesh.VirtualNodeListener.http({
    port: 80,
    connectionPool: {
      maxConnections: 100,
      maxPendingRequests: 10,
    },
  })],
});

// A Virtual Gateway with a gRPC listener with a connection pool set
const gateway = new appmesh.VirtualGateway(this, 'gateway', {
  mesh,
  listeners: [appmesh.VirtualGatewayListener.grpc({
    port: 8080,
    connectionPool: {
      maxRequests: 10,
    },
  })],
  virtualGatewayName: 'gateway',
});

Members

NameDescription
LOAD_BALANCERDNS resolver returns a loadbalanced set of endpoints and the traffic would be sent to the given endpoints.
ENDPOINTSDNS resolver is returning all the endpoints.

LOAD_BALANCER

DNS resolver returns a loadbalanced set of endpoints and the traffic would be sent to the given endpoints.

It would not drain existing connections to other endpoints that are not part of this list.


ENDPOINTS

DNS resolver is returning all the endpoints.

This also means that if an endpoint is missing, it would drain the current connections to the missing endpoint.