antonbabenko / terraform-vault-s3-backup

Terraform module to backup of the kv store secrets from Hashicorp Vault.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vault kv backup Terraform module

Terraform module, which creates an S3 backup of the kv store store secrets for Hashicorp Vault.

SWUbanner

Usage

A Terraform module designed to store Hashicorp Vault's key-value (kv) secrets in an AWS S3 bucket, compressed in ZIP format.

This module leverages AWS KMS and S3 aws terraform modules for creating kms and s3 aws infrastructure components.

module "vault_kv_backup" {
  source = "../.."

  kv_path     = local.kv_path
  bucket_name = random_pet.default.id

  create_kms = true
}

Examples

Storing secrets for kv store Storing secrets for kv version2 store (WIP)

Contributing

Report issues/questions/feature requests on in the issues section.

Requirements

Name Version
terraform >= 1.0
archive >= 2.4.0
aws >= 5.9.0
null >= 3.2
random >= 3.0
vault >= 3.15.2

Providers

Name Version
archive >= 2.4.0
aws >= 5.9.0
null >= 3.2
vault >= 3.15.2

Modules

Name Source Version
kms terraform-aws-modules/kms/aws 1.5.0
s3_bucket terraform-aws-modules/s3-bucket/aws 3.15.0

Resources

Name Type
aws_s3_object.backup resource
null_resource.remove_zip resource
archive_file.zip data source
vault_kv_secret.secrets data source
vault_kv_secrets_list.kv data source

Inputs

Name Description Type Default Required
bucket_name Name of S3 bucket for backup string n/a yes
create_bucket Whether or not to create an s3 bucket bool true no
create_kms Whether or not to create an key management service key bool true no
kms_deletion_window KMS key deletion window string 14 no
kms_multi_region Whether to enable multi-region for KMS key bool false no
kv_path key value secret engine mount point string n/a yes
s3_object_tags S3 object tags (max 10 items) map(string) {} no
tags Tags map(string) {} no

Outputs

Name Description
kms_key_id ID of the generated KMS key
s3_bucket_name S3 bucket name

License

Apache 2 Licensed. See LICENSE for full details.

Additional information for users from Russia and Belarus

About

Terraform module to backup of the kv store secrets from Hashicorp Vault.

License:Apache License 2.0


Languages

Language:HCL 100.0%