The magic you need for this is concat.
PS C:\Development\discuss\68098> terraform console
> concat(local.server_data_disks, local.server_sql_disks)
[
{
"caching" = "ReadWrite"
"data_disk_size_gb" = 128
"data_disk_storage_account_type" = "Standard_LRS"
"name" = "datadisk1"
},
{
"caching" = "ReadWrite"
"data_disk_size_gb" = 128
"data_disk_storage_account_type" = "Standard_LRS"
"name" = "datadisk2"
},
{
"caching" = "ReadWrite"
"data_disk_size_gb" = "80"
"data_disk_storage_account_type" = "Standard_LRS"
"name" = "datadisk5"
},
{
"caching" = "ReadWrite"
"data_disk_size_gb" = "25"
"data_disk_storage_account_type" = "Standard_LRS"
"name" = "datadisk6"
},
]
>
As you have found, merge takes an arbitrary number of maps or objects, and returns a single map or object that contains a merged set of elements from all arguments. Whereas, what you have here is two lists.
Hope that helps!
Happy Terraforming