apiVersion: appmesh.k8s.aws/v1beta2
kind: VirtualNode
metadata:
  name: yelb-db
  namespace: yelb
spec:
  backendDefaults:
    clientPolicy:
      tls:
        enforce: true,
          validation:
            trust:
              acm:
                certificateAuthorityArns: CA_ARN              
  podSelector:
    matchLabels:
      app: yelb-db
  listeners:
    - portMapping:
        port: 5432
        protocol: tcp
    - tls:
        mode: STRICT
        certificate:
          acm:
             certificateArn: <CERTIFICATE_ARN>          
        protocol: http        
  serviceDiscovery:
    dns:
      hostname: yelb-db.yelb.svc.cluster.local

---
apiVersion: appmesh.k8s.aws/v1beta2
kind: VirtualService
metadata:
  name: yelb-db
  namespace: yelb
spec:
  awsName: yelb-db
  provider:
    virtualNode:
      virtualNodeRef:
        name: yelb-db
