VirtualNodeListener

class aws_cdk.aws_appmesh.VirtualNodeListener

Bases: object

Defines listener for a VirtualNode.

ExampleMetadata

infused

Example:

# mesh: appmesh.Mesh
vpc = ec2.Vpc(self, "vpc")
namespace = cloudmap.PrivateDnsNamespace(self, "test-namespace",
    vpc=vpc,
    name="domain.local"
)
service = namespace.create_service("Svc")
node = mesh.add_virtual_node("virtual-node",
    service_discovery=appmesh.ServiceDiscovery.cloud_map(service),
    listeners=[appmesh.VirtualNodeListener.http(
        port=8081,
        health_check=appmesh.HealthCheck.http(
            healthy_threshold=3,
            interval=cdk.Duration.seconds(5),  # minimum
            path="/health-check-path",
            timeout=cdk.Duration.seconds(2),  # minimum
            unhealthy_threshold=2
        )
    )],
    access_log=appmesh.AccessLog.from_file_path("/dev/stdout")
)

Methods

abstract bind(scope)

Binds the current object when adding Listener to a VirtualNode.

Parameters

scope (Construct) –

Return type

VirtualNodeListenerConfig

Static Methods

classmethod grpc(*, connection_pool=None, health_check=None, outlier_detection=None, port=None, timeout=None, tls=None)

Returns an GRPC Listener for a VirtualNode.

Parameters
  • connection_pool (Union[GrpcConnectionPool, Dict[str, Any], None]) – Connection pool for http listeners. Default: - None

  • health_check (Optional[HealthCheck]) – The health check information for the listener. Default: - no healthcheck

  • outlier_detection (Union[OutlierDetection, Dict[str, Any], None]) – Represents the configuration for enabling outlier detection. Default: - none

  • port (Union[int, float, None]) – Port to listen for connections on. Default: - 8080

  • timeout (Union[GrpcTimeout, Dict[str, Any], None]) – Timeout for GRPC protocol. Default: - None

  • tls (Union[ListenerTlsOptions, Dict[str, Any], None]) – Represents the configuration for enabling TLS on a listener. Default: - none

Return type

VirtualNodeListener

classmethod http(*, connection_pool=None, health_check=None, outlier_detection=None, port=None, timeout=None, tls=None)

Returns an HTTP Listener for a VirtualNode.

Parameters
  • connection_pool (Union[HttpConnectionPool, Dict[str, Any], None]) – Connection pool for http listeners. Default: - None

  • health_check (Optional[HealthCheck]) – The health check information for the listener. Default: - no healthcheck

  • outlier_detection (Union[OutlierDetection, Dict[str, Any], None]) – Represents the configuration for enabling outlier detection. Default: - none

  • port (Union[int, float, None]) – Port to listen for connections on. Default: - 8080

  • timeout (Union[HttpTimeout, Dict[str, Any], None]) – Timeout for HTTP protocol. Default: - None

  • tls (Union[ListenerTlsOptions, Dict[str, Any], None]) – Represents the configuration for enabling TLS on a listener. Default: - none

Return type

VirtualNodeListener

classmethod http2(*, connection_pool=None, health_check=None, outlier_detection=None, port=None, timeout=None, tls=None)

Returns an HTTP2 Listener for a VirtualNode.

Parameters
  • connection_pool (Union[Http2ConnectionPool, Dict[str, Any], None]) – Connection pool for http2 listeners. Default: - None

  • health_check (Optional[HealthCheck]) – The health check information for the listener. Default: - no healthcheck

  • outlier_detection (Union[OutlierDetection, Dict[str, Any], None]) – Represents the configuration for enabling outlier detection. Default: - none

  • port (Union[int, float, None]) – Port to listen for connections on. Default: - 8080

  • timeout (Union[HttpTimeout, Dict[str, Any], None]) – Timeout for HTTP protocol. Default: - None

  • tls (Union[ListenerTlsOptions, Dict[str, Any], None]) – Represents the configuration for enabling TLS on a listener. Default: - none

Return type

VirtualNodeListener

classmethod tcp(*, connection_pool=None, health_check=None, outlier_detection=None, port=None, timeout=None, tls=None)

Returns an TCP Listener for a VirtualNode.

Parameters
  • connection_pool (Union[TcpConnectionPool, Dict[str, Any], None]) – Connection pool for http listeners. Default: - None

  • health_check (Optional[HealthCheck]) – The health check information for the listener. Default: - no healthcheck

  • outlier_detection (Union[OutlierDetection, Dict[str, Any], None]) – Represents the configuration for enabling outlier detection. Default: - none

  • port (Union[int, float, None]) – Port to listen for connections on. Default: - 8080

  • timeout (Union[TcpTimeout, Dict[str, Any], None]) – Timeout for TCP protocol. Default: - None

  • tls (Union[ListenerTlsOptions, Dict[str, Any], None]) – Represents the configuration for enabling TLS on a listener. Default: - none

Return type

VirtualNodeListener