Using the CLI

This guide explains basic usage of Monte Carlo's CLI. The CLI provides commands that will help you set up integrations programmatically.

Installing/Update the CLI

🚧

The CLI requires Python 3.7 or greater.

To install or update the CLI, please run:

pip install -U montecarlodata

And then verify the installation using:

montecarlo --version
325325

Setting up the CLI

To configure your CLI with your API key and other settings, please run:

montecarlo configure

You will then be prompted to add your Monte Carlo API key/secret information. You can generate that by going to the "Settings" tab, and then "API". Click on the "CREATE KEY" button:

17881788

You will then name your key and have the option to expire your key at varying intervals:

17851785

Choose the option you are comfortable with, and then click "CREATE".

❗️

Careful!

You are only able to see the Secret once! Save that in a safe place.

Input these details into your terminal:

335335

📘

AWS Profile

The AWS profile and region are only necessary if you host your own Data Collector. If Monte Carlo hosts your data collector, you can skip these entries.

If you do host your own data collector, you will need to run commands through a network that has access to the account the collector is in. Commands like adding a new integration will route from your local network to the network hosting the data collector; it does not run through Monte Carlo's environment.

Next, you are prompted to give your AWS details. It is technically optional to include the AWS settings when setting up the CLI. It is strongly recommended if you are hosting your own Data Collector, but only necessary if you need to do things like make an update to the collector. Any AWS profiles or regions should be for the account the Data Collector is deployed to.

410410

Profile name obscured for security

The AWS profile can follow the pattern of accountid_permission. For example, 12345678_AdministratorAccess. See here for more details: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

The region will look like us-east-1. If you leave this blank, we will default to us-east-1.

And then verify the configuration using:

montecarlo validate
318318

Documentation

To get high-level help, please run:

montecarlo --help

Similarly, you can get help for a specific set of commands:

montecarlo integrations --help

To retrieve documentation (help text) on all commands, subcommands and options:

montecarlo help

As an example, this is how you would list all active integrations:

montecarlo integrations list

Did this page help you?