How to get AKS namespace deployment YAML details using Terraform

This is regarding a technical query we are trying to achieve.

Query:

  1. We would like to get deployment details of namespace related to a private AKS cluster.
  2. Here is the equivalent kubectl command that we are trying to achieve using terraform : ‘kubectl get deployment -n $(namespace) -o yaml’

We are able to get namespace details of kubernetes using below terraform data block,

data “kubernetes_namespace” “example”

{

metadata

{

name = “sample-namespace”

}

}

But we are unable to get namespace deployment details, how to get those details, could you please help us achieve this.