-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splitting aws-auth and kubectl related resources as they are not related
- Loading branch information
1 parent
f385415
commit 1a1d92d
Showing
4 changed files
with
28 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
resource "local_file" "config_map_aws_auth" { | ||
content = "${data.template_file.config_map_aws_auth.rendered}" | ||
filename = "${var.config_output_path}/config-map-aws-auth.yaml" | ||
count = "${var.manage_aws_auth ? 1 : 0}" | ||
} | ||
|
||
resource "null_resource" "configure_kubectl" { | ||
provisioner "local-exec" { | ||
command = "kubectl apply -f ${var.config_output_path}/config-map-aws-auth.yaml --kubeconfig ${var.config_output_path}/kubeconfig" | ||
} | ||
|
||
triggers { | ||
config_map_rendered = "${data.template_file.config_map_aws_auth.rendered}" | ||
kubeconfig_rendered = "${data.template_file.kubeconfig.rendered}" | ||
} | ||
|
||
count = "${var.manage_aws_auth ? 1 : 0}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,5 @@ | ||
resource "local_file" "kubeconfig" { | ||
content = "${data.template_file.kubeconfig.rendered}" | ||
filename = "${var.config_output_path}/kubeconfig_${var.cluster_name}" | ||
count = "${var.configure_kubectl_session ? 1 : 0}" | ||
} | ||
|
||
resource "local_file" "config_map_aws_auth" { | ||
content = "${data.template_file.config_map_aws_auth.rendered}" | ||
filename = "${var.config_output_path}/config-map-aws-auth_${var.cluster_name}.yaml" | ||
count = "${var.configure_kubectl_session ? 1 : 0}" | ||
} | ||
|
||
resource "null_resource" "configure_kubectl" { | ||
provisioner "local-exec" { | ||
command = "kubectl apply -f ${var.config_output_path}/config-map-aws-auth_${var.cluster_name}.yaml --kubeconfig ${var.config_output_path}/kubeconfig_${var.cluster_name}" | ||
} | ||
|
||
triggers { | ||
config_map_rendered = "${data.template_file.config_map_aws_auth.rendered}" | ||
kubeconfig_rendered = "${data.template_file.kubeconfig.rendered}" | ||
} | ||
|
||
count = "${var.configure_kubectl_session ? 1 : 0}" | ||
count = "${var.write_kubeconfig ? 1 : 0}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters