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

**URL:** <https://discuss.hashicorp.com/t/error-in-building-k8-objects-when-using-terraform-to-create-filebeat-as-a-resource/37781>\
**Category:** Terraform Providers\
**Created:** [March 30, 2022, 8:59pm UTC](https://discuss.hashicorp.com/t/error-in-building-k8-objects-when-using-terraform-to-create-filebeat-as-a-resource/37781 "2022-03-30T20:59:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiyoon-koo](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jiyoon-koo/32/27112_2.png) [@jiyoon-koo](https://discuss.hashicorp.com/u/jiyoon-koo)\
**Post date:** [March 30, 2022, 8:59pm UTC](https://discuss.hashicorp.com/t/error-in-building-k8-objects-when-using-terraform-to-create-filebeat-as-a-resource/37781/1 "2022-03-30T20:59:04Z")

</div>

I am trying to do something similar to this post: [Terraform and helm\_release - #7 by stuart-c](https://discuss.hashicorp.com/t/terraform-and-helm-release/21478/7)

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

```auto
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

```auto
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:

```auto
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
