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