thazelart/terraform-validator

Enforce presence of a block in a file

Ameausoone opened this issue · 1 comments

It would be interesting to enforce that a file exist and then that a block is present inside.

e.g. :
Enforce presence of provider block only providers.tffile.

Configuration could be like this :

 layers:
   default:
     files:
       main.tf:
         mandatory: true
         authorized_blocks:
       providers.tf:
         mandatory: true
         exclusive_blocks:
           - provider

My bad it's already possible