amazon-web-servicesterraform-provider-awsaws-documentdbaws-documentdb-mongoapi

How to create Amazon DocumentDB Elastic cluster via terraform


I want to create managed MongoDb using DocumentDb on AWS via terraform.

I created a DocumentDb Elastic cluster via the UI, and it seems to work fine. Now I want to create this cluster via terraform, and I don't find documentation for it.

I read that only the documentDb's 'Elastic Cluster' support MongoDb Sharding APIs (and not the 'Instance Based Cluster').

This is the Hashicorp doc for DocumentDb, but I don't see reference for Elastic cluster.


Solution

  • DocumentDB is relatively new. I think it's not possible to do it on terraform yet.

    You can do it using Cloudformation

    Using AWS CDK

    Or AWS CLI

    I think it will be available soon, if it is possible with other IaC Terraform don't take too long to update.