Azure / aztfexport

A tool to bring existing Azure resources under Terraform's management
https://azure.github.io/aztfexport/
Mozilla Public License 2.0
1.62k stars 190 forks source link

Enhancement: Make the name argument the first item in a resource block when generating Terraform configuration #279

Open wylie-ucb opened 2 years ago

wylie-ucb commented 2 years ago

For ease of readability, I want the name argument to be the first item in a resource block. I've been painstakingly moving these manually. It looks like the arguments are being populated in alphabetic order currently, which is fine, but I still want the name to be first. Having the name first also seems to be the Terraform standard.

Current behavior: resource "azurerm_foo" "bar" { baz = "xyzzy" corge = "plugh" name = "waldo" quux = "thud" }

Desired behavior: resource "azurerm_foo" "bar" { name = "waldo" baz = "xyzzy" corge = "plugh" quux = "thud" }

magodo commented 2 years ago

@wylie-ucb This sounds like out of scope of this tool, but can make another dedicated tool for this kind of customization ordering/formatting. I'll still mark this issue as "enhancement" to remind me to work on this if I have bandwidth.