It looks like there is a race condition when creating a container and a cluster, as the cluster will create a "default" container which prevents you from creating your own container.
I am using the "basic" example along with the "peering" example in the same Terraform stack as well as some AWS resources to accept + configure the peering.
Adding a depends_on = ["mongodbatlas_container.main"] to the cluster fixes the issue.
It looks like there is a race condition when creating a container and a cluster, as the cluster will create a "default" container which prevents you from creating your own container.
I am using the "basic" example along with the "peering" example in the same Terraform stack as well as some AWS resources to accept + configure the peering.
Adding a
depends_on = ["mongodbatlas_container.main"]
to the cluster fixes the issue.