Skip to content

Commit 5644f71

Browse files
committed
Migrate examples to google-beta provider
1 parent 46bc9c4 commit 5644f71

File tree

17 files changed

+44
-22
lines changed

17 files changed

+44
-22
lines changed

auth.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
/******************************************
1818
Retrieve authentication token
1919
*****************************************/
20-
data "google_client_config" "default" {}
20+
data "google_client_config" "default" {
21+
provider = "google-beta"
22+
}
2123

2224
/******************************************
2325
Configure provider

cluster_regional.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
Create regional cluster
1919
*****************************************/
2020
resource "google_container_cluster" "primary" {
21+
provider = "google-beta"
2122
count = "${var.regional ? 1 : 0}"
2223
name = "${var.name}"
2324
description = "${var.description}"
@@ -87,6 +88,7 @@ resource "google_container_cluster" "primary" {
8788
Create regional node pools
8889
*****************************************/
8990
resource "google_container_node_pool" "pools" {
91+
provider = "google-beta"
9092
count = "${var.regional ? length(var.node_pools) : 0}"
9193
name = "${lookup(var.node_pools[count.index], "name")}"
9294
project = "${var.project_id}"

cluster_zonal.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
Create zonal cluster
1919
*****************************************/
2020
resource "google_container_cluster" "zonal_primary" {
21+
provider = "google-beta"
2122
count = "${var.regional ? 0 : 1}"
2223
name = "${var.name}"
2324
description = "${var.description}"
@@ -87,6 +88,7 @@ resource "google_container_cluster" "zonal_primary" {
8788
Create zonal node pools
8889
*****************************************/
8990
resource "google_container_node_pool" "zonal_pools" {
91+
provider = "google-beta"
9092
count = "${var.regional ? 0 : length(var.node_pools)}"
9193
name = "${lookup(var.node_pools[count.index], "name")}"
9294
project = "${var.project_id}"

examples/deploy_service/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
cluster_type = "deploy-service"
1919
}
2020

21-
provider "google" {
21+
provider "google-beta" {
2222
credentials = "${file(var.credentials_path)}"
2323
region = "${var.region}"
2424
}

examples/node_pool/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
cluster_type = "node-pool"
1919
}
2020

21-
provider "google" {
21+
provider "google-beta" {
2222
credentials = "${file(var.credentials_path)}"
2323
region = "${var.region}"
2424
}

examples/shared_vpc/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
cluster_type = "shared-vpc"
1919
}
2020

21-
provider "google" {
21+
provider "google-beta" {
2222
credentials = "${file(var.credentials_path)}"
2323
region = "${var.region}"
2424
}

examples/simple_regional/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
cluster_type = "simple-regional"
1919
}
2020

21-
provider "google" {
21+
provider "google-beta" {
2222
credentials = "${file(var.credentials_path)}"
2323
region = "${var.region}"
2424
}

examples/simple_zonal/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
cluster_type = "simple-zonal"
1919
}
2020

21-
provider "google" {
21+
provider "google-beta" {
2222
credentials = "${file(var.credentials_path)}"
2323
region = "${var.region}"
2424
}

examples/stub_domains/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
cluster_type = "stub-domains"
1919
}
2020

21-
provider "google" {
21+
provider "google-beta" {
2222
credentials = "${file(var.credentials_path)}"
2323
region = "${var.region}"
2424
}

main.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
Get available zones in region
1919
*****************************************/
2020
data "google_compute_zones" "available" {
21-
project = "${var.project_id}"
22-
region = "${var.region}"
21+
provider = "google-beta"
22+
project = "${var.project_id}"
23+
region = "${var.region}"
2324
}
2425

2526
resource "random_shuffle" "available_zones" {
@@ -146,6 +147,7 @@ locals {
146147
Get available container engine versions
147148
*****************************************/
148149
data "google_container_engine_versions" "region" {
149-
zone = "${data.google_compute_zones.available.names[0]}"
150-
project = "${var.project_id}"
150+
provider = "google-beta"
151+
zone = "${data.google_compute_zones.available.names[0]}"
152+
project = "${var.project_id}"
151153
}

networks.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
*/
1616

1717
data "google_compute_network" "gke_network" {
18-
name = "${var.network}"
19-
project = "${local.network_project_id}"
18+
provider = "google-beta"
19+
name = "${var.network}"
20+
project = "${local.network_project_id}"
2021
}
2122

2223
data "google_compute_subnetwork" "gke_subnetwork" {
23-
name = "${var.subnetwork}"
24-
region = "${var.region}"
25-
project = "${local.network_project_id}"
24+
provider = "google-beta"
25+
name = "${var.subnetwork}"
26+
region = "${var.region}"
27+
project = "${local.network_project_id}"
2628
}

test/fixtures/deploy_service/network.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ resource "random_string" "suffix" {
2424
upper = false
2525
}
2626

27-
provider "google" {
27+
provider "google-beta" {
2828
credentials = "${file(local.credentials_path)}"
2929
project = "${var.project_id}"
3030
}
3131

3232
resource "google_compute_network" "main" {
33+
provider = "google-beta"
3334
name = "cft-gke-test-${random_string.suffix.result}"
3435
auto_create_subnetworks = "false"
3536
}
3637

3738
resource "google_compute_subnetwork" "main" {
39+
provider = "google-beta"
3840
name = "cft-gke-test-${random_string.suffix.result}"
3941
ip_cidr_range = "10.0.0.0/17"
4042
region = "${var.region}"

test/fixtures/node_pool/network.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ resource "random_string" "suffix" {
2424
upper = false
2525
}
2626

27-
provider "google" {
27+
provider "google-beta" {
2828
credentials = "${file(local.credentials_path)}"
2929
project = "${var.project_id}"
3030
}
3131

3232
resource "google_compute_network" "main" {
33+
provider = "google-beta"
3334
name = "cft-gke-test-${random_string.suffix.result}"
3435
auto_create_subnetworks = "false"
3536
}
3637

3738
resource "google_compute_subnetwork" "main" {
39+
provider = "google-beta"
3840
name = "cft-gke-test-${random_string.suffix.result}"
3941
ip_cidr_range = "10.0.0.0/17"
4042
region = "${var.region}"

test/fixtures/shared_vpc/network.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ resource "random_string" "suffix" {
2424
upper = false
2525
}
2626

27-
provider "google" {
27+
provider "google-beta" {
2828
credentials = "${file(local.credentials_path)}"
2929
project = "${var.project_id}"
3030
}
3131

3232
resource "google_compute_network" "main" {
33+
provider = "google-beta"
3334
name = "cft-gke-test-${random_string.suffix.result}"
3435
auto_create_subnetworks = "false"
3536
}
3637

3738
resource "google_compute_subnetwork" "main" {
39+
provider = "google-beta"
3840
name = "cft-gke-test-${random_string.suffix.result}"
3941
ip_cidr_range = "10.0.0.0/17"
4042
region = "${var.region}"

test/fixtures/simple_regional/network.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ resource "random_string" "suffix" {
2424
upper = false
2525
}
2626

27-
provider "google" {
27+
provider "google-beta" {
2828
credentials = "${file(local.credentials_path)}"
2929
project = "${var.project_id}"
3030
}
3131

3232
resource "google_compute_network" "main" {
33+
provider = "google-beta"
3334
name = "cft-gke-test-${random_string.suffix.result}"
3435
auto_create_subnetworks = "false"
3536
}
3637

3738
resource "google_compute_subnetwork" "main" {
39+
provider = "google-beta"
3840
name = "cft-gke-test-${random_string.suffix.result}"
3941
ip_cidr_range = "10.0.0.0/17"
4042
region = "${var.region}"

test/fixtures/simple_zonal/network.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ resource "random_string" "suffix" {
2424
upper = false
2525
}
2626

27-
provider "google" {
27+
provider "google-beta" {
2828
credentials = "${file(local.credentials_path)}"
2929
project = "${var.project_id}"
3030
}
3131

3232
resource "google_compute_network" "main" {
33+
provider = "google-beta"
3334
name = "cft-gke-test-${random_string.suffix.result}"
3435
auto_create_subnetworks = "false"
3536
}
3637

3738
resource "google_compute_subnetwork" "main" {
39+
provider = "google-beta"
3840
name = "cft-gke-test-${random_string.suffix.result}"
3941
ip_cidr_range = "10.0.0.0/17"
4042
region = "${var.region}"

test/fixtures/stub_domains/network.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ resource "random_string" "suffix" {
2424
upper = false
2525
}
2626

27-
provider "google" {
27+
provider "google-beta" {
2828
credentials = "${file(local.credentials_path)}"
2929
project = "${var.project_id}"
3030
}
3131

3232
resource "google_compute_network" "main" {
33+
provider = "google-beta"
3334
name = "cft-gke-test-${random_string.suffix.result}"
3435
auto_create_subnetworks = "false"
3536
}
3637

3738
resource "google_compute_subnetwork" "main" {
39+
provider = "google-beta"
3840
name = "cft-gke-test-${random_string.suffix.result}"
3941
ip_cidr_range = "10.0.0.0/17"
4042
region = "${var.region}"

0 commit comments

Comments
 (0)