```hcl
variable auth_url {}
variable tenant_id {}
variable tenant_name {}
variable region {}
variable keypair_name {}
variable public_key {}

provider "openstack" {
  auth_url      = "${ var.auth_url }"
  tenant_id     = "${ var.tenant_id }"
  tenant_name   = "${ var.tenant_name }"
}

resource "openstack_compute_keypair_v2" "keypair" {
  region        = "${ var.region }"
  name          = "${ var.keypair_name }"
  public_key    = "${ file(var.public_key) }"
}

output "keypair_name" {
	value = "${ openstack_compute_keypair_v2.keypair.name }"
}

output "region" {
	value = "${ openstack_compute_keypair_v2.keypair.region }"
}
```

Remove region from openstack keypair module
user
```hcl
variable auth_url {}
variable tenant_id {}
variable tenant_name {}
variable keypair_name {}
variable public_key {}

provider "openstack" {
  auth_url      = "${ var.auth_url }"
  tenant_id     = "${ var.tenant_id }"
  tenant_name   = "${ var.tenant_name }"
}

resource "openstack_compute_keypair_v2" "keypair" {
  name          = "${ var.keypair_name }"
  public_key    = "${ file(var.public_key) }"
}

output "keypair_name" {
	value = "${ openstack_compute_keypair_v2.keypair.name }"
}
```
assistant