diff --git a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb index 083a6bbab869..6449be6249bd 100644 --- a/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/resources/resource_container_cluster.go.erb @@ -951,7 +951,6 @@ func resourceContainerCluster() *schema.Resource { <% end -%> }, }, -<% unless version == "ga" -%> "managed_prometheus": { Type: schema.TypeList, Optional: true, @@ -968,7 +967,6 @@ func resourceContainerCluster() *schema.Resource { }, }, }, -<% end -%> }, }, }, @@ -4327,14 +4325,12 @@ func expandMonitoringConfig(configured interface{}) *container.MonitoringConfig EnableComponents: convertStringArr(enable_components), } } -<% unless version == 'ga' -%> if v, ok := config["managed_prometheus"]; ok && len(v.([]interface{})) > 0 { managed_prometheus := v.([]interface{})[0].(map[string]interface{}) mc.ManagedPrometheusConfig = &container.ManagedPrometheusConfig{ Enabled: managed_prometheus["enabled"].(bool), } } -<% end -%> return mc } @@ -5046,15 +5042,12 @@ func flattenMonitoringConfig(c *container.MonitoringConfig) []map[string]interfa if c.ComponentConfig != nil { result["enable_components"] = c.ComponentConfig.EnableComponents } -<% unless version == 'ga' -%> if c.ManagedPrometheusConfig != nil { result["managed_prometheus"] = flattenManagedPrometheusConfig(c.ManagedPrometheusConfig) } -<% end -%> return []map[string]interface{}{result} } -<% unless version == 'ga' -%> func flattenManagedPrometheusConfig(c *container.ManagedPrometheusConfig) []map[string]interface{} { return []map[string]interface{}{ { @@ -5062,7 +5055,6 @@ func flattenManagedPrometheusConfig(c *container.ManagedPrometheusConfig) []map[ }, } } -<% end -%> <% unless version == 'ga' -%> func flattenNodePoolAutoConfig(c *container.NodePoolAutoConfig) []map[string]interface{} { diff --git a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb index 1ab9d0022edc..62b7031bd72d 100644 --- a/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_container_cluster_test.go.erb @@ -2474,7 +2474,7 @@ func TestAccContainerCluster_withMonitoringConfig(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"min_master_version"}, }, -<% if version == 'beta' -%> + <% if version == "beta" -%> { Config: testAccContainerCluster_withMonitoringConfigUpdated(clusterName), }, @@ -2484,6 +2484,7 @@ func TestAccContainerCluster_withMonitoringConfig(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"min_master_version"}, }, + <% end -%> { Config: testAccContainerCluster_withMonitoringConfigPrometheusUpdated(clusterName), }, @@ -2512,7 +2513,6 @@ func TestAccContainerCluster_withMonitoringConfig(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"min_master_version"}, }, -<% end -%> { Config: testAccContainerCluster_basic_1_23_8(clusterName), }, @@ -6648,7 +6648,7 @@ resource "google_container_cluster" "primary" { location = "us-central1-a" initial_node_count = 1 logging_config { - enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER", "WORKLOADS" ] + enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER"] } monitoring_config { enable_components = [ "SYSTEM_COMPONENTS" ] @@ -6695,7 +6695,7 @@ resource "google_container_cluster" "primary" { `, name) } -<% if version == 'beta' -%> +<% if version == "beta" -%> func testAccContainerCluster_withMonitoringConfigUpdated(name string) string { return fmt.Sprintf(` resource "google_container_cluster" "primary" { @@ -6709,6 +6709,7 @@ resource "google_container_cluster" "primary" { } `, name) } +<% end -%> func testAccContainerCluster_withMonitoringConfigPrometheusUpdated(name string) string { return fmt.Sprintf(` @@ -6718,7 +6719,7 @@ resource "google_container_cluster" "primary" { initial_node_count = 1 min_master_version = "1.23.8-gke.1900" monitoring_config { - enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER", "WORKLOADS" ] + enable_components = [ "SYSTEM_COMPONENTS", "APISERVER", "CONTROLLER_MANAGER", "SCHEDULER" ] managed_prometheus { enabled = true } @@ -6735,14 +6736,15 @@ resource "google_container_cluster" "primary" { initial_node_count = 1 min_master_version = "1.23.8-gke.1900" monitoring_config { + enable_components = [] managed_prometheus { - enabled = true + enabled = true } } } `, name) } -<% end -%> + func testAccContainerCluster_withSoleTenantGroup(name string) string { return fmt.Sprintf(` diff --git a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown index 826a739d36ce..3c027e63e0c8 100644 --- a/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown +++ b/mmv1/third_party/terraform/website/docs/r/container_cluster.html.markdown @@ -543,7 +543,7 @@ This block also contains several computed attributes, documented below. * `enable_components` - (Optional) The GKE components exposing metrics. Supported values include: `SYSTEM_COMPONENTS`, `APISERVER`, `CONTROLLER_MANAGER`, and `SCHEDULER`. In beta provider, `WORKLOADS` is supported on top of those 4 values. (`WORKLOADS` is deprecated and removed in GKE 1.24.) -* `managed_prometheus` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) Configuration for Managed Service for Prometheus. Structure is [documented below](#nested_managed_prometheus). +* `managed_prometheus` - (Optional) Configuration for Managed Service for Prometheus. Structure is [documented below](#nested_managed_prometheus). The `managed_prometheus` block supports: