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