Skip to content

Commit

Permalink
add region_from_zone.html.markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
BBBmau committed Feb 28, 2024
1 parent 3b475ef commit 9a898d2
Showing 1 changed file with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
page_title: region_from_zone Function - terraform-provider-google
description: |-
Returns the region within a provided zone.
---

# Function: region_from_zone

Returns the region within a provided resource's zone.

For more information about using provider-defined functions with Terraform [see the official documentation](https://developer.hashicorp.com/terraform/plugin/framework/functions/concepts).

## Example Usage

### Use with the `google` provider

```terraform
terraform {
required_providers {
google = {
source = "hashicorp/google"
}
}
}
# Value is "us-central1"
output "function_output" {
value = provider::google::region_from_zone("us-central1-b")
}
```

### Use with the `google-beta` provider

```terraform
terraform {
required_providers {
google-beta = {
source = "hashicorp/google-beta"
}
}
}
# Value is "us-central1"
output "function_output" {
value = provider::google-beta::region_from_zone("us-central1-b")
}
```

## Signature

```text
region_from_zone(zone string) string
```

## Arguments

1. `zone` (String) A string of a resource's zone

0 comments on commit 9a898d2

Please sign in to comment.