Skip to main content

Atlas Init - A CLI for developing integrations with MongoDB Atlas

License Coverage

Currently, used with

Quickstart

Recommended as a tool with uvx

uvx atlas-init # help info
uvx atlas-init tf # help for tf specific commands
uvx atlas-init cfn # help for cfn specific commands

Profile Configuration

  1. Create an organization
  2. Go to access_manager and click Create Api Key: https://cloud-dev.mongodb.com/v2#/org/{ORG_ID_IN_URL_FROM_1}/access/apiKeys
    • Tick all permissions
  3. create directories and store a file in profiles/default/.env-manual (ATLAS_INIT_PROFILES_PATH/{profile_name}/.env-manual)
AWS_PROFILE=REPLACE_ME # your AWS profile used to create resources or other env-vars supported by AWS TF provider
MONGODB_ATLAS_ORG_ID=REPLACE_ME # ORG_ID_IN_URL_FROM_1
MONGODB_ATLAS_PUBLIC_KEY=REPLACE_ME # with 2
MONGODB_ATLAS_PRIVATE_KEY=REPLACE_ME # with 2
ATLAS_INIT_PROJECT_NAME=YOUR_NAME # the name of the project
MONGODB_ATLAS_BASE_URL=https://cloud-dev.mongodb.com/ # replace with https://cloud.mongodb.com/ if you are not a MongoDB Employe

# optional
TF_VAR_federated_settings_id=REPLACE_ME # will need to add organization: <https://cloud-dev.mongodb.com/v2#/federation/{FEDERATION_SETTINGS_ID}/organizations> (see internal testing wiki)

# if you want to use your locally built MongoDB atlas provider
# see appendix for details on the content
TF_CLI_CONFIG_FILE=REPLACE_ME/dev.tfrc

# if you plan developing with cloudformation
ATLAS_INIT_CFN_PROFILE=YOUR_NAME
ATLAS_INIT_CFN_REGION=eu-south-2 # find a region with few other profiles

Local development

git clone https://github.com/EspenAlbert/atlas-init
cd atlas-init
brew install pre-commit uv hatch
# https://github.com/astral-sh/uv <-- python packaging lightning fast
# https://hatch.pypa.io/latest/ <-- uv compatible build system for python

pre-commit install

# check that everything works
pre-commit run --all-files

# configure your virtualenv and validate the tests are working
cd py
hatch test
export VENV_DIR=$(hatch env find hatch-test | grep py3.12) # hatch venv path for env=hatch-test
export VENV_PYTHON=$VENV_DIR/bin/python
$VENV_PYTHON # ensure you are in shell with python3.12 (cmd+d to exit)
cd .. # back to repo root

# open in your IDE with virtualenv enabled
code .
# select venv path from $VENV_PYTHON output as python interpreter
# in vs code: use cmd+p and `Python: select interpreter` command

# to make it easy to invoke from any terminal (replace .zprofile with your terminal)
export pypath=$(git rev-parse --show-toplevel)/py
echo "alias atlas_init='export PYTHONPATH=$pypath && \"$VENV_PYTHON\" -m atlas_init'" >> ~/.zprofile

# test that it works
atlas_init # should show how to use the cli

CI Installation Tests (pip install local wheel)

  • uv sync
    • creates a local .venv builds the wheel from this repo and installs it
  • use export ATLAS_INIT_PROFILES_PATH=/somewhere/to/store/your/env-vars/and/tf/state

Appendix

Configuring vscode to use your env vars

  • add to your settings.json
{
    "go.testEnvFile": "/{SOME_PREFIX}/atlas-init/profiles/default/.env-vscode",
}

Content of dev.tfrc

usually, it will look something like this:

provider_installation {
 
  dev_overrides {
 
    "mongodb/mongodbatlas" = "REPO_PATH_TF_PROVIDER/bin"
 
  }
 
  direct {}
 
}

Re-generating the lock files

terraform providers lock \
    -platform=darwin_amd64 \
    -platform=linux_amd64 \
    -platform=darwin_arm64 \
    -platform=linux_arm64
    # -platform=windows_amd64 \

Metadata

Release files for atlas-init 0.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atlas-init 0.10.1
File Size Uploaded
atlas_init-0.10.1.tar.gz 184.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atlas-init 0.10.1
File Interpreter ABI Platform
atlas_init-0.10.1-py3-none-any.whl Python 3 none any Details

Total release size: 433.7 kB

Release files / atlas_init-0.10.1.tar.gz

Download URL atlas_init-0.10.1.tar.gz
Size 184.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a511242dfbe8b595f66835002d2b62ff932d516ef40b4c4fa915141e63ff2eed
BLAKE2b-256 checksum
How to use checksums
fd88bb46d6196c6a26a75f927191f89d9701a602db630c6f5a7b129134c37ee7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2025.

Transparency log

Release files / atlas_init-0.10.1-py3-none-any.whl

Download URL atlas_init-0.10.1-py3-none-any.whl
Size 249.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a0a351c8a7e0f934613140adfda806ba1ebf3ffe8ab2f6370ec8bdcad8db910f
BLAKE2b-256 checksum
How to use checksums
2f93fefe864b577a952a158b5e068ebd10c71d5e2acdd9aa7f644fdffd1064c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.10.1 This release

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.7

1 release file

0.3.6

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.8

1 release file

0.1.4

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page