@@ -279,7 +279,8 @@ func TestAccCGCSnippet_sqlSqlserverInstanceAuthorizedNetworkExample(t *testing.T
279279 t .Parallel ()
280280
281281 context := map [string ]interface {}{
282- "random_suffix" : randString (t , 10 ),
282+ "deletion_protection" : false ,
283+ "random_suffix" : randString (t , 10 ),
283284 }
284285
285286 vcrTest (t , resource.TestCase {
@@ -321,6 +322,52 @@ resource "google_sql_database_instance" "default" {
321322` , context )
322323}
323324
325+ func TestAccCGCSnippet_sqlPostgresInstanceAuthorizedNetworkExample (t * testing.T ) {
326+ t .Parallel ()
327+
328+ context := map [string ]interface {}{
329+ "deletion_protection" : false ,
330+ "random_suffix" : randString (t , 10 ),
331+ }
332+
333+ vcrTest (t , resource.TestCase {
334+ PreCheck : func () { testAccPreCheck (t ) },
335+ Providers : testAccProviders ,
336+ Steps : []resource.TestStep {
337+ {
338+ Config : testAccCGCSnippet_sqlPostgresInstanceAuthorizedNetworkExample (context ),
339+ },
340+ {
341+ ResourceName : "google_sql_database_instance.default" ,
342+ ImportState : true ,
343+ ImportStateVerify : true ,
344+ ImportStateVerifyIgnore : []string {"deletion_protection" },
345+ },
346+ },
347+ })
348+ }
349+
350+ func testAccCGCSnippet_sqlPostgresInstanceAuthorizedNetworkExample (context map [string ]interface {}) string {
351+ return Nprintf (`
352+ resource "google_sql_database_instance" "default" {
353+ name = "tf-test-postgres-instance-with-authorized-network%{random_suffix}"
354+ region = "us-central1"
355+ database_version = "POSTGRES_12"
356+ settings {
357+ tier = "db-custom-2-7680"
358+ ip_configuration {
359+ authorized_networks {
360+ name = "Network Name"
361+ value = "192.0.2.0/24"
362+ expiration_time = "3021-11-15T16:19:00.094Z"
363+ }
364+ }
365+ }
366+ deletion_protection = "%{deletion_protection}"
367+ }
368+ ` , context )
369+ }
370+
324371func TestAccCGCSnippet_storageNewBucketExample (t * testing.T ) {
325372 t .Parallel ()
326373
0 commit comments