github.com/khulnasoft-lab/defsec@v1.0.5-0.20230827010352-5e9f46893d95/avd_docs/digitalocean/compute/AVD-DIG-0004/Terraform.md (about)

     1  
     2  Use ssh keys for login
     3  
     4  ```hcl
     5   data "digitalocean_ssh_key" "terraform" {
     6   	name = "myKey"
     7     }
     8     
     9   resource "digitalocean_droplet" "good_example" {
    10   	image    = "ubuntu-18-04-x64"
    11   	name     = "web-1"
    12   	region   = "nyc2"
    13   	size     = "s-1vcpu-1gb"
    14   	ssh_keys = [ data.digitalocean_ssh_key.myKey.id ]
    15   }
    16   
    17  ```
    18  
    19  #### Remediation Links
    20   - https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/droplet#ssh_keys
    21