Skip to content

Commit

Permalink
add secret outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
magreenbaum committed Sep 15, 2024
1 parent 6e549c2 commit c696ae7
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_secret_arn"></a> [secret\_arn](#output\_secret\_arn) | The ARN of the secret |
| <a name="output_secret_binary"></a> [secret\_binary](#output\_secret\_binary) | The secret binary |
| <a name="output_secret_id"></a> [secret\_id](#output\_secret\_id) | The ID of the secret |
| <a name="output_secret_replica"></a> [secret\_replica](#output\_secret\_replica) | Attributes of the replica created |
| <a name="output_secret_string"></a> [secret\_string](#output\_secret\_string) | The secret string |
| <a name="output_secret_version_id"></a> [secret\_version\_id](#output\_secret\_version\_id) | The unique identifier of the version of the secret |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Expand Down
2 changes: 2 additions & 0 deletions examples/complete/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ No inputs.
| <a name="output_rotate_secret_arn"></a> [rotate\_secret\_arn](#output\_rotate\_secret\_arn) | The ARN of the secret |
| <a name="output_rotate_secret_id"></a> [rotate\_secret\_id](#output\_rotate\_secret\_id) | The ID of the secret |
| <a name="output_rotate_secret_replica"></a> [rotate\_secret\_replica](#output\_rotate\_secret\_replica) | Attributes of the replica created |
| <a name="output_rotate_secret_string"></a> [rotate\_secret\_string](#output\_rotate\_secret\_string) | The secret string |
| <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 |
| <a name="output_standard_secret_arn"></a> [standard\_secret\_arn](#output\_standard\_secret\_arn) | The ARN of the secret |
| <a name="output_standard_secret_id"></a> [standard\_secret\_id](#output\_standard\_secret\_id) | The ID of the secret |
| <a name="output_standard_secret_replica"></a> [standard\_secret\_replica](#output\_standard\_secret\_replica) | Attributes of the replica created |
| <a name="output_standard_secret_string"></a> [standard\_secret\_string](#output\_standard\_secret\_string) | The secret string |
| <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 |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Expand Down
12 changes: 12 additions & 0 deletions examples/complete/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ output "standard_secret_version_id" {
value = module.secrets_manager.secret_version_id
}

output "standard_secret_string" {
description = "The secret string"
sensitive = true
value = module.secrets_manager.secret_string
}

################################################################################
# Rotate
################################################################################
Expand All @@ -45,3 +51,9 @@ output "rotate_secret_version_id" {
description = "The unique identifier of the version of the secret"
value = module.secrets_manager_rotate.secret_version_id
}

output "rotate_secret_string" {
description = "The secret string"
sensitive = true
value = module.secrets_manager_rotate.secret_string
}
12 changes: 12 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ output "secret_replica" {
value = try(aws_secretsmanager_secret.this[0].replica, null)
}

output "secret_string" {
description = "The secret string"
sensitive = true
value = try(aws_secretsmanager_secret_version.this[0].secret_string, aws_secretsmanager_secret_version.ignore_changes[0].secret_string, null)
}

output "secret_binary" {
description = "The secret binary"
sensitive = true
value = try(aws_secretsmanager_secret_version.this[0].secret_binary, aws_secretsmanager_secret_version.ignore_changes[0].secret_binary, null)
}

################################################################################
# Version
################################################################################
Expand Down
2 changes: 1 addition & 1 deletion wrappers/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
output "wrapper" {
description = "Map of outputs of a wrapper."
value = module.wrapper
# sensitive = false # No sensitive module output found
sensitive = true # At least one sensitive module output (secret_string) found (requires Terraform 0.14+)
}

0 comments on commit c696ae7

Please sign in to comment.