From b5003460447165bb074f26a4ada114b6fc15a567 Mon Sep 17 00:00:00 2001
From: Przemyslaw Pogorzelec <29803615+scrhicks@users.noreply.github.com>
Date: Mon, 16 May 2022 14:43:12 +0200
Subject: [PATCH] Added secret name output
---
README.md | 1 +
modules/secret/.terraform.lock.hcl | 1 +
modules/secret/README.md | 1 +
modules/secret/outputs.tf | 5 +++++
outputs.tf | 5 +++++
5 files changed, 13 insertions(+)
diff --git a/README.md b/README.md
index b2f481f..6e9c124 100644
--- a/README.md
+++ b/README.md
@@ -54,6 +54,7 @@ No resources.
|------|-------------|
| [secret\_arn](#output\_secret\_arn) | The ARN of the secret |
| [secret\_id](#output\_secret\_id) | The ID of the secret |
+| [secret\_name](#output\_secret\_name) | The name of the secret |
| [secret\_policy\_id](#output\_secret\_policy\_id) | The ID of the secret policy |
| [secret\_replica](#output\_secret\_replica) | Attributes of a replica |
| [secret\_rotation\_enabled](#output\_secret\_rotation\_enabled) | Specifies whether automatic rotation is enabled for this secret |
diff --git a/modules/secret/.terraform.lock.hcl b/modules/secret/.terraform.lock.hcl
index 77f303a..50c531a 100644
--- a/modules/secret/.terraform.lock.hcl
+++ b/modules/secret/.terraform.lock.hcl
@@ -5,6 +5,7 @@ provider "registry.terraform.io/hashicorp/aws" {
version = "4.11.0"
constraints = "~> 4.10"
hashes = [
+ "h1:+Llp4p7MOsFdmoLgCez/pwhA+iEPZO1qC9B6TkU4xsM=",
"h1:JTgGUEVVuuv82X0ePjDM73f+ZM+NfLwb/GGNAOM0CdE=",
"zh:3e4634f4babcef402160ffb97f9f37e3e781313ceb7b7858fe4b7fc0e2e33e99",
"zh:3ff647aa88e71419480e3f51a4b40e3b0e2d66482bea97c0b4e75f37aa5ad1f1",
diff --git a/modules/secret/README.md b/modules/secret/README.md
index dc504eb..8310321 100644
--- a/modules/secret/README.md
+++ b/modules/secret/README.md
@@ -46,5 +46,6 @@ No modules.
|------|-------------|
| [arn](#output\_arn) | The ARN of the secret |
| [id](#output\_id) | The ID of the secret |
+| [name](#output\_name) | The name of the secret |
| [replica](#output\_replica) | Attributes of a replica |
\ No newline at end of file
diff --git a/modules/secret/outputs.tf b/modules/secret/outputs.tf
index 83e2ac7..5c1f490 100644
--- a/modules/secret/outputs.tf
+++ b/modules/secret/outputs.tf
@@ -3,6 +3,11 @@ output "id" {
value = try(aws_secretsmanager_secret.this[0].id, "")
}
+output "name" {
+ description = "The name of the secret"
+ value = try(aws_secretsmanager_secret.this[0].name, "")
+}
+
output "arn" {
description = "The ARN of the secret"
value = try(aws_secretsmanager_secret.this[0].arn, "")
diff --git a/outputs.tf b/outputs.tf
index f9a4e21..aed5d66 100644
--- a/outputs.tf
+++ b/outputs.tf
@@ -6,6 +6,11 @@ output "secret_id" {
value = try(module.secret.this[0].id, "")
}
+output "secret_name" {
+ description = "The name of the secret"
+ value = try(module.secret.this[0].name, "")
+}
+
output "secret_arn" {
description = "The ARN of the secret"
value = try(module.secret.this[0].arn, "")