88//
99// This code is generated by Magic Modules using the following:
1010//
11- // Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/filestore/resource_filestore_instance_test.go.tmpl
11+ // Source file: https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services/filestore/resource_filestore_instance_test.go
1212//
1313// DO NOT EDIT this file directly. Any changes made to this file will be
1414// overwritten during the next generation cycle.
@@ -566,14 +566,41 @@ func TestAccFilestoreInstance_directoryServices(t *testing.T) {
566566
567567 acctest .VcrTest (t , resource.TestCase {
568568 PreCheck : func () { acctest .AccTestPreCheck (t ) },
569- ProtoV5ProviderFactories : acctest .ProtoV5ProviderBetaFactories (t ),
569+ ProtoV5ProviderFactories : acctest .ProtoV5ProviderFactories (t ),
570570 CheckDestroy : testAccCheckFilestoreInstanceDestroyProducer (t ),
571571 Steps : []resource.TestStep {
572572 {
573- Config : testAccFilestoreInstance_ldap (name , location , tier ),
573+ Config : testAccFilestoreInstance_ldap (name , location , tier , "example.com" ),
574+ Check : resource .ComposeTestCheckFunc (
575+ resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.domain" , "example.com" ),
576+ resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.servers.0" , "ldap.example.com" ),
577+ resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.users_ou" , "users" ),
578+ resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.groups_ou" , "groups" ),
579+ ),
580+ },
581+ {
582+ ResourceName : "google_filestore_instance.instance" ,
583+ ImportState : true ,
584+ ImportStateVerify : true ,
585+ ImportStateVerifyIgnore : []string {"zone" },
586+ },
587+ {
588+ Config : testAccFilestoreInstance_nfs_v4 (name , location , tier ),
589+ Check : resource .ComposeTestCheckFunc (
590+ resource .TestCheckNoResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.domain" ),
591+ ),
592+ },
593+ {
594+ ResourceName : "google_filestore_instance.instance" ,
595+ ImportState : true ,
596+ ImportStateVerify : true ,
597+ ImportStateVerifyIgnore : []string {"zone" },
598+ },
599+ {
600+ Config : testAccFilestoreInstance_ldap (name , location , tier , "example.com" ),
574601 Check : resource .ComposeTestCheckFunc (
575- resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.domain" , "my-domain .com" ),
576- resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.servers.0" , "ldap.example1 .com" ),
602+ resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.domain" , "example .com" ),
603+ resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.servers.0" , "ldap.example .com" ),
577604 resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.users_ou" , "users" ),
578605 resource .TestCheckResourceAttr ("google_filestore_instance.instance" , "directory_services.0.ldap.0.groups_ou" , "groups" ),
579606 ),
@@ -584,14 +611,39 @@ func TestAccFilestoreInstance_directoryServices(t *testing.T) {
584611 ImportStateVerify : true ,
585612 ImportStateVerifyIgnore : []string {"zone" },
586613 },
614+ {
615+ Config : testAccFilestoreInstance_ldap (name , location , tier , "other.com" ),
616+ ExpectError : regexp .MustCompile ("cannot update existing directory services configuration" ),
617+ },
587618 },
588619 })
589620}
590621
591- func testAccFilestoreInstance_ldap (name , location , tier string ) string {
622+ func testAccFilestoreInstance_nfs_v4 (name , location , tier string ) string {
623+ return fmt .Sprintf (`
624+ resource "google_filestore_instance" "instance" {
625+ name = "%s"
626+ location = "%s"
627+ tier = "%s"
628+ description = "An instance created during testing."
629+ protocol = "NFS_V4_1"
630+
631+ file_shares {
632+ capacity_gb = 1024
633+ name = "share"
634+ }
635+
636+ networks {
637+ network = "default"
638+ modes = ["MODE_IPV4"]
639+ }
640+ }
641+ ` , name , location , tier )
642+ }
643+
644+ func testAccFilestoreInstance_ldap (name , location , tier , domain string ) string {
592645 return fmt .Sprintf (`
593646resource "google_filestore_instance" "instance" {
594- provider = google-beta
595647 name = "%s"
596648 location = "%s"
597649 tier = "%s"
@@ -610,14 +662,14 @@ resource "google_filestore_instance" "instance" {
610662
611663 directory_services {
612664 ldap {
613- domain = "my-domain.com "
614- servers = ["ldap.example1 .com"]
665+ domain = "%s "
666+ servers = ["ldap.example .com"]
615667 users_ou = "users"
616668 groups_ou = "groups"
617669 }
618670 }
619671}
620- ` , name , location , tier )
672+ ` , name , location , tier , domain )
621673}
622674
623675func TestAccFilestoreInstance_psc (t * testing.T ) {
0 commit comments