@@ -164,7 +164,7 @@ func fillCluster(resourceb *hclwrite.Body) error {
164164 if err := fillTagsLabelsOpt (resourceb , nLabels ); err != nil {
165165 return err
166166 }
167- fillBlockOpt (resourceb , nAdvConf )
167+ fillAdvConfigOpt (resourceb , nAdvConf )
168168 fillBlockOpt (resourceb , nBiConnector )
169169 fillBlockOpt (resourceb , nPinnedFCV )
170170 fillBlockOpt (resourceb , nTimeouts )
@@ -303,6 +303,20 @@ func fillBlockOpt(resourceb *hclwrite.Body, name string) {
303303 resourceb .SetAttributeRaw (name , hcl .TokensObject (block .Body ()))
304304}
305305
306+ func fillAdvConfigOpt (resourceb * hclwrite.Body , name string ) {
307+ block := resourceb .FirstMatchingBlock (name , nil )
308+ if block == nil {
309+ return
310+ }
311+ blockBody := block .Body ()
312+
313+ // Remove deprecated attributes from advanced_configuration
314+ blockBody .RemoveAttribute (nFailIndexKeyTooLong )
315+ blockBody .RemoveAttribute (nDefaultReadConcern )
316+
317+ fillBlockOpt (resourceb , name )
318+ }
319+
306320// fillReplicationSpecsWithDynamicBlock used for dynamic blocks in replication_specs
307321func fillReplicationSpecsWithDynamicBlock (resourceb * hclwrite.Body , root attrVals ) (dynamicBlock , error ) {
308322 dSpec , err := getDynamicBlock (resourceb , nRepSpecs )
0 commit comments