github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/openstack/r/compute_keypair_v2.html.markdown (about) 1 --- 2 layout: "openstack" 3 page_title: "OpenStack: openstack_compute_keypair_v2" 4 sidebar_current: "docs-openstack-resource-compute-keypair-v2" 5 description: |- 6 Manages a V2 keypair resource within OpenStack. 7 --- 8 9 # openstack\_compute\_keypair_v2 10 11 Manages a V2 keypair resource within OpenStack. 12 13 ## Example Usage 14 15 ```hcl 16 resource "openstack_compute_keypair_v2" "test-keypair" { 17 name = "my-keypair" 18 public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB" 19 } 20 ``` 21 22 ## Argument Reference 23 24 The following arguments are supported: 25 26 * `region` - (Required) The region in which to obtain the V2 Compute client. 27 Keypairs are associated with accounts, but a Compute client is needed to 28 create one. If omitted, the `OS_REGION_NAME` environment variable is used. 29 Changing this creates a new keypair. 30 31 * `name` - (Required) A unique name for the keypair. Changing this creates a new 32 keypair. 33 34 * `public_key` - (Required) A pregenerated OpenSSH-formatted public key. 35 Changing this creates a new keypair. 36 37 * `value_specs` - (Optional) Map of additional options. 38 39 ## Attributes Reference 40 41 The following attributes are exported: 42 43 * `region` - See Argument Reference above. 44 * `name` - See Argument Reference above. 45 * `public_key` - See Argument Reference above. 46 47 ## Import 48 49 Keypairs can be imported using the `name`, e.g. 50 51 ``` 52 $ terraform import openstack_compute_keypair_v2.my-keypair test-keypair 53 ```