# 

# exoscale_ssh_key (Resource)



Manage Exoscale [SSH Keys](https://community.exoscale.com/product/compute/instances/how-to/ssh-keypairs/).

## Example Usage

```terraform
resource "exoscale_ssh_key" "my_ssh_key" {
  name       = "my-ssh-key"
  public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGRY..."
}
```

Should you want to _create_ an SSH keypair (including *private* key) with Terraform, please use the
[tls_private_key](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key)
resource:

```terraform
resource "tls_private_key" "my_ssh_key" {
  algorithm = "ED25519"
}

resource "exoscale_ssh_key" "my_ssh_key" {
  name       = "my-ssh-key"
  public_key = tls_private_key.my_ssh_key.public_key_openssh
}
```

Please refer to the [examples](https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples/) directory for complete configuration examples.

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `name` (String) ❗ The SSH key name.
- `public_key` (String) ❗ The SSH *public* key that will be authorized in compute instances.

### Optional

- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `fingerprint` (String) The SSH key unique identifier.
- `id` (String) The ID of this resource.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `create` (String)
- `delete` (String)
- `read` (String)

-> The symbol ❗ in an attribute indicates that modifying it, will force the creation of a new resource.

## Import

An existing SSH key may be imported as a resource by `<name>`:

```shell
terraform import \
  exoscale_ssh_key.my_ssh_key \
  my-ssh-key
```

