Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for supplying description when creating secrets #68

Merged
merged 2 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/secret/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
5 changes: 3 additions & 2 deletions modules/secret/main.tf
Original file line number Diff line number Diff line change
@@ -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" {
Expand Down
6 changes: 6 additions & 0 deletions modules/secret/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down