You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I remove project2 from main.tf and also project2 in the for_each mentioned in the profile I get an error:
Plan: 0 to add, 0 to change, 2 to destroy.
incus_project.testp: Destroying... [name=project2]
incus_profile.my_profile["project2"]: Destroying... [name=my_profile]
incus_profile.my_profile["project2"]: Destruction complete after 1s
Error: Failed to remove project "project2"
Only empty projects can be removed.
I guess the problem is that it is trying to remove the project before removing the profile.
This is not a big deal, since the next time I run tofu apply it worked, since the profile has already been removed, but I just wanted to report it as it would be a nice improvement that the dependencies between profiles and projects are tracked properly.
The text was updated successfully, but these errors were encountered:
So this may be a Terraform config issue. When you just set project to each.key in this case with the set passed to for_each being just a list of strings, Terraform has no way to model the relationship between that incus_profile entry and the incus_project.
Would have provided the relationship data needed for Terraform to understand that this profile depends on the project and should therefore be deleted prior to the project.
I seem to remember seeing a depends_on statement that you can use too for those few cases where you can't have it built for you through references.
I have a project that I deleted in my main.tf. There is a profile which associated to several projects using something like:
When I remove project2 from main.tf and also project2 in the
for_each
mentioned in the profile I get an error:I guess the problem is that it is trying to remove the project before removing the profile.
This is not a big deal, since the next time I run
tofu apply
it worked, since the profile has already been removed, but I just wanted to report it as it would be a nice improvement that the dependencies between profiles and projects are tracked properly.The text was updated successfully, but these errors were encountered: