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..c8c9b43 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" + type = "string" + default = "" +} + variable "values" { description = "A map of keys/values to save as json for the secret if type is map" type = map(any)