From c53a27ee5ff019e23971a33b107b29e987b3c667 Mon Sep 17 00:00:00 2001 From: xpk Date: Tue, 13 Jun 2023 15:47:05 +0800 Subject: [PATCH] FIX: correcting hard-coded test secret name --- .../secretsmanager-secret/main.tf | 2 +- .../secretsmanager-secret/outputs.tf | 6 ++++++ .../secretsmanager-secret/variables.tf | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 modules/security_identity_compliance/secretsmanager-secret/outputs.tf diff --git a/modules/security_identity_compliance/secretsmanager-secret/main.tf b/modules/security_identity_compliance/secretsmanager-secret/main.tf index 22cdbd0..d82cb5b 100644 --- a/modules/security_identity_compliance/secretsmanager-secret/main.tf +++ b/modules/security_identity_compliance/secretsmanager-secret/main.tf @@ -5,7 +5,7 @@ resource "random_id" "rid" { } resource "aws_secretsmanager_secret" "secret1" { - name = "test-secret-${random_id.rid.dec}" + name = "${var.secret_name}-${random_id.rid.dec}" description = var.secret_description } diff --git a/modules/security_identity_compliance/secretsmanager-secret/outputs.tf b/modules/security_identity_compliance/secretsmanager-secret/outputs.tf new file mode 100644 index 0000000..8130155 --- /dev/null +++ b/modules/security_identity_compliance/secretsmanager-secret/outputs.tf @@ -0,0 +1,6 @@ +output secret_arn { + value = aws_secretsmanager_secret.secret1.arn +} +output secret_id { + value = "${var.secret_name}-${random_id.rid.dec}" +} \ No newline at end of file diff --git a/modules/security_identity_compliance/secretsmanager-secret/variables.tf b/modules/security_identity_compliance/secretsmanager-secret/variables.tf index 4a943dc..c761904 100644 --- a/modules/security_identity_compliance/secretsmanager-secret/variables.tf +++ b/modules/security_identity_compliance/secretsmanager-secret/variables.tf @@ -1,4 +1,5 @@ variable "secret_description" {} +variable "secret_name" {} variable "secret_value" {} variable "secret_policy" { type = string