diff --git a/main.tf b/main.tf index 1840baa..6aeb38e 100755 --- a/main.tf +++ b/main.tf @@ -235,7 +235,7 @@ resource "terraform_data" "run_command" { command = "kubectl --kubeconfig=${local.kubeconfig_path} patch storageclass gp2 --patch '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}' " } - depends_on = [module.kubeconfig.kube_config] + # depends_on = [module.kubeconfig.kube_config] } # Database Setup - https://registry.terraform.io/modules/terraform-aws-modules/rds/aws/6.2.0 diff --git a/modules/kubeconfig/main.tf b/modules/kubeconfig/main.tf index a0c35fb..d01c7dd 100644 --- a/modules/kubeconfig/main.tf +++ b/modules/kubeconfig/main.tf @@ -68,6 +68,7 @@ resource "kubernetes_service_account" "kubernetes_sa" { name = local.service_account_name namespace = var.namespace } + depends_on = [ kubernetes_cluster_role_binding.kubernetes_crb ] } resource "kubernetes_cluster_role_binding" "kubernetes_crb" { @@ -88,7 +89,6 @@ resource "kubernetes_cluster_role_binding" "kubernetes_crb" { depends_on = [ data.aws_security_group.selected, - local_file.kubeconfig ] }