Skip to content

Commit 865c8d0

Browse files
authored
add kms_key_id, fix #7 (#8)
1 parent 802e982 commit 865c8d0

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module "random_password" {
3838
| create\_secret | If false, this module does nothing (since tf doesn't support conditional modules) | `bool` | `true` | no |
3939
| description | Description to add to Secret | `string` | `""` | no |
4040
| enable\_secret\_access\_notification | Notify SNS topic on secret access (not recommended for most use cases) | `bool` | `false` | no |
41+
| kms\_key\_id | Optional. The KMS Key ID to encrypt the secret. KMS key arn or alias can be used. | `any` | `null` | no |
4142
| length | Length of string | `number` | n/a | yes |
4243
| min\_lower | Minimum number of lower case characters | `number` | `0` | no |
4344
| min\_numeric | Minimum number of numbers | `number` | `0` | no |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ resource "aws_secretsmanager_secret" "secret" {
2727
name = var.name == "" ? null : var.name
2828
name_prefix = var.name == "" ? var.name_prefix : null
2929
description = var.description
30+
kms_key_id = var.kms_key_id
3031
tags = var.tags
3132
}
3233

variables.tf

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ variable "description" {
1313
type = string
1414
}
1515

16+
variable "kms_key_id" {
17+
default = null
18+
description = "Optional. The KMS Key ID to encrypt the secret. KMS key arn or alias can be used."
19+
}
20+
1621
variable "name" {
1722
default = ""
1823
description = "Name (omit to use name_prefix)"
@@ -72,7 +77,6 @@ variable "secret_access_notification_arn" {
7277
variable "length" {
7378
description = "Length of string"
7479
type = number
75-
7680
}
7781

7882
variable "min_lower" {

0 commit comments

Comments
 (0)