Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ssh): add support for key_type parameter #2218

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(ssh): add support for key_type parameter
Add support for `key_type` parameter in SSH Secret Engine, so we can
specify types other than the default `ssh-rsa`.
radek-sprta committed Apr 2, 2024
commit fb15994b5839c0abb4ada2c0e4e940bd30baf1ef
7 changes: 7 additions & 0 deletions vault/resource_ssh_secret_backend_ca.go
Original file line number Diff line number Diff line change
@@ -41,6 +41,13 @@ func sshSecretBackendCAResource() *schema.Resource {
ForceNew: true,
Description: "Whether Vault should generate the signing key pair internally.",
},
"key_type": {
Type: schema.TypeString,
Optional: true,
Default: "ssh-rsa",
ForceNew: true,
Description: "Specifies the desired key type for the generated SSH CA key when generate_signing_key is set to true.",
},
"private_key": {
Type: schema.TypeString,
Optional: true,
1 change: 1 addition & 0 deletions vault/resource_ssh_secret_backend_ca_test.go
Original file line number Diff line number Diff line change
@@ -101,6 +101,7 @@ resource "vault_mount" "test" {
resource "vault_ssh_secret_backend_ca" "test" {
backend = vault_mount.test.path
generate_signing_key = true
key_type = "ssh-ed25519"
}`, backend)
}

2 changes: 2 additions & 0 deletions website/docs/r/ssh_secret_backend_ca.html.md
Original file line number Diff line number Diff line change
@@ -36,6 +36,8 @@ The following arguments are supported:

* `generate_signing_key` - (Optional) Whether Vault should generate the signing key pair internally. Defaults to true

* `key_type` - (Optional) Specifies the desired key type for the generated SSH CA key when generate_signing_key is set to true. Defaults to 'ssh-rsa'.

* `public_key` - (Optional) The public key part the SSH CA key pair; required if generate_signing_key is false.

* `private_key` - (Optional) The private key part the SSH CA key pair; required if generate_signing_key is false.