How to encrypt or protect the terraform source tf. I dont want others to change or view the content inside terraform main.tf files.
Is there anyway to convert this main.tf as executable or encrypted version to understand by terraform apply commamd
I don't want anyone to view or modify the source file. At a same time i need to share with them to execute terraform apply command from individual project machine
It is not possible with
terraformbinary as it loads onlyhclconfig files aka*.tffiles. You can find the relevant code here.Config files are meant for sharing unless they contain sensitive data. For whatever reason you don't want to share the config files, you could write a wrapper to encrypt the
*.tffiles at the source & at the destination you decrypt them before executingapply. Despite doing this it's relatively easy to find what's in the config files by below meansplan/applystdoutTo conclude, it makes little to no sense to restrict the tf config files.