cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
402
Views
0
Helpful
5
Replies

SDWAN terraform

TahirAli12881
Level 1
Level 1

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

resource "sdwan_attach_feature_device_template" "branch" {
provider = sdwan
id = "9e6044a3-afdb-"
devices = [
{
id = "ISR4451-X/K9-FOC24"
variables = {
???????
 
}
}
]
}

 

5 Replies 5

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.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

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.

TahirAli12881_0-1708602268046.png

Is there a way to get all these values somehow.

Because I need to build the terraform  resource with these vaules I belive.

 

 

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.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Thanks

TahirAli12881
Level 1
Level 1

These are the variables as shown in the picture. all values with in () are the variables..

TahirAli12881_0-1709334326716.png

and this did work for me..Thanks