There are multiple post going around on this error in my case the problem was caused by missing quotes around the value of provisioningMode. So instead of this:
resource "kubernetes_storage_class" "us-east-1a" {
metadata {
name = "us-east-1a"
}
storage_provisioner = "efs.csi.aws.com"
reclaim_policy = "Retain"
parameters = {
provisioningMode = efs-ap
fileSystemId = var.us-east-1a-vol
directoryPerms = "777"
}
mount_options = ["file_mode=0700", "dir_mode=0777", "mfsymlinks", "uid=1000", "gid=1000", "nobrl", "cache=none"]
}
Use this:
resource "kubernetes_storage_class" "us-east-1a" {
metadata {
name = "us-east-1a"
}
storage_provisioner = "efs.csi.aws.com"
reclaim_policy = "Retain"
parameters = {
provisioningMode = "efs-ap"
fileSystemId = var.us-east-1a-vol
directoryPerms = "777"
}
mount_options = ["file_mode=0700", "dir_mode=0777", "mfsymlinks", "uid=1000", "gid=1000", "nobrl", "cache=none"]
}