@@ -626,3 +626,69 @@ resource "google_workbench_instance" "instance" {
626
626
}
627
627
` , context )
628
628
}
629
+
630
+ func TestAccWorkbenchInstance_updatelabels (t * testing.T ) {
631
+ t .Parallel ()
632
+
633
+ context := map [string ]interface {}{
634
+ "random_suffix" : acctest .RandString (t , 10 ),
635
+ }
636
+
637
+ acctest .VcrTest (t , resource.TestCase {
638
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
639
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
640
+ Steps : []resource.TestStep {
641
+ {
642
+ Config : testAccWorkbenchInstance_label (context ),
643
+ Check : resource .ComposeTestCheckFunc (
644
+ resource .TestCheckResourceAttr (
645
+ "google_workbench_instance.instance" , "state" , "ACTIVE" ),
646
+ ),
647
+ },
648
+ {
649
+ ResourceName : "google_workbench_instance.instance" ,
650
+ ImportState : true ,
651
+ ImportStateVerify : true ,
652
+ ImportStateVerifyIgnore : []string {"name" , "instance_owners" , "location" , "instance_id" , "request_id" , "labels" , "terraform_labels" , "desired_state" },
653
+ },
654
+ {
655
+ Config : testAccWorkbenchInstance_basic (context ),
656
+ Check : resource .ComposeTestCheckFunc (
657
+ resource .TestCheckResourceAttr (
658
+ "google_workbench_instance.instance" , "state" , "ACTIVE" ),
659
+ ),
660
+ },
661
+ {
662
+ ResourceName : "google_workbench_instance.instance" ,
663
+ ImportState : true ,
664
+ ImportStateVerify : true ,
665
+ ImportStateVerifyIgnore : []string {"name" , "instance_owners" , "location" , "instance_id" , "request_id" , "labels" , "terraform_labels" , "desired_state" },
666
+ },
667
+ {
668
+ Config : testAccWorkbenchInstance_label (context ),
669
+ Check : resource .ComposeTestCheckFunc (
670
+ resource .TestCheckResourceAttr (
671
+ "google_workbench_instance.instance" , "state" , "ACTIVE" ),
672
+ ),
673
+ },
674
+ {
675
+ ResourceName : "google_workbench_instance.instance" ,
676
+ ImportState : true ,
677
+ ImportStateVerify : true ,
678
+ ImportStateVerifyIgnore : []string {"name" , "instance_owners" , "location" , "instance_id" , "request_id" , "labels" , "terraform_labels" , "desired_state" },
679
+ },
680
+ },
681
+ })
682
+ }
683
+
684
+ func testAccWorkbenchInstance_label (context map [string ]interface {}) string {
685
+ return acctest .Nprintf (`
686
+ resource "google_workbench_instance" "instance" {
687
+ name = "tf-test-workbench-instance%{random_suffix}"
688
+ location = "us-central1-a"
689
+ labels = {
690
+ k = "val"
691
+ }
692
+ }
693
+ ` , context )
694
+ }
0 commit comments