From 7d949116fccad5dec222d6ea820d7cc27cfd8245 Mon Sep 17 00:00:00 2001 From: Ryan Oaks Date: Fri, 17 Mar 2023 12:44:53 -0400 Subject: [PATCH] Fix TestAccEventarcGoogleChannelConfig_cryptoKeyUpdate to properly clean up (#7479) --- ...ource_eventarc_google_channel_config_test.go.erb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mmv1/third_party/terraform/tests/resource_eventarc_google_channel_config_test.go.erb b/mmv1/third_party/terraform/tests/resource_eventarc_google_channel_config_test.go.erb index c8f8bf4dce17..a488265b838e 100644 --- a/mmv1/third_party/terraform/tests/resource_eventarc_google_channel_config_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_eventarc_google_channel_config_test.go.erb @@ -76,6 +76,9 @@ func TestAccEventarcGoogleChannelConfig_cryptoKeyUpdate(t *testing.T) { ImportState: true, ImportStateVerify: true, }, + { + Config: testAccEventarcGoogleChannelConfig_deleteCryptoKey(context), + }, }, }) } @@ -153,6 +156,16 @@ resource "google_eventarc_google_channel_config" "primary" { `, context) } +func testAccEventarcGoogleChannelConfig_deleteCryptoKey(context map[string]interface{}) string { + return Nprintf(` +resource "google_eventarc_google_channel_config" "primary" { + location = "%{region}" + name = "projects/%{project_name}/locations/%{region}/googleChannelConfig" + crypto_key_name = "" +} + `, context) +} + func testAccCheckEventarcGoogleChannelConfigDestroyProducer(t *testing.T) func(s *terraform.State) error { return func(s *terraform.State) error { for name, rs := range s.RootModule().Resources {