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
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Unreleased

FEATURES:
* Add `key_type` support in `vault_ssh_secret_backend_ca`. ([#2218](https://github.com/hashicorp/terraform-provider-vault/pull/2218))

## 4.2.0 (Mar 27, 2024)

FEATURES:
Expand Down
7 changes: 7 additions & 0 deletions vault/resource_ssh_secret_backend_ca.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions vault/resource_ssh_secret_backend_ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
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
Expand Up @@ -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.
Expand Down
Loading