gavinbunney / terraform-provider-kubectl

Terraform provider to handle raw kubernetes manifest yaml files
https://registry.terraform.io/providers/gavinbunney/kubectl
Mozilla Public License 2.0
628 stars 108 forks source link

kubectl_path_documents: Error: syntax error in pattern #258

Closed udhos closed 1 year ago

udhos commented 1 year ago

Can anyone spot why I am hitting this "Error: syntax error in pattern"?

Error: syntax error in pattern

  with data.kubectl_path_documents.karpenter_manifest,
  on karpenter.tf line 118, in data "kubectl_path_documents" "karpenter_manifest":
 118: data "kubectl_path_documents" "karpenter_manifest" {

Error: Terraform exited with code 1.
Error: Process completed with exit code 1.

Line 118 is:

data "kubectl_path_documents" "karpenter_manifest" {
  pattern = file("./karpenter/${local.karpenter_version}/manifest/karpenter-${data.aws_caller_identity.current.account_id}.yaml")
}

Terraform: 1.3.9 gavinbunney/kubectl: 1.14.0

yongzhang commented 1 year ago

I don't think you need the file function here, because patteren accepts a path (https://registry.terraform.io/providers/gavinbunney/kubectl/latest/docs/data-sources/kubectl_path_documents), but file function returns the file content.

udhos commented 1 year ago

Thank you!