File tree Expand file tree Collapse file tree 4 files changed +9
-19
lines changed Expand file tree Collapse file tree 4 files changed +9
-19
lines changed Original file line number Diff line number Diff line change 14
14
* limitations under the License.
15
15
*/
16
16
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
-
30
17
locals {
31
- name = " beta-cluster-${ random_string . suffix . result } "
18
+ name = " beta-cluster-${ random_string . suffix . result } "
19
+ project_id = var. project_ids [0 ]
32
20
}
33
21
34
22
resource "google_kms_key_ring" "db" {
35
23
location = var. region
36
24
name = " ${ local . name } -db"
25
+ project = local. project_id
37
26
}
38
27
39
28
resource "google_kms_crypto_key" "db" {
@@ -45,7 +34,7 @@ module "this" {
45
34
source = " ../../../examples/simple_regional_beta"
46
35
47
36
cluster_name_suffix = " -${ random_string . suffix . result } "
48
- project_id = var . project_id
37
+ project_id = local . project_id
49
38
regional = false
50
39
region = var. region
51
40
zones = slice (var. zones , 0 , 1 )
Original file line number Diff line number Diff line change @@ -23,13 +23,15 @@ resource "random_string" "suffix" {
23
23
resource "google_compute_network" "main" {
24
24
name = " cft-gke-test-${ random_string . suffix . result } "
25
25
auto_create_subnetworks = false
26
+ project = local. project_id
26
27
}
27
28
28
29
resource "google_compute_subnetwork" "main" {
29
30
name = " cft-gke-test-${ random_string . suffix . result } "
30
31
ip_cidr_range = " 10.0.0.0/17"
31
32
region = var. region
32
33
network = google_compute_network. main . self_link
34
+ project = local. project_id
33
35
34
36
secondary_ip_range {
35
37
range_name = " cft-gke-test-pods-${ random_string . suffix . result } "
@@ -41,4 +43,3 @@ resource "google_compute_subnetwork" "main" {
41
43
ip_cidr_range = " 192.168.64.0/18"
42
44
}
43
45
}
44
-
Original file line number Diff line number Diff line change 15
15
*/
16
16
17
17
output "project_id" {
18
- value = var . project_id
18
+ value = local . project_id
19
19
}
20
20
21
21
output "region" {
Original file line number Diff line number Diff line change @@ -75,10 +75,10 @@ resource "google_service_account_key" "int_test" {
75
75
}
76
76
77
77
resource "google_project_iam_binding" "kubernetes_engine_kms_access" {
78
- project = module. gke-project . project_id
78
+ project = module. gke-project-1 . project_id
79
79
role = " roles/cloudkms.cryptoKeyEncrypterDecrypter"
80
80
81
81
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" ,
83
83
]
84
84
}
You can’t perform that action at this time.
0 commit comments