Skip to content

Commit 3f19e74

Browse files
committed
Refactor ArgoCD setup to replace time_sleep resource with a direct dependency on helm_release and remove unnecessary wait_for block
1 parent e1fdb4f commit 3f19e74

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Terraform/3-main.tf

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ resource "helm_release" "argocd" {
4242
depends_on = [module.eks]
4343
}
4444

45+
# Wait for ArgoCD to be ready before creating applications
46+
resource "time_sleep" "wait_for_argocd" {
47+
depends_on = [helm_release.argocd]
48+
create_duration = "60s"
49+
}
50+
4551
# Create ArgoCD Application automatically
4652
resource "kubernetes_manifest" "solar_system_app" {
47-
provider = kubernetes-alpha
48-
4953
manifest = {
5054
apiVersion = "argoproj.io/v1alpha1"
5155
kind = "Application"
@@ -73,13 +77,6 @@ resource "kubernetes_manifest" "solar_system_app" {
7377
}
7478
}
7579

76-
wait_for {
77-
fields = {
78-
"status.health.status" = "Healthy"
79-
"status.sync.status" = "Synced"
80-
}
81-
}
82-
83-
depends_on = [helm_release.argocd]
80+
depends_on = [time_sleep.wait_for_argocd]
8481
}
8582

0 commit comments

Comments
 (0)