How can i set up an ingress on terraform with multiple host?

1/14/2022

What i need to do is to create something like this...

<!-- begin snippet: js hide: false console: true babel: false --><!-- language: lang-html -->
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test-webapp-ingress
  annotations:
    ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - host: test-webapp-frontend.com
    http:
      paths:
        - path: /
          backend:
            serviceName: test-webapp-frontend-lb
            servicePort: 8002
  - host: test-webapp-api.com
    http:
      paths:
        - path: /get
          backend:
            serviceName: test-webapp-api-lb
            servicePort: 8001
<!-- end snippet -->

But i need to do it on terraform. Does anyone have any idea how to do this? I could really use a hand.

-- Emi Licha
kubernetes
terraform

0 Answers