File tree Expand file tree Collapse file tree 4 files changed +10
-33
lines changed
gke/enterprise/config_sync Expand file tree Collapse file tree 4 files changed +10
-33
lines changed Original file line number Diff line number Diff line change 1515*/
1616
1717# [START gke_enterprise_config_sync_git]
18- data "google_project" "default" {}
19-
20- resource "google_container_cluster" "default" {
21- name = " gke-autopilot-basic"
22- location = " us-central1"
23-
24- fleet {
25- project = data. google_project . default . project_id
26- }
27-
28- enable_autopilot = true
29-
30- # Set `deletion_protection` to `true` will ensure that one cannot
31- # accidentally delete this instance by use of Terraform.
32- deletion_protection = false
33- }
34-
3518resource "google_gke_hub_feature" "default" {
3619 name = " configmanagement"
3720 location = " global"
Original file line number Diff line number Diff line change 1- # Copyright 2024 Google LLC
1+ # Copyright 2024-2025 Google LLC
22#
33# Licensed under the Apache License, Version 2.0 (the "License");
44# you may not use this file except in compliance with the License.
Original file line number Diff line number Diff line change 1515*/
1616
1717# [START gke_enterprise_config_sync_oci]
18- data "google_project" "default" {}
18+ resource "google_project_service" "default" {
19+ for_each = toset ([
20+ " meshconfig.googleapis.com"
21+ ])
1922
20- resource "google_container_cluster" "default" {
21- name = " gke-autopilot-basic"
22- location = " us-central1"
23-
24- fleet {
25- project = data. google_project . default . project_id
26- }
27-
28- enable_autopilot = true
29-
30- # Set `deletion_protection` to `true` will ensure that one cannot
31- # accidentally delete this instance by use of Terraform.
32- deletion_protection = false
23+ service = each. value
24+ disable_on_destroy = false
3325}
3426
3527resource "google_gke_hub_feature" "configmanagement_feature_member" {
@@ -50,5 +42,7 @@ resource "google_gke_hub_feature" "configmanagement_feature_member" {
5042 }
5143 }
5244 }
45+
46+ depends_on = [google_project_service . default ]
5347}
5448# [END gke_enterprise_config_sync_oci]
Original file line number Diff line number Diff line change 1- # Copyright 2024 Google LLC
1+ # Copyright 2024-2025 Google LLC
22#
33# Licensed under the Apache License, Version 2.0 (the "License");
44# you may not use this file except in compliance with the License.
You can’t perform that action at this time.
0 commit comments