@@ -167,6 +167,57 @@ data "google_compute_network" "default" {
167
167
` , context )
168
168
}
169
169
170
+ func TestAccAlloydbInstance_alloydbInstancePscTestExample (t * testing.T ) {
171
+ t .Parallel ()
172
+
173
+ context := map [string ]interface {}{
174
+ "random_suffix" : acctest .RandString (t , 10 ),
175
+ }
176
+
177
+ acctest .VcrTest (t , resource.TestCase {
178
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
179
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
180
+ CheckDestroy : testAccCheckAlloydbInstanceDestroyProducer (t ),
181
+ Steps : []resource.TestStep {
182
+ {
183
+ Config : testAccAlloydbInstance_alloydbInstancePscTestExample (context ),
184
+ },
185
+ {
186
+ ResourceName : "google_alloydb_instance.default" ,
187
+ ImportState : true ,
188
+ ImportStateVerify : true ,
189
+ ImportStateVerifyIgnore : []string {"annotations" , "cluster" , "display_name" , "instance_id" , "labels" , "reconciling" , "terraform_labels" , "update_time" },
190
+ },
191
+ },
192
+ })
193
+ }
194
+
195
+ func testAccAlloydbInstance_alloydbInstancePscTestExample (context map [string ]interface {}) string {
196
+ return acctest .Nprintf (`
197
+ resource "google_alloydb_instance" "default" {
198
+ cluster = google_alloydb_cluster.default.name
199
+ instance_id = "tf-test-alloydb-instance%{random_suffix}"
200
+ instance_type = "PRIMARY"
201
+
202
+ machine_config {
203
+ cpu_count = 2
204
+ }
205
+ }
206
+
207
+ resource "google_alloydb_cluster" "default" {
208
+ cluster_id = "tf-test-alloydb-cluster%{random_suffix}"
209
+ location = "us-central1"
210
+
211
+ initial_user {
212
+ password = "tf-test-alloydb-cluster%{random_suffix}"
213
+ }
214
+ psc_config {
215
+ psc_enabled = true
216
+ }
217
+ }
218
+ ` , context )
219
+ }
220
+
170
221
func testAccCheckAlloydbInstanceDestroyProducer (t * testing.T ) func (s * terraform.State ) error {
171
222
return func (s * terraform.State ) error {
172
223
for name , rs := range s .RootModule ().Resources {
0 commit comments