Why on earth is your state in git? The tool has built-in functionality to handle just these kinds of workflows. This reads a lot like hitting your thumb with the hammer and blaming hammers.
If that then create a separate locked down Git repo just for this. Protecting your state file was a big deal when I first reading about Terraform. It was really drilled in.
kasfkaj|2 years ago
terraform init --backend=gcs --bucket="xxx" --prefix="my-deployment-name" --encryption_key="my-random-bits"
Hnrobert42|2 years ago
fishnchips|2 years ago
Pet_Ant|2 years ago
Hnrobert42|2 years ago
Even so, git only exacerbated the problem of secrets being in state files.