Skip to content

Commit

Permalink
Add terraform refresh to destroy eks_components (#1373)
Browse files Browse the repository at this point in the history
This is to fix the authentication error, caused by this issue:
hashicorp/terraform-provider-kubernetes#1131
  • Loading branch information
vijay-veeranki authored Sep 28, 2021
1 parent 48f76f0 commit a2ca320
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions destroy-cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ def terraform_eks_components
dir = "terraform/aws-accounts/cloud-platform-aws/vpc/eks/components"
tf_init dir
tf_workspace_select(dir, cluster_name)
# terraform refresh until this issue get fixed for terraform-provider-kubernetes
# https://github.com/hashicorp/terraform-provider-kubernetes/issues/1131
tf_refresh(dir)
tf_destroy(dir)
end

Expand Down Expand Up @@ -241,6 +244,10 @@ def tf_init(dir)
execute "cd #{dir}; terraform init"
end

def tf_refresh(dir)
execute "cd #{dir}; terraform refresh"
end

def tf_workspace_select(dir, workspace)
execute "cd #{dir}; terraform workspace select #{workspace}"
end
Expand Down

0 comments on commit a2ca320

Please sign in to comment.