Skip to content

Commit 2d8abe5

Browse files
committed
add update documentation and example
1 parent 3ea0088 commit 2d8abe5

File tree

4 files changed

+73
-34
lines changed

4 files changed

+73
-34
lines changed

docs/resources/keypair.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "solana_keypair Resource - terraform-provider-solana"
4+
subcategory: ""
5+
description: |-
6+
Genereate a random or grinded keypair compatible with the solana-keygen CLI.
7+
---
8+
9+
# solana_keypair (Resource)
10+
11+
Genereate a random or grinded keypair compatible with the `solana-keygen` CLI.
12+
13+
## Example Usage
14+
15+
```terraform
16+
# Random Keypair
17+
resource "solana_keypair" "key" {
18+
output_path = "${path.module}/id.json"
19+
random = true
20+
}
21+
22+
# Grind Keypair
23+
resource "solana_keypair" "key" {
24+
output_path = "${path.module}/id.json"
25+
26+
grind {
27+
prefix = "abc"
28+
}
29+
}
30+
```
31+
32+
<!-- schema generated by tfplugindocs -->
33+
## Schema
34+
35+
### Required
36+
37+
- **output_path** (String) The file path to output the keypair into.
38+
39+
### Optional
40+
41+
- **grind** (Block Set, Max: 1) The grind options for the new keypair. (see [below for nested schema](#nestedblock--grind))
42+
- **id** (String) The ID of this resource.
43+
- **random** (Boolean) Whether to generate a random new keypair.
44+
45+
### Read-Only
46+
47+
- **private_key** (String, Sensitive) The randomly generated private key.
48+
- **public_key** (String) The randomly generated public key.
49+
50+
<a id="nestedblock--grind"></a>
51+
### Nested Schema for `grind`
52+
53+
Optional:
54+
55+
- **prefix** (String) The desired prefix of the public key.
56+
- **suffix** (String) The desired suffix of the public key.
57+
- **threads** (Number) The number of threads to grind for the keypair (between 1-15).
58+
59+

docs/resources/random_keypair.md

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Random Keypair
2+
resource "solana_keypair" "key" {
3+
output_path = "${path.module}/id.json"
4+
random = true
5+
}
6+
7+
# Grind Keypair
8+
resource "solana_keypair" "key" {
9+
output_path = "${path.module}/id.json"
10+
11+
grind {
12+
prefix = "abc"
13+
}
14+
}

examples/resources/solana_random_keypair/resource.tf

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)