If I have an outputs.tf file that looks like the below:
output "network" {
description = "The network module."
value = module.account.network
}
output "hardened-image-id" {
description = "The AMI ID of the hardened image."
value = data.aws_ami.hardened.id
}
output "private_key_name" {
description = "The name of the private key made to share."
value = module.account.private_key_name
}
and I run tfsort outputs.tf, it deletes the output that is out of place. It then makes my outputs.tf file look like the following:
output "network" {
description = "The network module."
value = module.account.network
}
output "private_key_name" {
description = "The name of the private key made to share."
value = module.account.private_key_name
}
Also, is there anyway to recursively look for variables.tf files in subdirectories and sort them with one command run? Something like tfsort --recursive variables.tf?
Can this be fixed to work properly? Thank you in advance for any help you can provide!
Hi @benniemosher,
Thanks a lot for reporting the problem. I am at a limited capacity right now, but I will have a look and fix the problem in the upcoming weeks.
If I have an
outputs.tf
file that looks like the below:and I run
tfsort outputs.tf
, it deletes the output that is out of place. It then makes myoutputs.tf
file look like the following:Also, is there anyway to recursively look for
variables.tf
files in subdirectories and sort them with one command run? Something liketfsort --recursive variables.tf
?Can this be fixed to work properly? Thank you in advance for any help you can provide!