---
title: "openstack_compute_keypair_v2.md"
description: ""
sidebar_position: 4
---

# openstack\_compute\_keypair\_v2

:::info

Эта инструкция — копия официальной документации OpenStack Terraform-провайдера в [Terraform Registry](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs).

:::

Use this data source to get the ID and public key of an OpenStack keypair.

## Example Usage \{#example-usage}

```hcl
data "openstack_compute_keypair_v2" "kp" {
  name = "sand"
}
```

## Argument Reference \{#argument-reference}

* `region` - (Optional) The region in which to obtain the V2 Compute client.
  If omitted, the `region` argument of the provider is used.

* `name` - (Required) The unique name of the keypair.

* `user_id` - (Optional) The user id of the owner of the key pair.
  This parameter can be specified only if the provider is configured to use
  the credentials of an OpenStack administrator.

## Attributes Reference \{#attributes-reference}

The following attributes are exported:

* `region` - See Argument Reference above.
* `name` - See Argument Reference above.
* `user_id` - See Argument Reference above.
* `fingerprint` - The fingerprint of the OpenSSH key.
* `public_key` - The OpenSSH-formatted public key of the keypair.
