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

To install or update the CLI, please run:

pip install -U montecarlodata

And then verify the installation using:

montecarlo --version

🚧

The CLI requires python version 3.7 or later.

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:

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

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:

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, 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.

Profile name obscured for securityProfile name obscured for security

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

Documentation

To get high-level help, please run:

montecarlo --help

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

montecarlo integrations --help

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

montecarlo integrations list

We are planning to release additional documentation and reference guides to illustrate the usage of the CLI and provide additional examples.


Did this page help you?