Hi,
I’m a little confused about how to achive this using conditionals on Terraform. I have some files to create VMs on Azure, but they was created using different admin_username value in a hard-coded way.
I’m trying to create a tag based on a value of this attribute, but can achieve just when using it as a variable and creating a condition inside of vm file.
There is a way to look on this attribute on each file during terraform plan/apply and create/update tag using a central local.tf file to avoid editing each file?
Example of admin_username attibute values:
file1.tf
resource "azurerm_windows_virtual_machine" "example" {
name = "example-machine"
admin_username = "adminuser"
file2.tf
resource "azurerm_windows_virtual_machine" "example" {
name = "test-machine"
admin_username = "localuser"
Thanks