Skip to content

fix: mongodb network container being created before the cluster

Keith Grootboom requested to merge keith/fix_mongo_cluster_creation into main

Description

Fixes a race condition where the MongoDB peering container gets created before the cluster. Without it, it's possible to get the following error:


│ Error: error creating MongoDB Network Peering Container: POST https://cloud.mongodb.com/api/atlas/v1.0/groups/6257e08969938f604854744f/containers: 409 (request "CONTAINER_ALREADY_EXISTS") A container already exists for group 6257e08969938f604854744f.

│   with module.mongodb.mongodbatlas_network_container.cluster_network_container,
│   on mongodb/cluster.tf line 64, in resource "mongodbatlas_network_container" "cluster_network_container":
│   64: resource "mongodbatlas_network_container" "cluster_network_container" {

Supporting information

Merge request reports