I'm currently developing a Terraform provider using the Terraform Plugin Framework. My challenge revolves around updating a resource A that contains an array of resource B. In my API design, when I want to add a resource B to the object's list, I use a route that returns the modified resource A.
In the Terraform code, I would like to have two resources, for example, resource_a and resource_b, so that I can represent them like this:
resource "resource_a" "main" {
// …
}
resource "resource_b" "main" {
object_a_id = resource_a.main.id
// …
}
The issue I'm facing is that when I follow this approach, in the creation method of resource B, I receive the modified resource A, but I'm unsure how to update terraform resource A via resource B implementation code.
I would appreciate any guidance or suggestions on how to handle this scenario effectively.
sincerely