Skip to content

Commit

Permalink
Better default/example format
Browse files Browse the repository at this point in the history
  • Loading branch information
BarnabyShearer committed Sep 27, 2023
1 parent 8374af6 commit 1d9de69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/resources/key.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ resource "random_password" "example" {}
resource "pbkdf2_key" "example" {
password = random_password.example.result
# Output for https://github.com/change-engine/pbkdf-subtle
format = "v1{{printf \"%06x\" .Iterations}}{{printf \"%s\" .Key}}"
}
```

Expand Down
2 changes: 2 additions & 0 deletions examples/resources/pbkdf2_key/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ resource "random_password" "example" {}

resource "pbkdf2_key" "example" {
password = random_password.example.result
# Output for https://github.com/change-engine/pbkdf-subtle
format = "v1{{printf \"%06x\" .Iterations}}{{printf \"%s\" .Key}}"
}
2 changes: 1 addition & 1 deletion internal/provider/key_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (r *keyResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *
MarkdownDescription: "Output format; will additionally be base64 encoded.",
Optional: true,
Computed: true,
Default: stringdefault.StaticString("{{.Key}}"),
Default: stringdefault.StaticString("{{printf \"%s\" .Key}}"),
},
"password": schema.StringAttribute{
MarkdownDescription: "Base secret.",
Expand Down

0 comments on commit 1d9de69

Please sign in to comment.