@@ -229,7 +229,6 @@ resource "google_netapp_storage_pool" "default" {
229
229
capacity_gib = "2048"
230
230
network = data.google_compute_network.default.id
231
231
}
232
-
233
232
resource "google_netapp_storage_pool" "default2" {
234
233
name = "tf-test-pool%{random_suffix}"
235
234
location = "us-west2"
@@ -659,3 +658,97 @@ func testAccNetappVolume_volumeBasicExample_cleanupScheduledBackup(t *testing.T,
659
658
return nil
660
659
}
661
660
}
661
+
662
+ func TestAccNetappVolume_autoTieredNetappVolume_update (t * testing.T ) {
663
+ context := map [string ]interface {}{
664
+ "network_name" : acctest .BootstrapSharedServiceNetworkingConnection (t , "gcnv-network-config-1" , acctest .ServiceNetworkWithParentService ("netapp.servicenetworking.goog" )),
665
+ "random_suffix" : acctest .RandString (t , 10 ),
666
+ }
667
+
668
+ acctest .VcrTest (t , resource.TestCase {
669
+ PreCheck : func () { acctest .AccTestPreCheck (t ) },
670
+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
671
+ CheckDestroy : testAccCheckNetappVolumeDestroyProducer (t ),
672
+ ExternalProviders : map [string ]resource.ExternalProvider {
673
+ "time" : {},
674
+ },
675
+ Steps : []resource.TestStep {
676
+ {
677
+ Config : testAccNetappVolume_autoTieredVolume_default (context ),
678
+ },
679
+ {
680
+ ResourceName : "google_netapp_volume.test_volume" ,
681
+ ImportState : true ,
682
+ ImportStateVerify : true ,
683
+ ImportStateVerifyIgnore : []string {"restore_parameters" , "location" , "name" , "deletion_policy" , "labels" , "terraform_labels" },
684
+ },
685
+ {
686
+ Config : testAccNetappVolume_autoTieredVolume_custom (context ),
687
+ },
688
+ {
689
+ ResourceName : "google_netapp_volume.test_volume" ,
690
+ ImportState : true ,
691
+ ImportStateVerify : true ,
692
+ ImportStateVerifyIgnore : []string {"restore_parameters" , "location" , "name" , "deletion_policy" , "labels" , "terraform_labels" },
693
+ },
694
+ },
695
+ })
696
+ }
697
+
698
+ func testAccNetappVolume_autoTieredVolume_default (context map [string ]interface {}) string {
699
+ return acctest .Nprintf (`
700
+ resource "google_netapp_storage_pool" "default" {
701
+ name = "tf-test-pool%{random_suffix}"
702
+ location = "us-west2"
703
+ service_level = "PREMIUM"
704
+ capacity_gib = "2048"
705
+ network = data.google_compute_network.default.id
706
+ allow_auto_tiering = true
707
+ }
708
+ resource "google_netapp_volume" "test_volume" {
709
+ location = "us-west2"
710
+ name = "tf-test-volume%{random_suffix}"
711
+ capacity_gib = "100"
712
+ share_name = "tf-test-volume%{random_suffix}"
713
+ storage_pool = google_netapp_storage_pool.default.name
714
+ protocols = ["NFSV3"]
715
+ tiering_policy {
716
+ cooling_threshold_days = 31
717
+ tier_action = "ENABLED"
718
+ }
719
+ }
720
+ data "google_compute_network" "default" {
721
+ name = "%{network_name}"
722
+ }
723
+ ` , context )
724
+ }
725
+
726
+ func testAccNetappVolume_autoTieredVolume_custom (context map [string ]interface {}) string {
727
+ return acctest .Nprintf (`
728
+ resource "google_netapp_storage_pool" "default" {
729
+ name = "tf-test-pool%{random_suffix}"
730
+ location = "us-west2"
731
+ service_level = "PREMIUM"
732
+ capacity_gib = "2048"
733
+ network = data.google_compute_network.default.id
734
+ allow_auto_tiering = true
735
+ }
736
+
737
+ resource "google_netapp_volume" "test_volume" {
738
+ location = "us-west2"
739
+ name = "tf-test-volume%{random_suffix}"
740
+ capacity_gib = "100"
741
+ share_name = "tf-test-volume%{random_suffix}"
742
+ storage_pool = google_netapp_storage_pool.default.name
743
+ protocols = ["NFSV3"]
744
+ tiering_policy {
745
+ cooling_threshold_days = 20
746
+ tier_action = "ENABLED"
747
+ }
748
+ }
749
+
750
+ data "google_compute_network" "default" {
751
+ name = "%{network_name}"
752
+ }
753
+ ` , context )
754
+ }
0 commit comments