Skip to content

Commit

Permalink
Remove insightsPostgresOnlyCustomizeDiff function (#6006) (#4310)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored May 13, 2022
1 parent c1aaa35 commit cdf9d3d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
3 changes: 3 additions & 0 deletions .changelog/6006.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
sql: removed requirement that Cloud SQL Insight is only allowed for Postgres in `google_sql_database_instance`
```
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
8 changes: 4 additions & 4 deletions google-beta/resource_clouddeploy_target_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
10 changes: 0 additions & 10 deletions google-beta/resource_sql_database_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ func resourceSqlDatabaseInstance() *schema.Resource {
customdiff.ForceNewIfChange("settings.0.disk_size", isDiskShrinkage),
privateNetworkCustomizeDiff,
pitrPostgresOnlyCustomizeDiff,
insightsPostgresOnlyCustomizeDiff,
),

Schema: map[string]*schema.Schema{
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions website/docs/r/clouddeploy_delivery_pipeline.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit cdf9d3d

Please sign in to comment.