Implicit Resource Dependencies
Learn and execute implicit resource dependencies in Terraform.
We'll cover the following...
Dependencies
The dependencies are the bane of any infrastructure manager’s life. If we switch off the Virtual Machine (VM), who will complain? What about the load balancer?
Stories of switching off servers to see who complains as a way of managing unknown dependencies are incredibly common in the IT industry.
Terraform can help manage that problem by codifying and tracking resource dependencies. However, it’s important to remember that it does not do so by magic and that our application dependencies may still need to be mapped out by whoever’s in charge of them.
Implicit dependency
Initially, we need to set up our credentials. Then, we create a new directory with a Terraform module.
We also create a Terraform module with a defined AWS provider
.
Then we add two resources to the dependencies.tf
file. The first is an AWS VPC
, similar to ...