diff --git a/gke/enterprise/config_sync/git/main.tf b/gke/enterprise/config_sync/git/main.tf new file mode 100644 index 000000000..88a3a828a --- /dev/null +++ b/gke/enterprise/config_sync/git/main.tf @@ -0,0 +1,38 @@ +/** +* Copyright 2024-2025 Google LLC +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +# [START gke_enterprise_config_sync_git] +resource "google_gke_hub_feature" "default" { + name = "configmanagement" + location = "global" + + fleet_default_member_config { + configmanagement { + config_sync { + # The field `enabled` was introduced in Terraform version 5.41.0, and + # needs to be set to `true` explicitly to install Config Sync. + enabled = true + git { + sync_repo = "REPO" + sync_branch = "BRANCH" + policy_dir = "DIRECTORY" + secret_type = "SECRET" + } + } + } + } +} +# [END gke_enterprise_config_sync_git] diff --git a/gke/enterprise/config_sync/git/test.yaml b/gke/enterprise/config_sync/git/test.yaml new file mode 100644 index 000000000..ba0d2b2bc --- /dev/null +++ b/gke/enterprise/config_sync/git/test.yaml @@ -0,0 +1,21 @@ +# Copyright 2024-2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The kubernetes_manifest resource can only be used with pre-existing clusters. +apiVersion: blueprints.cloud.google.com/v1alpha1 +kind: BlueprintTest +metadata: + name: config_sync_git +spec: + skip: true diff --git a/gke/enterprise/config_sync/oci/main.tf b/gke/enterprise/config_sync/oci/main.tf new file mode 100644 index 000000000..19ef2549d --- /dev/null +++ b/gke/enterprise/config_sync/oci/main.tf @@ -0,0 +1,37 @@ +/** +* Copyright 2024-2025 Google LLC +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +# [START gke_enterprise_config_sync_oci] +resource "google_gke_hub_feature" "configmanagement_feature_member" { + name = "configmanagement" + location = "global" + + fleet_default_member_config { + configmanagement { + config_sync { + # The field `enabled` was introduced in Terraform version 5.41.0, and + # needs to be set to `true` explicitly to install Config Sync. + enabled = true + oci { + sync_repo = "REPO" + policy_dir = "DIRECTORY" + secret_type = "SECRET" + } + } + } + } +} +# [END gke_enterprise_config_sync_oci] diff --git a/gke/enterprise/config_sync/oci/test.yaml b/gke/enterprise/config_sync/oci/test.yaml new file mode 100644 index 000000000..b10c052d6 --- /dev/null +++ b/gke/enterprise/config_sync/oci/test.yaml @@ -0,0 +1,21 @@ +# Copyright 2024-2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# The kubernetes_manifest resource can only be used with pre-existing clusters. +apiVersion: blueprints.cloud.google.com/v1alpha1 +kind: BlueprintTest +metadata: + name: config_sync_oci +spec: + skip: true