Terraform

You try to deploy a cluster and an app on that cluster, but the app resource was created before the cluster. How to manage such situation?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

Use the meta-argument depends_on in the app resource definition. This way the app will depend on the cluster resource and order will be maintained in creation of the resources.