Problem with terraform and new Flex cluster

Hello, recently we have switched our staging cluster to Flex and now we have problem running our terraform

I have switched to Flex cluster in atlas and now I am trying to sync our terraform and having this error (note: updated terraform module to latest version 1.29.0)

GET https://cloud.mongodb.com/api/atlas/v1.0/groups/65fd51acbd9d871ed541d614/clusters/graet-staging: 400 (request “CANNOT_USE_FLEX_CLUSTER_IN_CLUSTER_API”) Flex cluster graet-staging cannot be used in the Cluster API

I found out this docs Terraform Registry which describes how to migrate terraform to advanced_cluster, but even after migration it gives same error. Updated terraform module of Mongo to latest version as well.

Hi there

What cluster type was staging before you converted to Flex? Please see this migration guide documentation and the flex cluster terraform resource if you haven’t already

It was M0 before.

After all it was in docs, we had to import via terraform import to be able to sync local state with updated Flex version.

Okay great, glad it was fixed. Please let us know if you have other questions.