Dedicated/Seperate Git Repo as Terraform Remote Backend

Hi,

I see that there’re multiple options for Backends, however git isn’t one of them.

I believe git can be used as a backend for tfstate files in either of the below two methods:

Method 1 (git LFS):

  1. Create a dedicated git repo
  2. Commit the tfstate files in a specified directory and branch. Only fetch the required files, rather than the whole repo, as this repo could be used to store multiple tfstate files on different directories.
  3. For locking and unlocking, use ‘git lfs lock’ (https://github.com/git-lfs/git-lfs/wiki/File-Locking)

Method 2 (git - where lfs isn’t possible):

  1. Create a dedicated git repo
  2. Commit the tfstate files in a specified directory and branch. Only fetch the required files, rather than the whole repo, as this repo could be used to store multiple tfstate files on different directories.
  3. For locking and unlocking, use another file suffixed with .lock, which should contain the lock state.

Would terraform be adding this feature?

Thanks,