|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "stackit_key_pair Resource - stackit" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + 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. |
| 7 | + Usage with server |
| 8 | + ```terraform |
| 9 | + resource "stackitkeypair" "keypair" { |
| 10 | + name = "example-key-pair" |
| 11 | + publickey = chomp(file("path/to/idrsa.pub")) |
| 12 | + } |
| 13 | + resource "stackitserver" "example-server" { |
| 14 | + projectid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
| 15 | + name = "example-server" |
| 16 | + bootvolume = { |
| 17 | + size = 64 |
| 18 | + sourcetype = "image" |
| 19 | + sourceid = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
| 20 | + } |
| 21 | + availabilityzone = "eu01-1" |
| 22 | + machinetype = "g1.1" |
| 23 | + keypairname = "example-key-pair" |
| 24 | + } |
| 25 | + ~> 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. |
| 26 | +--- |
| 27 | + |
| 28 | +# stackit_key_pair (Resource) |
| 29 | + |
| 30 | +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. |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +### Usage with server |
| 35 | +```terraform |
| 36 | +resource "stackit_key_pair" "keypair" { |
| 37 | + name = "example-key-pair" |
| 38 | + public_key = chomp(file("path/to/id_rsa.pub")) |
| 39 | +} |
| 40 | +
|
| 41 | +resource "stackit_server" "example-server" { |
| 42 | + project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
| 43 | + name = "example-server" |
| 44 | + boot_volume = { |
| 45 | + size = 64 |
| 46 | + source_type = "image" |
| 47 | + source_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" |
| 48 | + } |
| 49 | + availability_zone = "eu01-1" |
| 50 | + machine_type = "g1.1" |
| 51 | + keypair_name = "example-key-pair" |
| 52 | +} |
| 53 | +
|
| 54 | +
|
| 55 | +~> 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. |
| 56 | +
|
| 57 | +
|
| 58 | +
|
| 59 | +<!-- schema generated by tfplugindocs --> |
| 60 | +## Schema |
| 61 | +
|
| 62 | +### Required |
| 63 | +
|
| 64 | +- `name` (String) The name of the SSH key pair. |
| 65 | +- `public_key` (String) A string representation of the public SSH key. E.g., `ssh-rsa <key_data>` or `ssh-ed25519 <key-data>`. |
| 66 | +
|
| 67 | +### Optional |
| 68 | +
|
| 69 | +- `labels` (Map of String) Labels are key-value string pairs which can be attached to a resource container. |
| 70 | +
|
| 71 | +### Read-Only |
| 72 | +
|
| 73 | +- `fingerprint` (String) The fingerprint of the public SSH key. |
| 74 | +- `id` (String) Terraform's internal resource ID. It takes the value of the key pair "`name`". |
0 commit comments