DnsResponseType

class aws_cdk.aws_appmesh.DnsResponseType(value)

Bases: Enum

Enum of DNS service discovery response type.

ExampleMetadata:

infused

Example:

# A Virtual Node with a gRPC listener with a connection pool set
# mesh: appmesh.Mesh

node = appmesh.VirtualNode(self, "node",
    mesh=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
    service_discovery=appmesh.ServiceDiscovery.dns("node", appmesh.DnsResponseType.ENDPOINTS),
    listeners=[appmesh.VirtualNodeListener.http(
        port=80,
        connection_pool=appmesh.HttpConnectionPool(
            max_connections=100,
            max_pending_requests=10
        )
    )]
)

# A Virtual Gateway with a gRPC listener with a connection pool set
gateway = appmesh.VirtualGateway(self, "gateway",
    mesh=mesh,
    listeners=[appmesh.VirtualGatewayListener.grpc(
        port=8080,
        connection_pool=appmesh.GrpcConnectionPool(
            max_requests=10
        )
    )],
    virtual_gateway_name="gateway"
)

Attributes

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.

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.