@@ -154,6 +154,11 @@ Format: 'projects/{{projectId}}/locations/{{location}}/backupVaults/{{backupVaul
154154 Optional : true ,
155155 Description : `Defines the client ingress specification (allowed clients) as a comma separated list with IPv4 CIDRs or IPv4 host addresses.` ,
156156 },
157+ "anon_uid" : {
158+ Type : schema .TypeInt ,
159+ Optional : true ,
160+ Description : `An integer representing the anonymous user ID. Range is 0 to 4294967295. Required when 'squash_mode' is 'ROOT_SQUASH' or 'ALL_SQUASH'.` ,
161+ },
157162 "has_root_access" : {
158163 Type : schema .TypeString ,
159164 Optional : true ,
@@ -199,6 +204,12 @@ Format: 'projects/{{projectId}}/locations/{{location}}/backupVaults/{{backupVaul
199204 Optional : true ,
200205 Description : `Enable to apply the export rule to NFSV4.1 clients.` ,
201206 },
207+ "squash_mode" : {
208+ Type : schema .TypeString ,
209+ Optional : true ,
210+ ValidateFunc : verify .ValidateEnum ([]string {"NO_ROOT_SQUASH" , "ROOT_SQUASH" , "ALL_SQUASH" , "" }),
211+ Description : `SquashMode defines how remote user privileges are restricted when accessing an NFS export. It controls how the user identities (like root) are mapped to anonymous users to limit access and enforce security. Possible values: ["NO_ROOT_SQUASH", "ROOT_SQUASH", "ALL_SQUASH"]` ,
212+ },
202213 },
203214 },
204215 },
@@ -1399,6 +1410,8 @@ func flattenNetappVolumeExportPolicyRules(v interface{}, d *schema.ResourceData,
13991410 "kerberos5i_read_write" : flattenNetappVolumeExportPolicyRulesKerberos5iReadWrite (original ["kerberos5iReadWrite" ], d , config ),
14001411 "kerberos5p_read_only" : flattenNetappVolumeExportPolicyRulesKerberos5pReadOnly (original ["kerberos5pReadOnly" ], d , config ),
14011412 "kerberos5p_read_write" : flattenNetappVolumeExportPolicyRulesKerberos5pReadWrite (original ["kerberos5pReadWrite" ], d , config ),
1413+ "squash_mode" : flattenNetappVolumeExportPolicyRulesSquashMode (original ["squashMode" ], d , config ),
1414+ "anon_uid" : flattenNetappVolumeExportPolicyRulesAnonUid (original ["anonUid" ], d , config ),
14021415 })
14031416 }
14041417 return transformed
@@ -1447,6 +1460,27 @@ func flattenNetappVolumeExportPolicyRulesKerberos5pReadWrite(v interface{}, d *s
14471460 return v
14481461}
14491462
1463+ func flattenNetappVolumeExportPolicyRulesSquashMode (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1464+ return v
1465+ }
1466+
1467+ func flattenNetappVolumeExportPolicyRulesAnonUid (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1468+ // Handles the string fixed64 format
1469+ if strVal , ok := v .(string ); ok {
1470+ if intVal , err := tpgresource .StringToFixed64 (strVal ); err == nil {
1471+ return intVal
1472+ }
1473+ }
1474+
1475+ // number values are represented as float64
1476+ if floatVal , ok := v .(float64 ); ok {
1477+ intVal := int (floatVal )
1478+ return intVal
1479+ }
1480+
1481+ return v // let terraform core handle it otherwise
1482+ }
1483+
14501484func flattenNetappVolumeProtocols (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
14511485 return v
14521486}
@@ -2136,6 +2170,20 @@ func expandNetappVolumeExportPolicyRules(v interface{}, d tpgresource.TerraformR
21362170 transformed ["kerberos5pReadWrite" ] = transformedKerberos5pReadWrite
21372171 }
21382172
2173+ transformedSquashMode , err := expandNetappVolumeExportPolicyRulesSquashMode (original ["squash_mode" ], d , config )
2174+ if err != nil {
2175+ return nil , err
2176+ } else if val := reflect .ValueOf (transformedSquashMode ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2177+ transformed ["squashMode" ] = transformedSquashMode
2178+ }
2179+
2180+ transformedAnonUid , err := expandNetappVolumeExportPolicyRulesAnonUid (original ["anon_uid" ], d , config )
2181+ if err != nil {
2182+ return nil , err
2183+ } else if val := reflect .ValueOf (transformedAnonUid ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
2184+ transformed ["anonUid" ] = transformedAnonUid
2185+ }
2186+
21392187 req = append (req , transformed )
21402188 }
21412189 return req , nil
@@ -2185,6 +2233,14 @@ func expandNetappVolumeExportPolicyRulesKerberos5pReadWrite(v interface{}, d tpg
21852233 return v , nil
21862234}
21872235
2236+ func expandNetappVolumeExportPolicyRulesSquashMode (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2237+ return v , nil
2238+ }
2239+
2240+ func expandNetappVolumeExportPolicyRulesAnonUid (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
2241+ return v , nil
2242+ }
2243+
21882244func expandNetappVolumeProtocols (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
21892245 return v , nil
21902246}
0 commit comments