title: Terraform external data source EKS thumbprint not working sometimes
body: <p>I've tried to retrieve the existing EKS certificate thumbprint with Terraform's external datasource with the following code:</p>
  <p><strong>thumbprint.sh</strong></p>
  <pre><code>#!/bin/bash
  
  THUMBPRINT=$(echo | openssl s_client -servername oidc.eks.${1}.amazonaws.com -showcerts -connect oidc.eks.${1}.amazonaws.com:443 2&gt;&amp;- | tac | sed -n '/-----END CERTIFICATE-----/,/-----BEGIN CERTIFICATE-----/p; /-----BEGIN CERTIFICATE-----/q' | tac | openssl x509 -fingerprint -noout | sed 's/://g' | awk -F= '{print tolower($2)}')
  THUMBPRINT_JSON=&quot;{\&quot;thumbprint\&quot;: \&quot;${THUMBPRINT}\&quot;}&quot;
  echo $THUMBPRINT_JSON
  </code></pre>
  <p><strong>data.tf</strong></p>
  <pre><code>data &quot;external&quot; &quot;thumbprint&quot; {
    program = [&quot;${path.root}/scripts/thumbprint.sh&quot;, data.aws_region.current.name]
  }
  </code></pre>
  <p><strong>openid.tf</strong></p>
  <pre><code>resource &quot;aws_iam_openid_connect_provider&quot; &quot;openid&quot; {
    depends_on      = [data.external.thumbprint]
    client_id_list  = [&quot;sts.amazonaws.com&quot;]
    thumbprint_list = [data.external.thumbprint.result.thumbprint]
    url             = data.aws_eks_cluster.this.identity.0.oidc.0.issuer
  }
  </code></pre>
  <p>And to get the thumbprint from the above data source with <code>data.external.thumbprint.result.thumbprint</code>.</p>
  <p>The main problem is I am confused that sometimes I got data from <strong>thumbprint</strong> and sometimes it goes <code>blank</code> value even though I've added <code>depends_on</code>. How can I fix this? Or is there a better approach?</p>