Skip to content

Commit b905c97

Browse files
committed
feat: add kms key arn input for customer-managed keys
1 parent 8cfe4d8 commit b905c97

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ locals {
88
ssm_path_prefix = format("/%s/%s", var.ssm_path_prefix, module.aurora_postgres.outputs.cluster_identifier)
99
ssm_password_source = length(var.ssm_password_source) > 0 ? var.ssm_password_source : format("%s/%s", local.ssm_path_prefix, "%s/password")
1010

11-
kms_key_arn = module.aurora_postgres.outputs.kms_key_arn
11+
kms_key_arn = coalesce(module.aurora_postgres.outputs.kms_key_arn, var.kms_key_arn)
1212

1313
default_schema_owner = "postgres"
1414
}

src/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ variable "cluster_enabled" {
4747
description = "Set to `false` to prevent the module from creating any resources"
4848
}
4949

50+
variable "kms_key_arn" {
51+
type = string
52+
description = "The ARN for the KMS encryption key."
53+
default = null
54+
}
55+
5056
variable "additional_databases" {
5157
type = set(string)
5258
default = []

0 commit comments

Comments
 (0)