Add opentofu encryption

This commit is contained in:
Tobias Reisinger 2024-10-09 21:31:38 +02:00
parent 424e1db07f
commit f8bb2d82c9
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
2 changed files with 19 additions and 0 deletions

15
main.tf
View file

@ -16,6 +16,21 @@ terraform {
skip_requesting_account_id = true skip_requesting_account_id = true
skip_s3_checksum = true skip_s3_checksum = true
} }
encryption {
key_provider "pbkdf2" "encryption" {
passphrase = var.passphrase
}
method "aes_gcm" "encryption" {
keys = key_provider.pbkdf2.encryption
}
state {
method = method.aes_gcm.encryption
enforced = true
}
}
} }
module "services" { module "services" {

View file

@ -1,3 +1,7 @@
variable "passphrase" {
sensitive = true
}
variable "backend_access_key" { variable "backend_access_key" {
sensitive = true sensitive = true
} }