apiVersion: appmesh.k8s.aws/v1beta2
kind: VirtualNode
metadata:
  name: yelb-ui
  namespace: yelb
spec:
  backendDefaults:
    clientPolicy:
      tls:
        enforce: true,
          validation:
            trust:
              acm:
                certificateAuthorityArns: CA_ARN              
  podSelector:
    matchLabels:
      app: yelb-ui
  listeners:
    - portMapping:
        port: 4567
        protocol: http
    - tls:
        mode: STRICT
        certificate:
          acm:
             certificateArn: <FRONTEND_CERTIFICATE_ARN>          
        protocol: http        
  serviceDiscovery:
    dns:
      hostname: yelb-ui.yelb.svc.cluster.local
  backends:
    - virtualService:
       virtualServiceARN: <Enter the virtualService ARN of yelb-appserver>

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