---
updatedAt: 2025-12-11T20:18:10.000Z
agentTools:
  projectIndex: https://docs.getmontecarlo.com/llms.txt
---

# Using self-hosted credentials

<Callout icon="❗️">
  This feature is deprecated for both cloud and customer-hosted data store deployments and is no longer supported for new usage.  

  Instead, please refer to the [self-hosted credentials documentation](https://docs.getmontecarlo.com/docs/self-hosted-credentials) to learn how to use customer-managed (self-hosted) credentials with the agent.
</Callout>

Monte Carlo provides the option to store integration credentials in your AWS account using [Secrets Manager](https://aws.amazon.com/secrets-manager/).

To configure, follow these steps -

1. Create a read-only service account or role for the integration.
2. [Create a secret](https://docs.getmontecarlo.com/docs/using-self-hosted-credentials#step-1-create-a-secret-in-your-aws-account) in your AWS account.
3. [Create a role](https://docs.getmontecarlo.com/docs/using-self-hosted-credentials#step-2-create-a-role-that-allows-secret-access) that allows secret access for Monte Carlo's  collection service.
4. [Set up the integration](https://docs.getmontecarlo.com/docs/using-self-hosted-credentials#step-3-set-up-the-integration) using your self-hosted credentials.

If your integration is already connected to MC, please refer to the [FAQs](https://docs.getmontecarlo.com/docs/using-self-hosted-credentials#faqs) for instructions on migrating the connection to use self-hosted credentials. You do not need to recreate the integration.

# Steps

## Step 1: Create a secret in your AWS account

You will create a secret containing the credentials for the integration's service account or role.

1. Select and fill in the credentials schema associated with the resource you wish to integrate with.

```json Athena
{
	"catalog": {
		"type": "string",
		"required": false
	},
	"assumable_role": {
		"type": "string",
		"required": false
	},
	"external_id": {
		"type": "string",
		"required": false
	},
	"workgroup": {
		"type": "string",
		"required": false
	},
	"aws_region": {
		"type": "string",
		"required": false
	}
}
```
```json BigQuery
{
	"type": {
		"type": "string",
		"required": true
	},
	"project_id": {
		"type": "string",
		"required": true
	},
	"private_key_id": {
		"type": "string",
		"required": true
	},
	"private_key": {
		"type": "string",
		"required": true
	},
	"client_email": {
		"type": "string",
		"required": true
	},
	"client_id": {
		"type": "string",
		"required": true
	},
	"auth_uri": {
		"type": "string",
		"required": true
	},
	"token_uri": {
		"type": "string",
		"required": true
	},
	"auth_provider_x509_cert_url": {
		"type": "string",
		"required": true
	},
	"client_x509_cert_url": {
		"type": "string",
		"required": true
	}
}
```
```json EMR/Presto logs
{
	"bucket": {
		"type": "string",
		"required": true
	},
	"prefix": {
		"type": "string",
		"required": true
	},
	"assumable_role": {
		"type": "string",
		"required": false
	},
	"external_id": {
		"type": "string",
		"required": false
	}
}
```
```json Glue
{
	"assumable_role": {
		"type": "string",
		"required": false
	},
	"external_id": {
		"type": "string",
		"required": false
	},
	"aws_region": {
		"type": "string",
		"required": false
	}
}
```
```json Hive (SQL)
{
	"host": {
		"type": "string",
		"required": true
	},
	"port": {
		"type": "integer",
		"required": false,
		"nullable": false
	},
	"username": {
		"type": "string",
		"required": true
	},
	"database": {
		"type": "string",
		"required": false,
		"nullable": true
	},
	"password": {
		"type": "string",
		"required": true
	}
}
```
```json Hive (Metastore)
{
	"db_name": {
		"type": "string",
		"required": true
	},
	"host": {
		"type": "string",
		"required": true
	},
	"port": {
		"type": "string",
		"required": true
	},
	"user": {
		"type": "string",
		"required": true
	},
	"password": {
		"type": "string",
		"required": true
	},
	"assumable_role": {
		"type": "string",
		"required": false
	},
	"external_id": {
		"type": "string",
		"required": false
	},
	"ssl_options": {
		"type": "dict",
		"required": false,
		"schema": {
			"ca": {
				"type": "string",
				"required": false
			},
			"cert": {
				"type": "string",
				"required": false
			},
			"key": {
				"type": "string",
				"required": false
			},
			"mechanism": {
				"type": "string",
				"required": false,
				"allowed": ["url"]
			}
		}
	}
}
```
```json Looker (API)
{
	"base_url": {
		"type": "string",
		"required": true
	},
	"client_id": {
		"type": "string",
		"required": true
	},
	"client_secret": {
		"type": "string",
		"required": true
	},
	"verify_ssl": {
		"type": "boolean",
		"required": false
	}
}
```
```json Looker (Git)
{
	"ssh_key": {
		"type": "string",
		"required": false
	},
	"repo_url": {
		"type": "string",
		"required": true
	},
	"token": {
		"type": "string",
		"required": false
	},
	"username": {
		"type": "string",
		"required": false
	}
}
```
```json Presto
{
	"host": {
		"type": "string",
		"required": true
	},
	"port": {
		"type": "integer",
		"required": false
	},
	"user": {
		"type": "string",
		"required": true
	},
	"catalog": {
		"type": "string",
		"required": false
	},
	"schema": {
		"type": "string",
		"required": false
	},
	"timeout": {
		"type": "integer",
		"required": false
	},
	"http_scheme": {
		"type": "string",
		"required": false
	},
	"password": {
		"type": "string",
		"required": false
	},
	"ssl_options": {
		"type": "dict",
		"required": false,
		"schema": {
			"ca": {
				"type": "string",
				"required": false
			},
			"cert": {
				"type": "string",
				"required": false
			},
			"key": {
				"type": "string",
				"required": false
			},
			"mechanism": {
				"type": "string",
				"required": false,
				"allowed": ["dc-s3"]
			},
			"skip_verification": {
				"type": "boolean",
				"required": false
			}
		}
	}
}
```
```json Redshift
{
	"db_name": {
		"type": "string",
		"required": true
	},
	"host": {
		"type": "string",
		"required": true
	},
	"port": {
		"type": "string",
		"required": true
	},
	"user": {
		"type": "string",
		"required": true
	},
	"password": {
		"type": "string",
		"required": true
	}
}
```
```json Snowflake (user/password)
{
	"user": {
		"type": "string",
		"required": true
	},
	"password": {
		"type": "string",
		"required": true
	},
	"account": {
		"type": "string",
		"required": true
	},
	"warehouse": {
		"type": "string",
		"required": false
	}
}
```
```json Snowflake (private key)
{
	"user": {
		"type": "string",
		"required": true
	},
	"private_key": {
		"type": "string",
		"description": "PEM as a JSON-safe single string.",
		"required": true
	},
	"private_key_passphrase": {
		"type": "string",
		"description": "Only needed if private key is encrypted.",
		"required": false
	},
	"account": {
		"type": "string",
		"required": true
	},
	"warehouse": {
		"type": "string",
		"required": false
	}
}
```
```json Spark (Binary)
{
	"mode": "binary",
	"host": {
		"type": "string",
		"required": false
	},
	"port": {
		"type": "integer",
		"required": false,
		"nullable": true
	},
	"username": {
		"type": "string",
		"required": false
	},
	"database": {
		"type": "string",
		"required": false,
		"nullable": true
	},
	"password": {
		"type": "string",
		"required": false
	}
}
```
```json Spark (Databricks)
{
	"mode": "databricks",

	"databricks_workspace_url": {
		"type": "string",
		"required": false
	},
	"databricks_workspace_id": {
		"type": "string",
		"required": false
	},
	"databricks_cluster_id": {
		"type": "string",
		"required": false
	},
	"databricks_token": {
		"type": "string",
		"required": false
	}
}
```
```json Spark (HTTP)
{
	"mode": "http",
	"username": {
		"type": "string",
		"required": false
	},
	"password": {
		"type": "string",
		"required": false
	},
	"url": {
		"type": "string",
		"required": false
	}
}
```
```Text Tableau
{
    "server_name": {
        "type": "string",
        "required": true
    },
    "site_name": {
        "type": "string",
        "required": true
    },
    "token_name": {
        "type": "string",
        "required": true
    },
    "token_value": {
        "type": "string",
        "required": true
    }
}
```

2. Go to Secrets Manager on your AWS console and click "Store a new secret." Ensure that you select the appropriate region to create your secret. If you are on the [V2 platform](https://docs.getmontecarlo.com/docs/deployment-and-connecting#how-do-i-check-which-version-of-the-platform-or-deployments-i-am-using), make sure to select the **AWS region** provided in the [Account information](https://getmontecarlo.com/account-info#platform) page; otherwise, check with your account representative to determine the correct region to use.
3. Select "Other type of secrets" and paste the filled-in schema from step 1. Then select "Next".

<Image align="center" alt={1862} border={false} caption="Example with Snowflake" title="Screen Shot 2021-10-29 at 3.28.49 PM.png" src="https://files.readme.io/49adb20-Screen_Shot_2021-10-29_at_3.28.49_PM.png" />

4. Give the secret a meaningful name, description and any tags. Then select "Next".
5. Configure automatic rotation, if you'd like. Then select "Next".
6. Review and select "Store".
7. From the Secrets Manager console search for the secret you just created. Save the ARN.

## Step 2: Create a role that allows secret access

You will create an IAM role with the necessary API permissions in order to access to the secret:

1. Copy the policy below. Please specify the ARN from above where `<secret_arn>` appears.

```json IAM Policy
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "secretsmanager:GetSecretValue",
            "Resource": "<secret_arn>"
        }
    ]
}
```

2. Create the IAM role. If you are on the [V2 platform](https://docs.getmontecarlo.com/docs/deployment-and-connecting#how-do-i-check-which-version-of-the-platform-or-deployments-i-am-using), use the Collection **AWS account ID** provided in the [Account information](https://getmontecarlo.com/account-info#collection) as the AWS Account ID for the trust policy with an optional external ID. Otherwise, follow the steps outlined [here](https://docs.getmontecarlo.com/docs/creating-iam-roles) to create the IAM role. As part of the process, you will attach the policy from step 1 to this role.

## Step 3: Set up the integration

You will provide connection details using Monte Carlo's CLI:

1. Follow [this guide](https://docs.getmontecarlo.com/docs/using-the-cli) to install and configure the CLI (requires >= `0.13.2`).
2. Use the command `montecarlo integrations add-self-hosted-credentials` to add the integration. For detailed instructions, refer to the [reference guide](https://clidocs.getmontecarlo.com/#montecarlo-integrations-add-self-hosted-credentials).

# FAQs

### What if I want to migrate an existing integration to use self-hosted credentials?

After creating the [secret](https://docs.getmontecarlo.com/docs/using-self-hosted-credentials#create-a-secret-in-your-aws-account) and [role](https://docs.getmontecarlo.com/docs/using-self-hosted-credentials#create-a-role-that-allows-secret-access-for-monte-carlos-data-collector), you can use the `montecarlo integrations update` command to transfer credential management. For detailed instructions, refer to the [reference guide](https://clidocs.getmontecarlo.com/#montecarlo-integrations-update).

```shell Example
$ montecarlo integrations update --replace-all --connection-id <CONNECTION-ID> --changes '{"self_hosting_mechanism": "secretsmanager", "self_hosting_key": "<SECRET_ARN>", "assumable_role": "<ROLE_ARN>", "external_id": "<EXTERNAL_ID>", "region": "<AWS_REGION>"}'
```

Note: You can use the `montecarlo integrations list` command to retrieve the `<CONNECTION-ID>` ([reference](https://clidocs.getmontecarlo.com/#montecarlo-integrations-list)).