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 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-
3017locals {
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
3422resource "google_kms_key_ring" "db" {
3523 location = var. region
3624 name = " ${ local . name } -db"
25+ project = local. project_id
3726}
3827
3928resource "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 )
Original file line number Diff line number Diff line change @@ -23,13 +23,15 @@ resource "random_string" "suffix" {
2323resource "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
2829resource "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-
Original file line number Diff line number Diff line change 1515 */
1616
1717output "project_id" {
18- value = var . project_id
18+ value = local . project_id
1919}
2020
2121output "region" {
Original file line number Diff line number Diff line change @@ -75,10 +75,10 @@ resource "google_service_account_key" "int_test" {
7575}
7676
7777resource "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}
You can’t perform that action at this time.
0 commit comments