@@ -690,3 +690,75 @@ resource "google_workbench_instance" "instance" {
690
690
}
691
691
`, context)
692
692
}
693
+
694
+
695
+ func TestAccWorkbenchInstance_updateCustomContainers(t *testing.T) {
696
+ t.Parallel()
697
+
698
+ context := map[string]interface{}{
699
+ "random_suffix": acctest.RandString(t, 10),
700
+ }
701
+
702
+ acctest.VcrTest(t, resource.TestCase{
703
+ PreCheck: func() { acctest.AccTestPreCheck(t) },
704
+ ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
705
+ Steps: []resource.TestStep{
706
+ {
707
+ Config: testAccWorkbenchInstance_customcontainer(context),
708
+ Check: resource.ComposeTestCheckFunc(
709
+ resource.TestCheckResourceAttr(
710
+ "google_workbench_instance.instance", "state", "ACTIVE"),
711
+ ),
712
+ },
713
+ {
714
+ ResourceName: "google_workbench_instance.instance",
715
+ ImportState: true,
716
+ ImportStateVerify: true,
717
+ ImportStateVerifyIgnore: []string{"name", "instance_owners", "location", "instance_id", "request_id", "labels", "terraform_labels","desired_state"},
718
+ },
719
+ {
720
+ Config: testAccWorkbenchInstance_updatedcustomcontainer(context),
721
+ Check: resource.ComposeTestCheckFunc(
722
+ resource.TestCheckResourceAttr(
723
+ "google_workbench_instance.instance", "state", "ACTIVE"),
724
+ ),
725
+ },
726
+ {
727
+ ResourceName: "google_workbench_instance.instance",
728
+ ImportState: true,
729
+ ImportStateVerify: true,
730
+ ImportStateVerifyIgnore: []string{"name", "instance_owners", "location", "instance_id", "request_id", "labels", "terraform_labels","desired_state"},
731
+ },
732
+ },
733
+ })
734
+ }
735
+
736
+ func testAccWorkbenchInstance_customcontainer(context map[string]interface{}) string {
737
+ return acctest.Nprintf(`
738
+ resource "google_workbench_instance" "instance" {
739
+ name = "tf-test-workbench-instance%{random_suffix}"
740
+ location = "us-central1-a"
741
+ gce_setup {
742
+ container_image {
743
+ repository = "us-docker.pkg.dev/deeplearning-platform-release/gcr.io/base-cu113.py310"
744
+ tag = "latest"
745
+ }
746
+ }
747
+ }
748
+ `, context)
749
+ }
750
+
751
+ func testAccWorkbenchInstance_updatedcustomcontainer(context map[string]interface{}) string {
752
+ return acctest.Nprintf(`
753
+ resource "google_workbench_instance" "instance" {
754
+ name = "tf-test-workbench-instance%{random_suffix}"
755
+ location = "us-central1-a"
756
+ gce_setup {
757
+ container_image {
758
+ repository = "gcr.io/deeplearning-platform-release/workbench-container"
759
+ tag = "20241117-2200-rc0"
760
+ }
761
+ }
762
+ }
763
+ `, context)
764
+ }
0 commit comments