diff --git a/README.md b/README.md
index f0cf1cda04..214fe15d06 100644
--- a/README.md
+++ b/README.md
@@ -251,6 +251,7 @@ Apache 2 Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraf
| [kubeconfig\_aws\_authenticator\_command](#input\_kubeconfig\_aws\_authenticator\_command) | Command to use to fetch AWS EKS credentials. | `string` | `"aws-iam-authenticator"` | no |
| [kubeconfig\_aws\_authenticator\_command\_args](#input\_kubeconfig\_aws\_authenticator\_command\_args) | Default arguments passed to the authenticator command. Defaults to [token -i $cluster\_name]. | `list(string)` | `[]` | no |
| [kubeconfig\_aws\_authenticator\_env\_variables](#input\_kubeconfig\_aws\_authenticator\_env\_variables) | Environment variables that should be used when executing the authenticator. e.g. { AWS\_PROFILE = "eks"}. | `map(string)` | `{}` | no |
+| [kubeconfig\_file\_permission](#input\_kubeconfig\_file\_permission) | File permission of the Kubectl config file containing cluster configuration saved to `config_output_path.` | `string` | `"0600"` | no |
| [kubeconfig\_name](#input\_kubeconfig\_name) | Override the default name used for items kubeconfig. | `string` | `""` | no |
| [manage\_aws\_auth](#input\_manage\_aws\_auth) | Whether to apply the aws-auth configmap file. | `bool` | `true` | no |
| [manage\_cluster\_iam\_resources](#input\_manage\_cluster\_iam\_resources) | Whether to let the module manage cluster IAM resources. If set to false, cluster\_iam\_role\_name must be specified. | `bool` | `true` | no |
diff --git a/kubectl.tf b/kubectl.tf
index a83f0f95e7..6e12ea77a3 100644
--- a/kubectl.tf
+++ b/kubectl.tf
@@ -2,6 +2,6 @@ resource "local_file" "kubeconfig" {
count = var.write_kubeconfig && var.create_eks ? 1 : 0
content = local.kubeconfig
filename = substr(var.config_output_path, -1, 1) == "/" ? "${var.config_output_path}kubeconfig_${var.cluster_name}" : var.config_output_path
- file_permission = "0644"
+ file_permission = var.kubeconfig_file_permission
directory_permission = "0755"
}
diff --git a/variables.tf b/variables.tf
index a48093d577..e9f9d6ccdb 100644
--- a/variables.tf
+++ b/variables.tf
@@ -38,6 +38,12 @@ variable "config_output_path" {
default = "./"
}
+variable "kubeconfig_file_permission" {
+ description = "File permission of the Kubectl config file containing cluster configuration saved to `config_output_path.`"
+ type = string
+ default = "0600"
+}
+
variable "write_kubeconfig" {
description = "Whether to write a Kubectl config file containing the cluster configuration. Saved to `config_output_path`."
type = bool