Skip to content

Commit bd7c497

Browse files
CPL-markusjelinek-wgs
authored andcommitted
Added remote fleet support for anthos modules
1 parent 654868e commit bd7c497

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

modules/acm/feature.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ resource "google_gke_hub_feature_membership" "main" {
3333
feature = "configmanagement"
3434

3535
membership = module.registration.cluster_membership_id
36-
project = var.project_id
36+
project = try(var.hub_project_id, var.project_id)
3737

3838
configmanagement {
3939
version = var.configmanagement_version

modules/acm/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module "registration" {
2424

2525
cluster_name = var.cluster_name
2626
project_id = var.project_id
27+
hub_project_id = var.hub_project_id
2728
location = var.location
2829
enable_fleet_registration = var.enable_fleet_registration
2930
membership_name = var.cluster_membership_id

modules/acm/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ variable "project_id" {
2424
type = string
2525
}
2626

27+
variable "hub_project_id" {
28+
description = "The project in which the GKE Hub belongs. Defaults to GKE cluster project_id."
29+
type = string
30+
default = ""
31+
}
32+
2733
variable "location" {
2834
description = "GCP location used to reach cluster."
2935
type = string

0 commit comments

Comments
 (0)