diff --git a/.changelog/11285.txt b/.changelog/11285.txt new file mode 100644 index 00000000000..68252f60adc --- /dev/null +++ b/.changelog/11285.txt @@ -0,0 +1,6 @@ +```release-note:enhancement +gkehub: added `config_management.management` and `config_management.config_sync.enabled` fields to `google_gkehub_feature_membership` +``` +```release-note:enhancement +clouddeploy: added `gke.proxy_url` field to `google_clouddeploy_target` +``` \ No newline at end of file diff --git a/go.mod b/go.mod index 1e306096717..5cf1275b72b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.21 require ( cloud.google.com/go/bigtable v1.27.2-0.20240730134218-123c88616251 - github.com/GoogleCloudPlatform/declarative-resource-client-library v1.68.0 + github.com/GoogleCloudPlatform/declarative-resource-client-library v1.70.0 github.com/apparentlymart/go-cidr v1.1.0 github.com/davecgh/go-spew v1.1.1 github.com/dnaeon/go-vcr v1.0.1 diff --git a/go.sum b/go.sum index 97504a3b692..8346dc53b05 100644 --- a/go.sum +++ b/go.sum @@ -24,6 +24,8 @@ dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/GoogleCloudPlatform/declarative-resource-client-library v1.68.0 h1:LIPIYi4hy7ttUSrziY/TYwMDuEvvV593n80kRmz6nZ4= github.com/GoogleCloudPlatform/declarative-resource-client-library v1.68.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k= +github.com/GoogleCloudPlatform/declarative-resource-client-library v1.70.0 h1:dqqxHZYK0tlzViFqAbKzMIkfboQVWYN1CTEM2sjBtmQ= +github.com/GoogleCloudPlatform/declarative-resource-client-library v1.70.0/go.mod h1:pL2Qt5HT+x6xrTd806oMiM3awW6kNIXB/iiuClz6m6k= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= diff --git a/google/services/clouddeploy/resource_clouddeploy_target.go b/google/services/clouddeploy/resource_clouddeploy_target.go index 5f42cd84bd3..631206922b5 100644 --- a/google/services/clouddeploy/resource_clouddeploy_target.go +++ b/google/services/clouddeploy/resource_clouddeploy_target.go @@ -306,6 +306,12 @@ func ClouddeployTargetGkeSchema() *schema.Resource { Optional: true, Description: "Optional. If true, `cluster` is accessed using the private IP address of the control plane endpoint. Otherwise, the default IP address of the control plane endpoint is used. The default IP address is the private IP address for clusters with private control-plane endpoints and the public IP address otherwise. Only specify this option when `cluster` is a [private GKE cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept).", }, + + "proxy_url": { + Type: schema.TypeString, + Optional: true, + Description: "Optional. If set, used to configure a [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy) to the Kubernetes server.", + }, }, } } @@ -766,6 +772,7 @@ func expandClouddeployTargetGke(o interface{}) *clouddeploy.TargetGke { return &clouddeploy.TargetGke{ Cluster: dcl.String(obj["cluster"].(string)), InternalIP: dcl.Bool(obj["internal_ip"].(bool)), + ProxyUrl: dcl.String(obj["proxy_url"].(string)), } } @@ -776,6 +783,7 @@ func flattenClouddeployTargetGke(obj *clouddeploy.TargetGke) interface{} { transformed := map[string]interface{}{ "cluster": obj.Cluster, "internal_ip": obj.InternalIP, + "proxy_url": obj.ProxyUrl, } return []interface{}{transformed} diff --git a/google/services/clouddeploy/resource_clouddeploy_target_generated_test.go b/google/services/clouddeploy/resource_clouddeploy_target_generated_test.go index b698e7e52b6..1e54a5eaeec 100644 --- a/google/services/clouddeploy/resource_clouddeploy_target_generated_test.go +++ b/google/services/clouddeploy/resource_clouddeploy_target_generated_test.go @@ -275,6 +275,7 @@ resource "google_clouddeploy_target" "primary" { gke { cluster = "projects/%{project_name}/locations/%{region}/clusters/different-example-cluster-name" internal_ip = true + proxy_url = "http://10.0.0.1" } project = "%{project_name}" diff --git a/google/services/gkehub/resource_gke_hub_feature_membership.go b/google/services/gkehub/resource_gke_hub_feature_membership.go index 1fdce92b3dd..b1ab06e6d26 100644 --- a/google/services/gkehub/resource_gke_hub_feature_membership.go +++ b/google/services/gkehub/resource_gke_hub_feature_membership.go @@ -146,10 +146,17 @@ func GkeHubFeatureMembershipConfigmanagementSchema() *schema.Resource { Elem: GkeHubFeatureMembershipConfigmanagementHierarchyControllerSchema(), }, + "management": { + Type: schema.TypeString, + Computed: true, + Optional: true, + Description: "Set this field to MANAGEMENT_AUTOMATIC to enable Config Sync auto-upgrades, and set this field to MANAGEMENT_MANUAL or MANAGEMENT_UNSPECIFIED to disable Config Sync auto-upgrades.", + }, + "policy_controller": { Type: schema.TypeList, Optional: true, - Description: "Policy Controller configuration for the cluster.", + Description: "**DEPRECATED** Configuring Policy Controller through the configmanagement feature is no longer recommended. Use the policycontroller feature instead.", MaxItems: 1, Elem: GkeHubFeatureMembershipConfigmanagementPolicyControllerSchema(), }, @@ -179,6 +186,12 @@ func GkeHubFeatureMembershipConfigmanagementBinauthzSchema() *schema.Resource { func GkeHubFeatureMembershipConfigmanagementConfigSyncSchema() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ + "enabled": { + Type: schema.TypeBool, + Optional: true, + Description: "Enables the installation of ConfigSync. If set to true, ConfigSync resources will be created and the other ConfigSync fields will be applied if exist. If set to false, all other ConfigSync fields will be ignored, ConfigSync resources will be deleted. If omitted, ConfigSync resources will be managed depends on the presence of the git or oci field.", + }, + "git": { Type: schema.TypeList, Optional: true, @@ -985,6 +998,7 @@ func expandGkeHubFeatureMembershipConfigmanagement(o interface{}) *gkehub.Featur Binauthz: expandGkeHubFeatureMembershipConfigmanagementBinauthz(obj["binauthz"]), ConfigSync: expandGkeHubFeatureMembershipConfigmanagementConfigSync(obj["config_sync"]), HierarchyController: expandGkeHubFeatureMembershipConfigmanagementHierarchyController(obj["hierarchy_controller"]), + Management: gkehub.FeatureMembershipConfigmanagementManagementEnumRef(obj["management"].(string)), PolicyController: expandGkeHubFeatureMembershipConfigmanagementPolicyController(obj["policy_controller"]), Version: dcl.StringOrNil(obj["version"].(string)), } @@ -998,6 +1012,7 @@ func flattenGkeHubFeatureMembershipConfigmanagement(obj *gkehub.FeatureMembershi "binauthz": flattenGkeHubFeatureMembershipConfigmanagementBinauthz(obj.Binauthz), "config_sync": flattenGkeHubFeatureMembershipConfigmanagementConfigSync(obj.ConfigSync), "hierarchy_controller": flattenGkeHubFeatureMembershipConfigmanagementHierarchyController(obj.HierarchyController), + "management": obj.Management, "policy_controller": flattenGkeHubFeatureMembershipConfigmanagementPolicyController(obj.PolicyController), "version": obj.Version, } @@ -1042,6 +1057,7 @@ func expandGkeHubFeatureMembershipConfigmanagementConfigSync(o interface{}) *gke } obj := objArr[0].(map[string]interface{}) return &gkehub.FeatureMembershipConfigmanagementConfigSync{ + Enabled: dcl.Bool(obj["enabled"].(bool)), Git: expandGkeHubFeatureMembershipConfigmanagementConfigSyncGit(obj["git"]), MetricsGcpServiceAccountEmail: dcl.String(obj["metrics_gcp_service_account_email"].(string)), Oci: expandGkeHubFeatureMembershipConfigmanagementConfigSyncOci(obj["oci"]), @@ -1055,6 +1071,7 @@ func flattenGkeHubFeatureMembershipConfigmanagementConfigSync(obj *gkehub.Featur return nil } transformed := map[string]interface{}{ + "enabled": obj.Enabled, "git": flattenGkeHubFeatureMembershipConfigmanagementConfigSyncGit(obj.Git), "metrics_gcp_service_account_email": obj.MetricsGcpServiceAccountEmail, "oci": flattenGkeHubFeatureMembershipConfigmanagementConfigSyncOci(obj.Oci), diff --git a/google/services/gkehub/resource_gke_hub_feature_membership_test.go b/google/services/gkehub/resource_gke_hub_feature_membership_test.go index 24081ed3521..ea3166f107d 100644 --- a/google/services/gkehub/resource_gke_hub_feature_membership_test.go +++ b/google/services/gkehub/resource_gke_hub_feature_membership_test.go @@ -160,11 +160,13 @@ resource "google_gke_hub_feature_membership" "feature_member_1" { version = "1.18.2" config_sync { source_format = "hierarchy" + enabled = true git { sync_repo = "https://github.com/GoogleCloudPlatform/magic-modules" secret_type = "none" } } + management = "MANAGEMENT_AUTOMATIC" } } diff --git a/website/docs/r/clouddeploy_target.html.markdown b/website/docs/r/clouddeploy_target.html.markdown index a424c180a4a..08e7482e5dc 100644 --- a/website/docs/r/clouddeploy_target.html.markdown +++ b/website/docs/r/clouddeploy_target.html.markdown @@ -250,6 +250,10 @@ The `gke` block supports: (Optional) Optional. If true, `cluster` is accessed using the private IP address of the control plane endpoint. Otherwise, the default IP address of the control plane endpoint is used. The default IP address is the private IP address for clusters with private control-plane endpoints and the public IP address otherwise. Only specify this option when `cluster` is a [private GKE cluster](https://cloud.google.com/kubernetes-engine/docs/concepts/private-cluster-concept). +* `proxy_url` - + (Optional) + Optional. If set, used to configure a [proxy](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#proxy) to the Kubernetes server. + The `multi_target` block supports: * `target_ids` -