Virtual Machine Tag update for Azure

We’ve a number of existing resources for which we have to update the Tags.

I see that we’ve to specify a lot of properties like disk/network/etc., when I’m updating the tags for a virtual machine.

  1. Is that right?
  2. Can I just update the tags for existing resources that were created outside of terraform without specifying all it’s properties?

Hi @mahadev,

If the resources are not already ‘terraform managed’ - by that deployed by terraform, then it is not possible to use Terraform to update individual attributes without bringing them under Terraform management. And to do this you do need to define the resources’ full configuration and import the resource into Terraform state.

If all you are doing is updating Resource tags against existing resources that are not already under Terraform management then I suggest that Terraform is not the tool you need and I would recommend the following:

Hope that helps!