Skip to content

Commit 0b36ebb

Browse files
authored
feat: Add secret_string and secret_binary to outputs (#8)
1 parent 6e549c2 commit 0b36ebb

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ No modules.
184184
| Name | Description |
185185
|------|-------------|
186186
| <a name="output_secret_arn"></a> [secret\_arn](#output\_secret\_arn) | The ARN of the secret |
187+
| <a name="output_secret_binary"></a> [secret\_binary](#output\_secret\_binary) | The secret binary |
187188
| <a name="output_secret_id"></a> [secret\_id](#output\_secret\_id) | The ID of the secret |
188189
| <a name="output_secret_replica"></a> [secret\_replica](#output\_secret\_replica) | Attributes of the replica created |
190+
| <a name="output_secret_string"></a> [secret\_string](#output\_secret\_string) | The secret string |
189191
| <a name="output_secret_version_id"></a> [secret\_version\_id](#output\_secret\_version\_id) | The unique identifier of the version of the secret |
190192
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
191193

examples/complete/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ No inputs.
6464
| <a name="output_rotate_secret_arn"></a> [rotate\_secret\_arn](#output\_rotate\_secret\_arn) | The ARN of the secret |
6565
| <a name="output_rotate_secret_id"></a> [rotate\_secret\_id](#output\_rotate\_secret\_id) | The ID of the secret |
6666
| <a name="output_rotate_secret_replica"></a> [rotate\_secret\_replica](#output\_rotate\_secret\_replica) | Attributes of the replica created |
67+
| <a name="output_rotate_secret_string"></a> [rotate\_secret\_string](#output\_rotate\_secret\_string) | The secret string |
6768
| <a name="output_rotate_secret_version_id"></a> [rotate\_secret\_version\_id](#output\_rotate\_secret\_version\_id) | The unique identifier of the version of the secret |
6869
| <a name="output_standard_secret_arn"></a> [standard\_secret\_arn](#output\_standard\_secret\_arn) | The ARN of the secret |
6970
| <a name="output_standard_secret_id"></a> [standard\_secret\_id](#output\_standard\_secret\_id) | The ID of the secret |
7071
| <a name="output_standard_secret_replica"></a> [standard\_secret\_replica](#output\_standard\_secret\_replica) | Attributes of the replica created |
72+
| <a name="output_standard_secret_string"></a> [standard\_secret\_string](#output\_standard\_secret\_string) | The secret string |
7173
| <a name="output_standard_secret_version_id"></a> [standard\_secret\_version\_id](#output\_standard\_secret\_version\_id) | The unique identifier of the version of the secret |
7274
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
7375

examples/complete/outputs.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ output "standard_secret_version_id" {
2222
value = module.secrets_manager.secret_version_id
2323
}
2424

25+
output "standard_secret_string" {
26+
description = "The secret string"
27+
sensitive = true
28+
value = module.secrets_manager.secret_string
29+
}
30+
2531
################################################################################
2632
# Rotate
2733
################################################################################
@@ -45,3 +51,9 @@ output "rotate_secret_version_id" {
4551
description = "The unique identifier of the version of the secret"
4652
value = module.secrets_manager_rotate.secret_version_id
4753
}
54+
55+
output "rotate_secret_string" {
56+
description = "The secret string"
57+
sensitive = true
58+
value = module.secrets_manager_rotate.secret_string
59+
}

outputs.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ output "secret_replica" {
1717
value = try(aws_secretsmanager_secret.this[0].replica, null)
1818
}
1919

20+
output "secret_string" {
21+
description = "The secret string"
22+
sensitive = true
23+
value = try(aws_secretsmanager_secret_version.this[0].secret_string, aws_secretsmanager_secret_version.ignore_changes[0].secret_string, null)
24+
}
25+
26+
output "secret_binary" {
27+
description = "The secret binary"
28+
sensitive = true
29+
value = try(aws_secretsmanager_secret_version.this[0].secret_binary, aws_secretsmanager_secret_version.ignore_changes[0].secret_binary, null)
30+
}
31+
2032
################################################################################
2133
# Version
2234
################################################################################

wrappers/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
output "wrapper" {
22
description = "Map of outputs of a wrapper."
33
value = module.wrapper
4-
# sensitive = false # No sensitive module output found
4+
sensitive = true # At least one sensitive module output (secret_string) found (requires Terraform 0.14+)
55
}

0 commit comments

Comments
 (0)