02-21-2024 03:11 PM
Hi
I have a device template with many variables. they look like this in the csv file
csv-deviceId,csv-deviceIP,csv-host-name,pnp_dhcp_defaultrouter_527,pnp_dhcp_network,/70/vpn70_internal_svc_Sec_if_name/interface/if-name,
is there a way to print out all the variables in a device template with terraform so that i can make the call correct?
i need to attach the template to a device like this
02-22-2024 02:53 AM
I do not think you can do this with TF, what you could do is create a local value in your TF config to hold the list of variables extracted from the CSV file you have, then use a file function to read the CSV file and parse it to extract the variable names. Finally, iterate through the extracted variable names and add them to the variables block in your sdwan_attach_feature_device_template resource.
Hope this helps.
02-22-2024 03:47 AM
Thanks for ur reply. think I was not clear in explaining.
I need to know the name of the variables that Vmange will accept as key values.
Is there a way to get all these values somehow.
Because I need to build the terraform resource with these vaules I belive.
02-22-2024 05:01 AM
No problem. The documentation does not explain the format and expected key names. Each Vmange service typically has dedicated documentation outlining available APIs, functionalities, and accepted parameters. Like for example I think the the vars in the example usage - https://registry.terraform.io/providers/CiscoDevNet/sdwan/latest/docs/guides/updating_templates
Required:
- `id` (String) Device ID
- `variables` (Map of String) Device variables
But i do not think you can pull all the variables sadly, much like the missing payload information in the docs. Hope this helps.
02-22-2024 05:03 AM
Thanks
03-01-2024 03:19 PM - edited 03-02-2024 09:49 AM
These are the variables as shown in the picture. all values with in () are the variables..
and this did work for me..Thanks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide