--- # generated by https://github.com/hashicorp/terraform-plugin-docs page_title: "stackit_key_pair Resource - stackit" subcategory: "" description: |- Key pair resource schema. Must have a region specified in the provider configuration. Allows uploading an SSH public key to be used for server authentication. Usage with server resource "stackit_key_pair" "keypair" { name = "example-key-pair" public_key = chomp(file("path/to/id_rsa.pub")) } resource "stackit_server" "example-server" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name = "example-server" boot_volume = { size = 64 source_type = "image" source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } availability_zone = "eu01-1" machine_type = "g1.1" keypair_name = "example-key-pair" } ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources for how to opt-in to use beta resources. --- # stackit_key_pair (Resource) Key pair resource schema. Must have a `region` specified in the provider configuration. Allows uploading an SSH public key to be used for server authentication. ### Usage with server ```terraform resource "stackit_key_pair" "keypair" { name = "example-key-pair" public_key = chomp(file("path/to/id_rsa.pub")) } resource "stackit_server" "example-server" { project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" name = "example-server" boot_volume = { size = 64 source_type = "image" source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" } availability_zone = "eu01-1" machine_type = "g1.1" keypair_name = "example-key-pair" } ``` ~> This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our [guide](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs/guides/opting_into_beta_resources) for how to opt-in to use beta resources. ## Schema ### Required - `name` (String) The name of the SSH key pair. - `public_key` (String) A string representation of the public SSH key. E.g., `ssh-rsa ` or `ssh-ed25519 `. ### Optional - `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. ### Read-Only - `fingerprint` (String) The fingerprint of the public SSH key. - `id` (String) Terraform's internal resource ID. It takes the value of the key pair "`name`".