Files
opentf/website/source/docs/providers/do/r/ssh_key.html.markdown
Paul Stack 2559c19c8d Website: Adding an import section to the bottom of the page of importable resources (#7703)
* docs/digitalocean: Adding an import section to the bottom of the DO
importable resources

* docs/azurerm: Adding the Import sections for the AzureRM Importable resources

* docs/aws: Adding the import sections to the AWS provider pages
2016-07-19 17:22:30 +01:00

1.2 KiB

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
digitalocean DigitalOcean: digitalocean_ssh_key docs-do-resource-ssh-key Provides a DigitalOcean SSH key resource.

digitalocean_ssh_key

Provides a DigitalOcean SSH key resource to allow you manage SSH keys for Droplet access. Keys created with this resource can be referenced in your droplet configuration via their ID or fingerprint.

Example Usage

# Create a new SSH key
resource "digitalocean_ssh_key" "default" {
    name = "Terraform Example"
    public_key = "${file("/Users/terraform/.ssh/id_rsa.pub")}"
}

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the SSH key for identification
  • public_key - (Required) The public key. If this is a file, it can be read using the file interpolation function

Attributes Reference

The following attributes are exported:

  • id - The unique ID of the key
  • name - The name of the SSH key
  • public_key - The text of the public key
  • fingerprint - The fingerprint of the SSH key

Import

SSH Keys can be imported using the ssh key id, e.g.

terraform import digitalocean_ssh_key.mykey 263654