Skip to content

Commit 8e7d6ea

Browse files
Sébastien GLONrosbo
Sébastien GLON
authored andcommitted
Add new google_compute_regions (hashicorp#1603)
* Add new google_compute_regions * Add docs * correct doc
1 parent 3592997 commit 8e7d6ea

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
layout: "google"
3+
page_title: "Google: google_compute_regions"
4+
sidebar_current: "docs-google-datasource-compute-regions"
5+
description: |-
6+
Provides a list of available Google Compute regions
7+
---
8+
9+
# google\_compute\_regions
10+
11+
Provides access to available Google Compute regions for a given project.
12+
See more about [regions and regions](https://cloud.google.com/compute/docs/regions-zones/) in the upstream docs.
13+
14+
```
15+
data "google_compute_regions" "available" {}
16+
17+
resource "google_compute_subnetwork" "cluster" {
18+
count = "${length(data.google_compute_regions.available.names)}"
19+
name = "my-network"
20+
ip_cidr_range = "10.36.${count.index}.0/24"
21+
network = "my-network"
22+
region = "${data.google_compute_regions.available.names[count.index]}"
23+
}
24+
```
25+
26+
## Argument Reference
27+
28+
The following arguments are supported:
29+
30+
* `project` (Optional) - Project from which to list available regions. Defaults to project declared in the provider.
31+
* `status` (Optional) - Allows to filter list of regions based on their current status. Status can be either `UP` or `DOWN`.
32+
Defaults to no filtering (all available regions - both `UP` and `DOWN`).
33+
34+
## Attributes Reference
35+
36+
The following attribute is exported:
37+
38+
* `names` - A list of regions available in the given project

google.erb

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
<li<%= sidebar_current("docs-google-datasource-project") %>>
4444
<a href="/docs/providers/google/d/google_project.html">google_project</a>
4545
</li>
46+
<li<%= sidebar_current("docs-google-datasource-compute-regions") %>>
47+
<a href="/docs/providers/google/d/google_compute_regions.html">google_compute_regions</a>
48+
</li>
4649
<li<%= sidebar_current("docs-google-datasource-compute-ssl-policy") %>>
4750
<a href="/docs/providers/google/d/datasource_compute_ssl_policy.html">google_compute_ssl_policy</a>
4851
</li>

0 commit comments

Comments
 (0)