SchwarzIT/terraform-provider-stackit

SKE Project resource creation

Closed this issue · 2 comments

Hey TF Team,
i noticed a not expected behavior on the SKE project resource as it is:
even if the project exists, the resource accepts it as created by itself, so deletes it by destroy via this state even though it existed before......so any cluster in this project will going to be destroyed.

I'd expect a error message such as "already exists" and to have then a data-source in place.
Or maybe i'm wrong, i'd transparently leave the whole SKE project stuff out....there's no value in it.

do87 commented

The issue of project creation is a bit tricky
It was previously part of the project resource before moving to its own standalone resource, which created some issues
and the behavior currently isn't very terraform like, i agree.
for the destroy part - if it detects that there are clusters outside of what terraform is managing, it won't actually delete the project but return a warning - also, not very terraform like, but i wanted to avoid a case where manually created clusters are deleted because the project was disabled.

that being said
it's been a long while since the first versions of the provider, so it may be time to change the behavior as you said, because by now all resources should be migrated already.

do87 commented

For the time being, i've removed the deletion code from the *_project resources
in later versions, i'll review if the extra _project resources can be removed altogether