Open jmarhee opened 8 months ago
Is this related to needs of https://github.com/rancherlabs/harvester-equinix-terraform?
A variable named equinix_metal_project_name
exists and could be used. Doing so could keep the project_id
variable intact and used as an alternative for the datasource (lookup by id OR name -- https://developer.hashicorp.com/terraform/language/expressions/custom-conditions#input-variable-validation).
Project names are not necessarily unique. If the user supplied a non-unique name the TF provider would throw an error, which would be the correct behavior for this scenario.
Got it. I didn't realize the project names themselves were not unique (and for some reason did not catch the existing variable!)-- I put this together thinking it'd be convenient so if there's that other better approach that can be worked with (as you noted), then that seems more than sufficient and we can close this out.
Convenience update: rather than needing the ID, user can specify (or define for creation) a project by its name rather than ID (and then ID is rendered via datasource). Changes variable from project_id to project_name and updates module accordingly.