From d21cab70503106d2b3b9e617b1ad393ed5f8338f Mon Sep 17 00:00:00 2001 From: Bill Monkman Date: Wed, 10 Nov 2021 17:04:56 -0800 Subject: [PATCH 1/2] feat: Add support for supplying description when creating secrets --- modules/secret/README.md | 1 + modules/secret/main.tf | 5 +++-- modules/secret/variables.tf | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/secret/README.md b/modules/secret/README.md index 89eb491..aeb6a04 100644 --- a/modules/secret/README.md +++ b/modules/secret/README.md @@ -22,6 +22,7 @@ Create a secret using AWS Secret Manager. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| description | The user-friendly description of this secret | `string` | `""` | no | | name | The name of the secret in Secrets Manager (only one of name or name\_prefix can be specified) | `string` | `""` | no | | random\_length | The length of the generated string if type is random. Suitable for a db master password for example | `number` | `16` | no | | tags | Tags to include in the secret | `map(any)` | `{}` | no | diff --git a/modules/secret/main.tf b/modules/secret/main.tf index 0926849..5f1b403 100644 --- a/modules/secret/main.tf +++ b/modules/secret/main.tf @@ -1,7 +1,8 @@ # Add the keys to AWS secrets manager resource "aws_secretsmanager_secret" "secret" { - name = var.name - tags = var.tags + name = var.name + tags = var.tags + description = var.description } resource "aws_secretsmanager_secret_version" "string_secret" { diff --git a/modules/secret/variables.tf b/modules/secret/variables.tf index ba81878..f44f393 100644 --- a/modules/secret/variables.tf +++ b/modules/secret/variables.tf @@ -7,6 +7,12 @@ variable "type" { description = "The type of data to hold in this secret (map, string, random)" } +variable "description" { + description = "The user-friendly description of this secret" + tyope = "string" + default = "" +} + variable "values" { description = "A map of keys/values to save as json for the secret if type is map" type = map(any) From 9c290d8368d8a9585c6fc9ea795049c091be1315 Mon Sep 17 00:00:00 2001 From: Bill Monkman Date: Mon, 15 Nov 2021 11:11:02 -0800 Subject: [PATCH 2/2] Fix typo in variable Co-authored-by: David Cheung --- modules/secret/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/secret/variables.tf b/modules/secret/variables.tf index f44f393..c8c9b43 100644 --- a/modules/secret/variables.tf +++ b/modules/secret/variables.tf @@ -9,7 +9,7 @@ variable "type" { variable "description" { description = "The user-friendly description of this secret" - tyope = "string" + type = "string" default = "" }