CiscoDevNet / terraform-provider-cml2

Terraform provider repository for Cisco Modeling Labs
https://www.cisco.com/go/cml
Mozilla Public License 2.0
14 stars 1 forks source link

deprecate lifecycle.elements in favor of depends_on #94

Closed rschmied closed 4 months ago

rschmied commented 10 months ago

Apparently, they are doing the same thing: creating state dependencies. At the time of creating the elements property, I was simply not aware of depends_on which would have been the obvious choice as it does exactly the same thing, built-in.

Need to investigate the ramification when declaring elements obsolete/deprecated and how this would impact users... I guess it would not but want to be clear upfront.

rschmied commented 10 months ago

tagging @netcicd and @tiagosil-cisco

netcicd commented 10 months ago

I will see what I use when I am back next week. Have a good newyear

myref commented 10 months ago

I extensively use elements as per your blog. Will it just be a replacement of the elements keyword with depends_on? If so I will try to test

rschmied commented 9 months ago

yes... everywhere where you use an elements list it should be possible to simply replace it with an depends_on list. They do the same thing but depends_on is built into TF.

tiagosil-cisco commented 9 months ago

Maybe I wasn't using "elements" correctly, but I thought that we could have different "cml2_lifecycle" resources to manage different nodes/links in the same lab. Let's say, we build a big topology with two datacenter but I want to control each one independently.

rschmied commented 9 months ago

@tiagosil-cisco I guess you were. Are you saying that you had multiple lifecycle resources in the same TF? If so, then I think that there should be some code which would restrict the number of lifecycle resources to ONE or ZERO. Not even sure what the implications would be if there's multiple LC resources...!?

rschmied commented 5 months ago

https://developer.hashicorp.com/terraform/plugin/framework/deprecations

need to implement this...

rschmied commented 4 months ago

fixed by PR #130