Skip to content

Commit 13a08a4

Browse files
author
Aaron Lane
committed
Update beta_cluster project configuration
1 parent cfbdefc commit 13a08a4

File tree

4 files changed

+9
-19
lines changed

4 files changed

+9
-19
lines changed

test/fixtures/beta_cluster/main.tf

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

17-
18-
provider "google" {
19-
version = "~> 2.18.0"
20-
project = var.project_id
21-
region = var.region
22-
}
23-
24-
provider "google-beta" {
25-
version = "~> 2.18.0"
26-
project = var.project_id
27-
region = var.region
28-
}
29-
3017
locals {
31-
name = "beta-cluster-${random_string.suffix.result}"
18+
name = "beta-cluster-${random_string.suffix.result}"
19+
project_id = var.project_ids[0]
3220
}
3321

3422
resource "google_kms_key_ring" "db" {
3523
location = var.region
3624
name = "${local.name}-db"
25+
project = local.project_id
3726
}
3827

3928
resource "google_kms_crypto_key" "db" {
@@ -45,7 +34,7 @@ module "this" {
4534
source = "../../../examples/simple_regional_beta"
4635

4736
cluster_name_suffix = "-${random_string.suffix.result}"
48-
project_id = var.project_id
37+
project_id = local.project_id
4938
regional = false
5039
region = var.region
5140
zones = slice(var.zones, 0, 1)

test/fixtures/beta_cluster/network.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ resource "random_string" "suffix" {
2323
resource "google_compute_network" "main" {
2424
name = "cft-gke-test-${random_string.suffix.result}"
2525
auto_create_subnetworks = false
26+
project = local.project_id
2627
}
2728

2829
resource "google_compute_subnetwork" "main" {
2930
name = "cft-gke-test-${random_string.suffix.result}"
3031
ip_cidr_range = "10.0.0.0/17"
3132
region = var.region
3233
network = google_compute_network.main.self_link
34+
project = local.project_id
3335

3436
secondary_ip_range {
3537
range_name = "cft-gke-test-pods-${random_string.suffix.result}"
@@ -41,4 +43,3 @@ resource "google_compute_subnetwork" "main" {
4143
ip_cidr_range = "192.168.64.0/18"
4244
}
4345
}
44-

test/fixtures/beta_cluster/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
output "project_id" {
18-
value = var.project_id
18+
value = local.project_id
1919
}
2020

2121
output "region" {

test/setup/iam.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ resource "google_service_account_key" "int_test" {
7575
}
7676

7777
resource "google_project_iam_binding" "kubernetes_engine_kms_access" {
78-
project = module.gke-project.project_id
78+
project = module.gke-project-1.project_id
7979
role = "roles/cloudkms.cryptoKeyEncrypterDecrypter"
8080

8181
members = [
82-
"serviceAccount:service-${module.gke-project.project_number}@container-engine-robot.iam.gserviceaccount.com",
82+
"serviceAccount:service-${module.gke-project-1.project_number}@container-engine-robot.iam.gserviceaccount.com",
8383
]
8484
}

0 commit comments

Comments
 (0)