From cdf9d3d65c70a70f1f31c26b8d262547cbe5989e Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 13 May 2022 10:33:41 -0700 Subject: [PATCH] Remove insightsPostgresOnlyCustomizeDiff function (#6006) (#4310) Signed-off-by: Modular Magician --- .changelog/6006.txt | 3 +++ ...rce_clouddeploy_delivery_pipeline_generated_test.go | 8 ++++---- .../resource_clouddeploy_target_generated_test.go | 8 ++++---- google-beta/resource_sql_database_instance.go | 10 ---------- .../docs/r/clouddeploy_delivery_pipeline.html.markdown | 8 ++++---- 5 files changed, 15 insertions(+), 22 deletions(-) create mode 100644 .changelog/6006.txt diff --git a/.changelog/6006.txt b/.changelog/6006.txt new file mode 100644 index 0000000000..2468a796ed --- /dev/null +++ b/.changelog/6006.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +sql: removed requirement that Cloud SQL Insight is only allowed for Postgres in `google_sql_database_instance` +``` diff --git a/google-beta/resource_clouddeploy_delivery_pipeline_generated_test.go b/google-beta/resource_clouddeploy_delivery_pipeline_generated_test.go index 2d71fb5a79..ed057ab5fa 100644 --- a/google-beta/resource_clouddeploy_delivery_pipeline_generated_test.go +++ b/google-beta/resource_clouddeploy_delivery_pipeline_generated_test.go @@ -67,17 +67,17 @@ resource "google_clouddeploy_delivery_pipeline" "primary" { name = "tf-test-pipeline%{random_suffix}" annotations = { - my_first_annotation = "example-annotation-1" - my_second_annotation = "example-annotation-2" + + my_first_annotation = "example-annotation-1" } description = "basic description" labels = { - my_first_label = "example-label-1" - my_second_label = "example-label-2" + + my_first_label = "example-label-1" } project = "%{project_name}" diff --git a/google-beta/resource_clouddeploy_target_generated_test.go b/google-beta/resource_clouddeploy_target_generated_test.go index 1c73f6ad97..dc567a2229 100644 --- a/google-beta/resource_clouddeploy_target_generated_test.go +++ b/google-beta/resource_clouddeploy_target_generated_test.go @@ -156,9 +156,9 @@ resource "google_clouddeploy_target" "primary" { name = "tf-test-target%{random_suffix}" annotations = { - my_second_annotation = "updated-example-annotation-2" - my_third_annotation = "example-annotation-3" + + my_second_annotation = "updated-example-annotation-2" } description = "updated description" @@ -241,9 +241,9 @@ resource "google_clouddeploy_target" "primary" { name = "tf-test-target%{random_suffix}" annotations = { - my_third_annotation = "example-annotation-3" - my_second_annotation = "updated-example-annotation-2" + + my_third_annotation = "example-annotation-3" } description = "updated description" diff --git a/google-beta/resource_sql_database_instance.go b/google-beta/resource_sql_database_instance.go index 873419f4bb..2be5c9ccff 100644 --- a/google-beta/resource_sql_database_instance.go +++ b/google-beta/resource_sql_database_instance.go @@ -113,7 +113,6 @@ func resourceSqlDatabaseInstance() *schema.Resource { customdiff.ForceNewIfChange("settings.0.disk_size", isDiskShrinkage), privateNetworkCustomizeDiff, pitrPostgresOnlyCustomizeDiff, - insightsPostgresOnlyCustomizeDiff, ), Schema: map[string]*schema.Schema{ @@ -756,15 +755,6 @@ func pitrPostgresOnlyCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, return nil } -func insightsPostgresOnlyCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, v interface{}) error { - insights := diff.Get("settings.0.insights_config.0.query_insights_enabled").(bool) - dbVersion := diff.Get("database_version").(string) - if insights && !strings.Contains(dbVersion, "POSTGRES") { - return fmt.Errorf("query_insights_enabled is only available for Postgres now.") - } - return nil -} - func resourceSqlDatabaseInstanceCreate(d *schema.ResourceData, meta interface{}) error { config := meta.(*Config) userAgent, err := generateUserAgentString(d, config.userAgent) diff --git a/website/docs/r/clouddeploy_delivery_pipeline.html.markdown b/website/docs/r/clouddeploy_delivery_pipeline.html.markdown index fa7927f84f..3fd12af933 100644 --- a/website/docs/r/clouddeploy_delivery_pipeline.html.markdown +++ b/website/docs/r/clouddeploy_delivery_pipeline.html.markdown @@ -33,17 +33,17 @@ resource "google_clouddeploy_delivery_pipeline" "primary" { name = "pipeline" annotations = { - my_first_annotation = "example-annotation-1" - my_second_annotation = "example-annotation-2" + + my_first_annotation = "example-annotation-1" } description = "basic description" labels = { - my_first_label = "example-label-1" - my_second_label = "example-label-2" + + my_first_label = "example-label-1" } project = "my-project-name"