Splitting aws-auth and kubectl related resources as they are not related

This commit is contained in:
Max Williams
2018-07-09 10:53:14 +02:00
parent f385415c88
commit 1a1d92da66
4 changed files with 28 additions and 23 deletions

18
aws_auth.tf Normal file
View File

@@ -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}"
}