Understanding Resource Dependencies in Terraform
- Lets add create EIP creation & association to EC2, to our terraform script since EIP association cannot be done until EC2 is present, EIP will be depend resource
- We can also add implicit dependencies, please refer this link
In this we are creating S3 bucket and adding a dependenies in EC2 section