<p>How do I do this but in terraform using <code>kubernetes</code> provider??</p>
<pre><code>kubectl apply -k &quot;github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/?ref=release-1.4&quot;
</code></pre>
<p>I have searched for a few, but none mention applying a direct yaml file.</p>

bonijad383
<p>You can achieve that differently; if that works for you. You want to execute <code>kubectl</code> from Terraform, not communicating directly with the Kubernetes API.</p>
<p>I think this method has more advantages than what you originally asking for, because it removes an external dependency.</p>
<p>There's a <a href="https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/resources/kubectl_manifest" rel="nofollow noreferrer"><code>kubectl</code> provider</a> you can use. You can download the YAML and commit it with your Terraform code. That way it is also easier to review changes to the YAML (between versions).</p>
<p>It would look something like this:</p>
<pre><code>resource &quot;kubectl_manifest&quot; &quot;test&quot; {
    yaml_body = &lt;&lt;YAML
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
    azure/frontdoor: enabled
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: &quot;Prefix&quot;
        backend:
          serviceName: test
          servicePort: 80
YAML
}
</code></pre>
