2015-06-03 12:40:53 +02:00
|
|
|
---
|
|
|
|
layout: "cloudstack"
|
|
|
|
page_title: "CloudStack: cloudstack_ssh_keypair"
|
|
|
|
sidebar_current: "docs-cloudstack-resource-ssh-keypair"
|
|
|
|
description: |-
|
2015-06-09 12:38:05 +02:00
|
|
|
Creates or registers an SSH key pair.
|
2015-06-03 12:40:53 +02:00
|
|
|
---
|
|
|
|
|
2017-04-10 18:15:08 +02:00
|
|
|
# cloudstack_ssh_keypair
|
2015-06-03 12:40:53 +02:00
|
|
|
|
2015-06-09 12:38:05 +02:00
|
|
|
Creates or registers an SSH key pair.
|
2015-06-03 12:40:53 +02:00
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-10 18:15:08 +02:00
|
|
|
```hcl
|
2015-06-09 12:38:05 +02:00
|
|
|
resource "cloudstack_ssh_keypair" "default" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "myKey"
|
2016-02-26 23:01:56 +01:00
|
|
|
public_key = "${file("~/.ssh/id_rsa.pub")}"
|
2017-02-18 23:48:50 +01:00
|
|
|
project = "myProject"
|
2015-06-03 12:40:53 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2015-06-09 12:38:05 +02:00
|
|
|
* `name` - (Required) The name of the SSH key pair. This is a unique value
|
|
|
|
within a CloudStack account. Changing this forces a new resource to be
|
|
|
|
created.
|
2015-06-03 12:40:53 +02:00
|
|
|
|
2016-02-26 23:44:53 +01:00
|
|
|
* `public_key` - (Optional) The public key to register with CloudStack. If
|
|
|
|
this is omitted, CloudStack will generate a new key pair. The key can
|
|
|
|
be loaded from a file on disk using the [`file()` interpolation
|
|
|
|
function](/docs/configuration/interpolation.html#file_path_). Changing
|
|
|
|
this forces a new resource to be created.
|
2016-02-26 23:01:56 +01:00
|
|
|
|
|
|
|
* `project` - (Optional) The name or ID of the project to register this
|
|
|
|
key to. Changing this forces a new resource to be created.
|
2015-06-03 12:40:53 +02:00
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
2015-06-09 12:38:05 +02:00
|
|
|
* `id` - The key pair ID.
|
|
|
|
* `fingerprint` - The fingerprint of the public key specified or created.
|
|
|
|
* `private_key` - The private key generated by CloudStack. Only available
|
|
|
|
if CloudStack generated the key pair.
|