@Perumal, Janakiraman
Since you question is related to Terraform you might get more responses by posting it to somewhere else, like Stack Overflow. There are two ways to handle data disks in terraform, they can be created with the VM using azurerm_virtual_machine with storage_data_disk or created and attached using azurerm_virtual_machine_data_disk_attachment. Some examples can be found here. For how to best handle the variables in Terraform I would refer you to the input variables page.
Hope this helps. Let me know if you have further question or issues and I will be happy to assist.
-------------------------------
Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.