@@ -365,6 +365,53 @@ resource "google_sql_database_instance" "default" {
365
365
` , context )
366
366
}
367
367
368
+ func TestAccCGCSnippet_sqlSqlserverInstanceBackupRetentionExample (t * testing.T ) {
369
+ t .Parallel ()
370
+
371
+ context := map [string ]interface {}{
372
+ "deletion_protection" : false ,
373
+ "random_suffix" : randString (t , 10 ),
374
+ }
375
+
376
+ vcrTest (t , resource.TestCase {
377
+ PreCheck : func () { testAccPreCheck (t ) },
378
+ Providers : testAccProviders ,
379
+ Steps : []resource.TestStep {
380
+ {
381
+ Config : testAccCGCSnippet_sqlSqlserverInstanceBackupRetentionExample (context ),
382
+ },
383
+ {
384
+ ResourceName : "google_sql_database_instance.default" ,
385
+ ImportState : true ,
386
+ ImportStateVerify : true ,
387
+ ImportStateVerifyIgnore : []string {"root_password" , "deletion_protection" },
388
+ },
389
+ },
390
+ })
391
+ }
392
+
393
+ func testAccCGCSnippet_sqlSqlserverInstanceBackupRetentionExample (context map [string ]interface {}) string {
394
+ return Nprintf (`
395
+ resource "google_sql_database_instance" "default" {
396
+ name = "tf-test-sqlserver-instance-backup-retention%{random_suffix}"
397
+ region = "us-central1"
398
+ database_version = "SQLSERVER_2017_STANDARD"
399
+ root_password = "INSERT-PASSWORD-HERE"
400
+ settings {
401
+ tier = "db-custom-2-7680"
402
+ backup_configuration {
403
+ enabled = true
404
+ backup_retention_settings {
405
+ retained_backups = 365
406
+ retention_unit = "COUNT"
407
+ }
408
+ }
409
+ }
410
+ deletion_protection = "%{deletion_protection}"
411
+ }
412
+ ` , context )
413
+ }
414
+
368
415
func TestAccCGCSnippet_storageNewBucketExample (t * testing.T ) {
369
416
t .Parallel ()
370
417
0 commit comments