Error 403 IP_ADDRESS_NOT_ON_ACCESS_LIST

I’m creating a Mongo peering connection using terraform and want to automate the process in CICD using GitHub Actions. Since the GitHub runners don’t have a specific IP Address, the approach I went with was to use a proxy VM where all the network traffic from the GitHub runner in the CICD is passed through it and whitelisted its IP address on Mongo Atlas. However, when I run the CICD pipeline the pipeline fails with the title error but when I ssh into the proxy VM and connect to Mongo Atlas using mongosh the connection is established. Any ideas what the issue could be? or a different approach connecting to Mongo Atlas in a CICD pipeline?

Hi @Kevin_Karobia - Welcome to the community.

I’m hoping maybe details on this post will help narrow down or even resolve the issue. However, as per the Required for Select Resources: API Resource Request Access Lists documentation:

tlas allows your API key to make requests from any address on the internet. Atlas has some exceptions to this rule. These exceptions limit which resources an API key can use without location-based limits defined in an API access list.
To add these location-based limits to your API key, create an API access list. This list limits the internet addresses from which a specific API key can make API requests.
Any API keys with an API access list require all API requests to come from an IP address on that list. Your API access list must include entries for all clients that use the API.

The API access list associated with the API key is different from the Atlas Project Network Access list. I.e. You can still connect to the Atlas instance(s) within a project from a IP that is on the Atlas Project Network Access List and not on the IP Acess List associated with the API Key(s) for that project.

Regards,
Jason

1 Like

Adding the IP address to the API access list solved the issue for me.

Thanks

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.