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

I am trying to do something similar to this post over at Hashicorp: Terraform and helm_release - #7 by stuart-c - Essentially, installing filebeat on a kubernetes cluster inside AKS.

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

  filebeat.yml: |
      - type: log
          - /usr/share/filebeat/logs/filebeat
      hosts: '["my_host_url"]'
      api_key: "${EC_API_KEY}"

and referencing it in my as below

resource "helm_release" "filebeat" {
  name       = "filebeat"
  repository = ""
  chart      = "filebeat"
  version    = "7.9.3"
  namespace  = "kube-system"

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

  depends_on = [


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 "", unable to recognize "": no matches for kind "ClusterRoleBinding" in version ""]
│   with helm_release.filebeat,
│   on line 1, in resource "helm_release" "filebeat":
│    1: resource "helm_release" "filebeat" {

I’m not sure where to go from here. I also think I should be referencing the aks cluster info somewhere in my, but not sure where.

Any tips would be appreciated. Thank you

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.