Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix terraform destroy failure on aws #2148

Merged
merged 2 commits into from
Apr 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion deploy/modules/aws/tidb-operator/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,27 @@ resource "local_file" "kubeconfig" {
filename = module.eks.kubeconfig_filename
}

locals {
kubeconfig = "${var.config_output_path}kubeconfig"
}

resource "null_resource" "kubeconfig" {
provisioner "local-exec" {
command = <<EOS
echo "${local_file.kubeconfig.sensitive_content}" > "${local.kubeconfig}"
EOS
}
}

provider "helm" {
alias = "initial"
insecure = true
# service_account = "tiller"
install_tiller = false # currently this doesn't work, so we install tiller in the local-exec provisioner. See https://github.com/terraform-providers/terraform-provider-helm/issues/148
kubernetes {
config_path = local_file.kubeconfig.filename
config_path = local.kubeconfig
# used to delay helm provisioner initialization in apply phrase
load_config_file = null_resource.kubeconfig.id != "" ? true : null
}
}

Expand Down