VirtualNodeProps

class aws_cdk.aws_appmesh.VirtualNodeProps(*, access_log=None, backend_defaults=None, backends=None, listeners=None, service_discovery=None, virtual_node_name=None, mesh)

Bases: aws_cdk.aws_appmesh.VirtualNodeBaseProps

The properties used when creating a new VirtualNode.

Parameters
  • access_log (Optional[AccessLog]) – Access Logging Configuration for the virtual node. Default: - No access logging

  • backend_defaults (Optional[BackendDefaults]) – Default Configuration Virtual Node uses to communicate with Virtual Service. Default: - No Config

  • backends (Optional[Sequence[Backend]]) – Virtual Services that this is node expected to send outbound traffic to. Default: - No backends

  • listeners (Optional[Sequence[VirtualNodeListener]]) – Initial listener for the virtual node. Default: - No listeners

  • service_discovery (Optional[ServiceDiscovery]) – Defines how upstream clients will discover this VirtualNode. Default: - No Service Discovery

  • virtual_node_name (Optional[str]) – The name of the VirtualNode. Default: - A name is automatically determined

  • mesh (IMesh) – The Mesh which the VirtualNode belongs to.

Example:

# mesh is of type Mesh
# service is of type Service


node = appmesh.VirtualNode(self, "node",
    mesh=mesh,
    service_discovery=appmesh.ServiceDiscovery.cloud_map(service),
    listeners=[appmesh.VirtualNodeListener.http(
        port=8080,
        health_check=appmesh.HealthCheck.http(
            healthy_threshold=3,
            interval=cdk.Duration.seconds(5),
            path="/ping",
            timeout=cdk.Duration.seconds(2),
            unhealthy_threshold=2
        ),
        timeout=appmesh.HttpTimeout(
            idle=cdk.Duration.seconds(5)
        )
    )],
    backend_defaults=appmesh.BackendDefaults(
        tls_client_policy=appmesh.TlsClientPolicy(
            validation=appmesh.TlsValidation(
                trust=appmesh.TlsValidationTrust.file("/keys/local_cert_chain.pem")
            )
        )
    ),
    access_log=appmesh.AccessLog.from_file_path("/dev/stdout")
)

cdk.Tags.of(node).add("Environment", "Dev")

Attributes

access_log

Access Logging Configuration for the virtual node.

Default
  • No access logging

Return type

Optional[AccessLog]

backend_defaults

Default Configuration Virtual Node uses to communicate with Virtual Service.

Default
  • No Config

Return type

Optional[BackendDefaults]

backends

Virtual Services that this is node expected to send outbound traffic to.

Default
  • No backends

Return type

Optional[List[Backend]]

listeners

Initial listener for the virtual node.

Default
  • No listeners

Return type

Optional[List[VirtualNodeListener]]

mesh

The Mesh which the VirtualNode belongs to.

Return type

IMesh

service_discovery

Defines how upstream clients will discover this VirtualNode.

Default
  • No Service Discovery

Return type

Optional[ServiceDiscovery]

virtual_node_name

The name of the VirtualNode.

Default
  • A name is automatically determined

Return type

Optional[str]