Link two resources


My provider is able to provide 2 resources. You create these 2 resources independently. However you can link these two resource. But when you delete one resource, the second one is deleted by the API (when they are linked). Terraform does not like this behavior …

How to code this dependency in terraform provider ?