I'm trying to wrap my head around how to best handle identical keys, and none of the options seem particularly elegant. A good example is setting multiple ordered instances of the system name-server key.
If I mean to set nameservers in order of lookup for 8.8.8.8, 8.8.4.4, 1.1.1.1 I see that I can:
Using sets is great for state management, but it does not provide a guarantee of the order in which the elements will be set when making the API calls.
edit: just stubbed my toe into this not working. between the calls terraform realizes the key already exists.
I'm trying to wrap my head around how to best handle identical keys, and none of the options seem particularly elegant. A good example is setting multiple ordered instances of the
system name-server
key.If I mean to set nameservers in order of lookup for
8.8.8.8, 8.8.4.4, 1.1.1.1
I see that I can:Option 1: Use sets
Using sets is great for state management, but it does not provide a guarantee of the order in which the elements will be set when making the API calls.
edit: just stubbed my toe into this not working. between the calls terraform realizes the key already exists.
Option 2: Use dependencies
I've also tried using
vyos_config_block
resources, but on the system object, it gets rightfully upset about there being other state it cannot control.Ultimately, none of those options "feel right". I'm curious of how others have tackled this issue.