@@ -55,14 +55,19 @@ var (
5555 "public_source_list" : acctest.Representation {RepType : acctest .Optional , Create : []string {`128.2.13.5` }, Update : []string {`128.2.13.5` , `128.2.13.6` }},
5656 "services" : acctest.Representation {RepType : acctest .Optional , Create : []string {`none` }, Update : []string {`all` }},
5757 "virtual_source_list" : acctest.RepresentationGroup {RepType : acctest .Optional , Group : IdentityNetworkVirtualSourceListRepresentation },
58+ "lifecycle" : acctest.RepresentationGroup {RepType : acctest .Required , Group : IdentityNetworkSourceIgnoreChangesRepresentation },
5859 }
5960
6061 IdentityNetworkVirtualSourceListRepresentation = map [string ]interface {}{
6162 "vcn_id" : acctest.Representation {RepType : acctest .Required , Create : `${oci_core_vcn.test_vcn.id}` },
6263 "ip_ranges" : acctest.Representation {RepType : acctest .Required , Create : []string {`10.0.0.0/16` }},
6364 }
6465
65- IdentityNetworkSourceResourceDependencies = DefinedTagsDependencies // + VcnRequiredOnlyResource
66+ IdentityNetworkSourceIgnoreChangesRepresentation = map [string ]interface {}{ // This may vary depending on the tenancy settings
67+ "ignore_changes" : acctest.Representation {RepType : acctest .Required , Create : []string {`defined_tags` , `freeform_tags` }},
68+ }
69+
70+ IdentityNetworkSourceResourceDependencies = DefinedTagsDependencies + acctest .GenerateResourceFromRepresentationMap ("oci_core_vcn" , "test_vcn" , acctest .Required , acctest .Create , CoreVcnRepresentation )
6671)
6772
6873// issue-routing-tag: identity/default
@@ -125,7 +130,7 @@ func TestIdentityNetworkSourceResource_basic(t *testing.T) {
125130 func (s * terraform.State ) (err error ) {
126131 resId , err = acctest .FromInstanceState (s , resourceName , "id" )
127132 if isEnableExportCompartment , _ := strconv .ParseBool (utils .GetEnvSettingWithDefault ("enable_export_compartment" , "true" )); isEnableExportCompartment {
128- if errExport := resourcediscovery .TestExportCompartmentWithResourceName (& resId , & compartmentId , resourceName ); errExport != nil {
133+ if errExport := resourcediscovery .TestExportCompartmentWithResourceName (& resId , & tenancyId , resourceName ); errExport != nil {
129134 return errExport
130135 }
131136 }
@@ -179,6 +184,7 @@ func TestIdentityNetworkSourceResource_basic(t *testing.T) {
179184 resource .TestCheckResourceAttr (datasourceName , "network_sources.0.public_source_list.#" , "2" ),
180185 resource .TestCheckResourceAttr (datasourceName , "network_sources.0.services.#" , "1" ),
181186 resource .TestCheckResourceAttrSet (datasourceName , "network_sources.0.time_created" ),
187+ resource .TestCheckResourceAttrSet (datasourceName , "network_sources.0.state" ),
182188 resource .TestCheckResourceAttr (datasourceName , "network_sources.0.virtual_source_list.#" , "1" ),
183189 ),
184190 },
0 commit comments