Skip to content

Commit 9c07970

Browse files
authored
fix: Update Google provider constraints to allow 4.x (#335)
* Updates google provider constraints * Updates constraints for examples * Uses new constraint syntax consistently * Moves providers into versions file * Uses ~> in simple TF project * Adjusts module constraints * Removes duplicate providers block * Adds comments to explain failing examples * Uses previously pinned provider for embedded examples * Reverts test setup * Updates deprecated constraint syntax
1 parent e1a1a6b commit 9c07970

File tree

54 files changed

+235
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+235
-204
lines changed

examples/basic_auto_mode/main.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
18-
provider "null" {
19-
version = "~> 2.1"
20-
}
21-
22-
provider "google" {
23-
version = "~> 3.45.0"
24-
}
25-
2617
# [START vpc_auto_create]
2718
resource "google_compute_network" "vpc_network" {
2819
project = var.project_id # Replace this with your project ID in quotes

examples/basic_auto_mode/versions.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@
1616

1717
terraform {
1818
required_version = ">=0.12.6"
19+
20+
required_providers {
21+
google = {
22+
version = "~> 4.0"
23+
}
24+
null = {
25+
version = "~> 2.1"
26+
}
27+
}
1928
}

examples/basic_custom_mode/main.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
18-
provider "null" {
19-
version = "~> 2.1"
20-
}
21-
22-
provider "google" {
23-
version = "~> 3.45.0"
24-
}
25-
2617
# [START vpc_custom_create]
2718
resource "google_compute_network" "vpc_network" {
2819
project = var.project_id # Replace this with your project ID in quotes

examples/basic_custom_mode/versions.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@
1616

1717
terraform {
1818
required_version = ">=0.12.6"
19+
20+
required_providers {
21+
google = {
22+
version = "~> 4.0"
23+
}
24+
null = {
25+
version = "~> 2.1"
26+
}
27+
}
1928
}

examples/basic_firewall_rule/main.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
18-
provider "null" {
19-
version = "~> 2.1"
20-
}
21-
22-
provider "google" {
23-
version = "~> 3.45.0"
24-
}
25-
2617
# [START vpc_firewall_create]
2718
resource "google_compute_firewall" "rules" {
2819
project = var.project_id # Replace this with your project ID in quotes

examples/basic_firewall_rule/versions.tf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,13 @@
1616

1717
terraform {
1818
required_version = ">=0.12.6"
19-
}
2019

20+
required_providers {
21+
google = {
22+
version = "~> 4.0"
23+
}
24+
null = {
25+
version = "~> 2.1"
26+
}
27+
}
28+
}

examples/basic_secondary_ranges/main.tf

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
18-
terraform {
19-
required_providers {
20-
google = {
21-
version = ">= 3.45.0"
22-
}
23-
null = {
24-
version = ">= 2.1.0"
25-
}
26-
}
27-
}
28-
2917
# [START vpc_secondary_range_create]
3018
resource "google_compute_subnetwork" "network-with-private-secondary-ip-ranges" {
3119
project = var.project_id # Replace this with your project ID in quotes

examples/basic_secondary_ranges/versions.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@
1616

1717
terraform {
1818
required_version = ">=0.12.6"
19+
20+
required_providers {
21+
google = {
22+
version = "~> 4.0"
23+
}
24+
null = {
25+
version = "~> 2.1"
26+
}
27+
}
1928
}

examples/basic_shared_vpc/main.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
18-
provider "null" {
19-
version = "~> 2.1"
20-
}
21-
22-
provider "google" {
23-
version = "~> 3.45.0"
24-
}
25-
2617
# [START vpc_shared_vpc_host_project_enable]
2718
resource "google_compute_shared_vpc_host_project" "host" {
2819
project = var.project # Replace this with your host project ID in quotes

examples/basic_shared_vpc/versions.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,13 @@
1616

1717
terraform {
1818
required_version = ">=0.12.6"
19+
20+
required_providers {
21+
google = {
22+
version = "~> 4.0"
23+
}
24+
null = {
25+
version = "~> 2.1"
26+
}
27+
}
1928
}

0 commit comments

Comments
 (0)