How to install and use the Data Federation CLI

Hello,

We are trying to implement a data as a service component based on MongoDB Atlas Data Federation. One of the considerations for the same is ability to automate the creation of the federated store and databases/collections within it. The documentation here Manage a Federated Database Instance — MongoDB Atlas talks about a Data Federation CLI that seems to fit our requirements. But we are not sure of how/where to get the CLI installed from. If anyone has used the same please help.

Thanks,
Vinod

Hi @Vinod_Nair1 - Welcome to the community :wave:

Thanks for raising this! I believe this might be a typo but I am just double checking with the team. The commands on the page are related to the db.runCommand() command. You can use a MongoDB driver(s) or mongosh shell to run those commands.

I’m not sure if this suits your use case but there is the following that you could possibly use to automate the creation of federated instances:

Let me know if this works for you or not.

Regards,
Jason

Hi @Vinod_Nair1 - Just confirming this was a typo so thank you for raising it. A fix for the typo should be up soon.

In the mean time, please check out the atlas cli 1.9.0 release notes which mention:

Adds the following new commands to manage data federation:

Regards,
Jason

Hey @Vinod_Nair1

Quickly following up here, in order to do what you’re saying you will need to “set the storage” config. I don’t believe this is currently available in the CLI.

If you look at the API Reference here which undergirds the CLI, you will see that you need to set a “storage” object in the request to set the storage configuration as part of the request. MongoDB Atlas Administration API

The programmatic experience for Data Federation is somewhat evolving, but all of this is currently supported in the Terraform experience here: Terraform Registry

Feel free to reach out to me if I can help further at benjamin.flast@mongodb.com

Best,
Ben

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.