@@ -49,7 +49,7 @@ func TestAccDiscoveryEngineDataStore_discoveryengineDatastoreBasicExample(t *tes
49
49
ResourceName : "google_discovery_engine_data_store.basic" ,
50
50
ImportState : true ,
51
51
ImportStateVerify : true ,
52
- ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "location" , "skip_default_schema_creation" },
52
+ ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "kms_key_name" , " location" , "skip_default_schema_creation" },
53
53
},
54
54
},
55
55
})
@@ -70,6 +70,48 @@ resource "google_discovery_engine_data_store" "basic" {
70
70
` , context )
71
71
}
72
72
73
+ func TestAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample (t * testing.T ) {
74
+ t .Parallel ()
75
+
76
+ context := map [string ]interface {}{
77
+ "kms_key_name" : acctest .BootstrapKMSKeyInLocation (t , "us" ).CryptoKey .Name ,
78
+ "random_suffix" : acctest .RandString (t , 10 ),
79
+ }
80
+
81
+ acctest .VcrTest (t , resource.TestCase {
82
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
83
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
84
+ CheckDestroy : testAccCheckDiscoveryEngineDataStoreDestroyProducer (t ),
85
+ Steps : []resource.TestStep {
86
+ {
87
+ Config : testAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample (context ),
88
+ },
89
+ {
90
+ ResourceName : "google_discovery_engine_data_store.kms_key_name" ,
91
+ ImportState : true ,
92
+ ImportStateVerify : true ,
93
+ ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "kms_key_name" , "location" , "skip_default_schema_creation" },
94
+ },
95
+ },
96
+ })
97
+ }
98
+
99
+ func testAccDiscoveryEngineDataStore_discoveryengineDatastoreKmsKeyNameExample (context map [string ]interface {}) string {
100
+ return acctest .Nprintf (`
101
+ resource "google_discovery_engine_data_store" "kms_key_name" {
102
+ location = "us"
103
+ data_store_id = "tf-test-data-store-id%{random_suffix}"
104
+ display_name = "tf-test-structured-datastore"
105
+ industry_vertical = "GENERIC"
106
+ content_config = "NO_CONTENT"
107
+ solution_types = ["SOLUTION_TYPE_SEARCH"]
108
+ kms_key_name = "%{kms_key_name}"
109
+ create_advanced_site_search = false
110
+ skip_default_schema_creation = false
111
+ }
112
+ ` , context )
113
+ }
114
+
73
115
func TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingConfigExample (t * testing.T ) {
74
116
t .Parallel ()
75
117
@@ -89,7 +131,7 @@ func TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingC
89
131
ResourceName : "google_discovery_engine_data_store.document_processing_config" ,
90
132
ImportState : true ,
91
133
ImportStateVerify : true ,
92
- ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "location" , "skip_default_schema_creation" },
134
+ ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "kms_key_name" , " location" , "skip_default_schema_creation" },
93
135
},
94
136
},
95
137
})
@@ -139,7 +181,7 @@ func TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingC
139
181
ResourceName : "google_discovery_engine_data_store.document_processing_config_ocr" ,
140
182
ImportState : true ,
141
183
ImportStateVerify : true ,
142
- ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "location" , "skip_default_schema_creation" },
184
+ ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "kms_key_name" , " location" , "skip_default_schema_creation" },
143
185
},
144
186
},
145
187
})
@@ -185,7 +227,7 @@ func TestAccDiscoveryEngineDataStore_discoveryengineDatastoreDocumentProcessingC
185
227
ResourceName : "google_discovery_engine_data_store.document_processing_config_layout" ,
186
228
ImportState : true ,
187
229
ImportStateVerify : true ,
188
- ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "location" , "skip_default_schema_creation" },
230
+ ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "kms_key_name" , " location" , "skip_default_schema_creation" },
189
231
},
190
232
},
191
233
})
@@ -235,7 +277,7 @@ func TestAccDiscoveryEngineDataStore_discoveryengineDatastoreAdvancedSiteSearchC
235
277
ResourceName : "google_discovery_engine_data_store.advanced_site_search_config" ,
236
278
ImportState : true ,
237
279
ImportStateVerify : true ,
238
- ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "location" , "skip_default_schema_creation" },
280
+ ImportStateVerifyIgnore : []string {"create_advanced_site_search" , "data_store_id" , "kms_key_name" , " location" , "skip_default_schema_creation" },
239
281
},
240
282
},
241
283
})
0 commit comments