From be9d2f62af27db36f2ed596ede324d0e304463c4 Mon Sep 17 00:00:00 2001 From: The Magician Date: Mon, 3 Apr 2023 15:18:41 -0700 Subject: [PATCH] Fix SQL instance sweeper to only delete sweepable instances (#7602) (#5418) Signed-off-by: Modular Magician --- .changelog/7602.txt | 3 +++ google-beta/resource_sql_database_instance_sweeper_test.go | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 .changelog/7602.txt diff --git a/.changelog/7602.txt b/.changelog/7602.txt new file mode 100644 index 0000000000..8ec013c069 --- /dev/null +++ b/.changelog/7602.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google-beta/resource_sql_database_instance_sweeper_test.go b/google-beta/resource_sql_database_instance_sweeper_test.go index 086e5dba2f..cd0d7ae520 100644 --- a/google-beta/resource_sql_database_instance_sweeper_test.go +++ b/google-beta/resource_sql_database_instance_sweeper_test.go @@ -53,6 +53,10 @@ func testSweepSQLDatabaseInstance(region string) error { } for _, d := range found.Items { + if !IsSweepableTestResource(d.Name) { + continue + } + // don't delete replicas, we'll take care of that // when deleting the database they replicate if d.ReplicaConfiguration != nil {