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