Error in building k8 objects when using terraform to create filebeat as a resource

I am trying to do something similar to this post: Terraform and helm_release - #7 by stuart-c

Here’s my filebeat config file (filebeat.yaml)

filebeatConfig:
  filebeat.yml: |
    filebeat.inputs:
      - type: log
        paths:
          - /usr/share/filebeat/logs/filebeat
    output.elasticsearch:
      hosts: '["my-host-url"]'
      api_key: "${EC_API_KEY}"

and referencing it in my filebeat.tf as below

resource "helm_release" "filebeat" {
  name       = "filebeat"
  repository = "https://helm.elastic.co"
  chart      = "filebeat"
  version    = "7.9.3"
  namespace  = "kube-system"

  values = [templatefile("${path.module}/filebeat.yaml", 
  {
    EC_API_KEY = var.EC_API_KEY
  })]


  depends_on = [
    ec_deployment.global
  ]

}

when I run terraform apply, I get this error:

helm_release.filebeat: Creating...
╷
│ Error: unable to build kubernetes objects from release manifest: [unable to recognize "": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1beta1", unable to recognize "": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"]
│ 
│   with helm_release.filebeat,
│   on filebeat.tf line 1, in resource "helm_release" "filebeat":
│    1: resource "helm_release" "filebeat" {
│ 
╵

I’m not sure where to go from here. Any tips would be appreciated. Thank you