SchwarzIT / terraform-provider-stackit

Community-maintained STACKIT Terraform provider
Apache License 2.0
18 stars 8 forks source link

SKE Project resource creation #156

Closed stacksegv closed 1 year ago

stacksegv commented 1 year ago

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 1 year ago

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 1 year ago

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