Remove region from vars mapping for kubeconfig (#556)

The template file data source was injecting a region variable that is not defined in the template. Once removed the variable the aws region data source was not used anywhere else, so it is removed as well.
This commit is contained in:
Miguel Ferreira
2019-10-24 18:13:06 +02:00
committed by Max Williams
parent 4369f0271b
commit 3f346d1610

View File

@@ -2,9 +2,6 @@ locals {
worker_ami_name_filter = var.worker_ami_name_filter != "" ? var.worker_ami_name_filter : "amazon-eks-node-${var.cluster_version}-v*"
}
data "aws_region" "current" {
}
data "aws_iam_policy_document" "workers_assume_role_policy" {
statement {
sid = "EKSWorkerAssumeRole"
@@ -52,7 +49,6 @@ data "template_file" "kubeconfig" {
vars = {
kubeconfig_name = local.kubeconfig_name
endpoint = aws_eks_cluster.this.endpoint
region = data.aws_region.current.name
cluster_auth_base64 = aws_eks_cluster.this.certificate_authority[0].data
aws_authenticator_command = var.kubeconfig_aws_authenticator_command
aws_authenticator_command_args = length(var.kubeconfig_aws_authenticator_command_args) > 0 ? " - ${join(