Skip to content

Commit

Permalink
Added kubeconfig local
Browse files Browse the repository at this point in the history
  • Loading branch information
makalis authored May 7, 2020
1 parent a35c754 commit 3ae9ff7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kubectl.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ resource "aws_s3_bucket_object" "kubeconfig" {
key = "${var.project}/${var.environment}/kubeconfig"
source = "./kubeconfig_${var.project}-${var.environment}"
}

data "aws_s3_bucket_object" "kubeconfig_local" {
depends_on = ["aws_s3_bucket_object.kubeconfig"]
bucket = "${var.s3_bucket_name}"
key = "${var.project}/${var.environment}/kubeconfig"
}

resource "local_file" "kubeconfig_local" {
content = "${data.aws_s3_bucket_object.kubeconfig_local.body}"
filename = "${path.cwd}/kubeconfig_local"
}

0 comments on commit 3ae9ff7

Please sign in to comment.