tofu-controller
tofu-controller copied to clipboard
import initial tfstate with a secret
We currently could do the following to import a TFSTATE for a specify Terraform object.
gzip terraform.tfstate
NAME=tf-controller-ng-cc5a1ac4
kubectl create secret \
generic tfstate-default-${NAME} \
--from-file=tfstate=terraform.tfstate.gz \
--dry-run=client -o=yaml \
yq e '.metadata.annotations["encoding"]="gzip"' - > tfstate-default-${NAME}.yaml
kubectl apply -f tfstate-default-${NAME}.yaml
Need a good UX / design / approach to tackle this feature.
A CLI for this would be nice to have
would this make sense to be added to tfctl
? both for downloading and uploading the state