Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories Atlas
Created by Guest
Created on Mar 31, 2020

Adding indexes using terraform

Ability to add indexes after new clusters are created using Terraform and data has been loaded. It will help in more automation and auto recovery.
  • Ai Infra
    Jan 22, 2026

    Thank you, Anuj, We are actively using this custom Terraform provider in our production CI/CD workflows. It automated index management, cut operational effort by approximately 60%, and has proven very helpful in reducing manual intervention and human error.

  • Anuradha Sharma
    Jan 22, 2026

    Thank you, Anuj, for developing and sharing this custom Terraform provider. Prior to its adoption, managing database indexes within our Terraform-based CI/CD workflows required extensive manual intervention and custom scripting, introducing operational complexity and risk. Following successful validation in staging, we deployed the provider in production, where it has fundamentally improved our database operations. The solution has automated index management at scale, significantly reduced operational effort, and mitigated human error across our production environments.

  • Anuj Tyagi
    Jan 22, 2026

    Hello, You can try custom provider https://registry.terraform.io/providers/megum1n/mongodb to create Indexes.

  • Guest
    Jan 24, 2024
    Seems like this is dependent on the missing delete / edit index endpoints in the Administration API as Melissa said. Voting here too would help bring it to attention: https://feedback.mongodb.com/forums/924145-atlas/suggestions/40128403-ability-to-drop-indexes-via-api
  • Guest
    Apr 4, 2023
    This would be nice to have for us as well. It is not necessarily great practice to separate the creation of indexes as part of the CICD process rather than having it incorporated in the terraform itself.
  • Guest
    Dec 15, 2022
    The lack of this feature is what prevents us from recommending that we migrate any more workloads to Atlas. Infrastructure as code is a best practice and the lack of support is a deal-breaker.
  • Guest
    Sep 22, 2022
    Stefan, there is still no underlying endpoints in the Atlas Admin API that allow full control of the index lifecycle so we have no plans at this time to add index management to Terraform (there is one to allow only creation of an index in a rolling fashion but we would be unable to update or delete that index via the admin API). Indexes can be created via scripts or the shell as part of your CI/CD process. If this changes we will update the status of this feedback. Thank you, Melissa
  • Guest
    Sep 21, 2022
    Hi, is there any news on this? I guess it would be good to have it as infrastructure as code, due to best practices for index management!