Complete examples

This commit is contained in:
Abel Luck 2025-06-03 13:33:14 +02:00
parent 9fe172e8f2
commit 7724c245d5
10 changed files with 263 additions and 6 deletions

View file

@ -10,7 +10,46 @@ description: |-
Generates Ed25519 private key for Tor relay identity as required by the Tor specification.
## Example Usage
```terraform
# Copyright (c) Abel Luck <abel@guardianproject.info>
# SPDX-License-Identifier: GPL-3.0-or-later
terraform {
required_providers {
tor = {
source = "guardianproject/tor"
}
}
}
provider "tor" {}
# Example: Generate Ed25519 identity key for Tor relay
resource "tor_relay_identity_ed25519" "example" {}
output "private_key_pem" {
description = "Ed25519 private key in PEM format"
value = tor_relay_identity_ed25519.example.private_key_pem
sensitive = true
}
output "public_key_pem" {
description = "Ed25519 public key in PEM format"
value = tor_relay_identity_ed25519.example.public_key_pem
}
output "public_key_fingerprint_sha1" {
description = "SHA1 fingerprint of the Ed25519 public key"
value = tor_relay_identity_ed25519.example.public_key_fingerprint_sha1
}
output "public_key_fingerprint_sha256" {
description = "SHA256 fingerprint of the Ed25519 public key"
value = tor_relay_identity_ed25519.example.public_key_fingerprint_sha256
}
```
<!-- schema generated by tfplugindocs -->
## Schema