FEAT: added kms_key_id support to secretsmanager-secret module

This commit is contained in:
xpk 2023-12-21 18:09:12 +08:00
parent 03f2c0c711
commit a87af8f557
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
2 changed files with 7 additions and 0 deletions

View File

@ -7,6 +7,7 @@ resource "random_id" "rid" {
resource "aws_secretsmanager_secret" "secret1" {
name = "${var.secret_name}-${random_id.rid.dec}"
description = var.secret_description
kms_key_id = var.kms_key_id == null ? null : var.kms_key_id
}
resource "aws_secretsmanager_secret_version" "this" {

View File

@ -15,3 +15,9 @@ variable "generate_secret" {
default = false
description = "If set to true, a secure password will be generated and saved."
}
variable kms_key_id {
type = string
default = null
description = "Custom kms key id. If not specified, the default key aws/secretmanager key will be used."
}