Skip to content

mongodb-developer/Travic-CI-to-Atlas-IP-Access-Lister

Repository files navigation

CI/CD-Tool-Atlas-IP-Access-Lister

This repo contains a collection of scripts that pull IP addresses from various CI/CD tools and adds them to the MongoDB Atlas Access List. The repo currently contains scripts for Travis CI and GitHub Actions.

Travis CI

The following sections contain information about the script for adding Travis CI's IP addresses to the Atlas access list.

Running the Script

Create a file named dev.config. The file needs three constants:

  • PUBLIC_KEY: Your Atlas Public API Key
  • PRIVATE_KEY: Your Atlas Private API Key
  • PROJECT_ID: The ID of the Atlas Project Where You Want to Add the IP Access List Entries

If you rename your config file, update the first line of accesslister.sh appropriately.

Run the script by executing ./accesslister.sh.

Related Resources

GitHub Actions

The following sections contain information about the script for adding GitHub Actions' IP addresses to the Atlas access list.

Running the Script

To run this script, you will need Python installed. You will also need to install configparser using a command like the following:

pip3 install configparser

Create a file named dev.ini. The file should be of the following format:

[Atlas]
PUBLIC_KEY: Your_Atlas_Public_API_Key
PRIVATE_KEY: Your_Atlas_Private_API_Key
PROJECT_ID: The_ID_of_the_Atlas_Project_Where_You_Want_to_Add_the_IP_Access_List_Entries

If you rename your config file, update line 8 of github-actions-access-lister.py appropriately.

Run the script by executing python3 github-actions-access-lister.py.

Related Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published