Following the example for creating the encryption configuration:
https://1-7-0-alpha1.opentofu.pages.dev/docs/language/state/encryption/#configuration
the exit code is always 1.
This can be annoying on a CI, which expects all the commands to have the exit code of 0.
See:
$ read -d '' TF_ENCRYPTION << EOF
> terraform {
> encryption {
> key_provider "some_key_provider" "some_name" {
> # Key provider options here
> }
>
> method "some_method" "some_method_name" {
> # Method options here
> keys = key_provider.some_key_provider.some_name
> }
>
> state {
> # Encryption/decryption for state data
> method = method.some_method.some_method_name
> }
>
> plan {
> # Encryption/decryption for plan data
> method = method.some_method.some_method_name
> }
>
> remote_state_data_sources {
> # See below
> }
> }
> }
> EOF
[alex@/tmp]$ echo $?
1