Closed JeffGiroux closed 1 year ago
example in GCP bigip module https://github.com/F5Networks/terraform-gcp-bigip-module/blob/7152cbcf93102f02599b39608362bb6917aec4e8/main.tf
resource "google_compute_instance" "f5vm01" {
name = var.vm_name == "" ? format("%s", local.instance_prefix) : var.vm_name
User has requirement to set VM name to match their naming standards. Currently the Azure BIG-IP module is forcing the 'name' and 'computer_name' field to a fixed name. Please allow user to supply a vm_name input parameter similar to the GCP BIG-IP module.
Code in reference...
Suggestion
Have some type of if/then logic to check if user supplied vm_name exists, if so...use it. If not, use dynamic name similar to prefix+bigip01 or other. Give results to 'name'.
For API reference, only 'name' is required versus both 'name' and 'computer_name'. If 'computer_name' is supplied, then it is used over 'name'. Since you are setting both parameters to the same value, you might simplify code by removing 'computer_name'.