File tree 8 files changed +47
-9
lines changed
2-multitenant/modules/env_baseline
8 files changed +47
-9
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,9 @@ module "eab_fleet_project" {
60
60
activate_apis = [
61
61
" gkehub.googleapis.com" ,
62
62
" anthos.googleapis.com" ,
63
- " compute.googleapis.com"
63
+ " compute.googleapis.com" ,
64
+ " multiclusteringress.googleapis.com" ,
65
+ " multiclusterservicediscovery.googleapis.com"
64
66
]
65
67
}
66
68
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ module "env" {
25
25
source = " ../../modules/env_baseline"
26
26
27
27
env = local. env
28
- project_id = var. fleet_project_id
28
+ fleet_project_id = var. fleet_project_id
29
29
scope_id = local. scope_id
30
30
cluster_membership_ids = var. cluster_membership_ids
31
31
namespace_id = local. namespace_id
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ module "env" {
25
25
source = " ../../modules/env_baseline"
26
26
27
27
env = local. env
28
- project_id = var. fleet_project_id
28
+ fleet_project_id = var. fleet_project_id
29
29
scope_id = local. scope_id
30
30
cluster_membership_ids = var. cluster_membership_ids
31
31
namespace_id = local. namespace_id
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ module "env" {
25
25
source = " ../../modules/env_baseline"
26
26
27
27
env = local. env
28
- project_id = var. fleet_project_id
28
+ fleet_project_id = var. fleet_project_id
29
29
scope_id = local. scope_id
30
30
cluster_membership_ids = var. cluster_membership_ids
31
31
namespace_id = local. namespace_id
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ The following resources are created:
13
13
| ------| -------------| ------| ---------| :--------:|
14
14
| cluster\_ membership\_ ids | The membership IDs in the scope | ` list(string) ` | n/a | yes |
15
15
| env | The environment to prepare (ex. development) | ` string ` | n/a | yes |
16
+ | fleet\_ project\_ id | The fleet project ID | ` string ` | n/a | yes |
16
17
| namespace\_ id | The fleet namespace ID | ` string ` | n/a | yes |
17
- | project\_ id | The fleet project ID | ` string ` | n/a | yes |
18
18
| scope\_ id | The fleet scope ID | ` string ` | n/a | yes |
19
19
20
20
## Outputs
Original file line number Diff line number Diff line change @@ -26,14 +26,14 @@ resource "random_string" "suffix" {
26
26
27
27
resource "google_gke_hub_scope" "fleet-scope" {
28
28
scope_id = " ${ var . scope_id } -${ var . env } "
29
- project = var. project_id
29
+ project = var. fleet_project_id
30
30
}
31
31
32
32
resource "google_gke_hub_namespace" "fleet-ns" {
33
33
scope_namespace_id = " ${ var . namespace_id } -${ var . env } "
34
34
scope_id = google_gke_hub_scope. fleet-scope . scope_id
35
35
scope = google_gke_hub_scope. fleet-scope . name
36
- project = var. project_id
36
+ project = var. fleet_project_id
37
37
}
38
38
39
39
resource "google_gke_hub_membership_binding" "membership-binding" {
@@ -43,5 +43,5 @@ resource "google_gke_hub_membership_binding" "membership-binding" {
43
43
scope = google_gke_hub_scope. fleet-scope . name
44
44
membership_id = regex (local. membership_re , each. key )[2 ]
45
45
location = regex (local. membership_re , each. key )[1 ]
46
- project = var. project_id
46
+ project = var. fleet_project_id
47
47
}
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * Copyright 2024 Google LLC
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ locals {
18
+ fleet_membership_re = " //gkehub.googleapis.com/(.*)$"
19
+ }
20
+
21
+ resource "google_gke_hub_feature" "mci" {
22
+ name = " multiclusteringress"
23
+ location = " global"
24
+ project = var. fleet_project_id
25
+ spec {
26
+ multiclusteringress {
27
+ config_membership = regex (local. fleet_membership_re , var. cluster_membership_ids [0 ])[0 ]
28
+ }
29
+ }
30
+ }
31
+
32
+ resource "google_gke_hub_feature" "mcs" {
33
+ name = " multiclusterservicediscovery"
34
+ location = " global"
35
+ project = var. fleet_project_id
36
+ }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ variable "env" {
19
19
type = string
20
20
}
21
21
22
- variable "project_id " {
22
+ variable "fleet_project_id " {
23
23
description = " The fleet project ID"
24
24
type = string
25
25
}
You can’t perform that action at this time.
0 commit comments