1
votes

While trying to create a backup policy for mongodb cluster using Terraform. I got below error

Error: error updating a Cloud Provider Snapshot Backup Policy: PATCH ***************** 403 (request "Forbidden") This resource requires access through a whitelist of ip ranges.

I have been using the code from the sample provided here just replaced the mongodb cluster id and name with my cluster name and id.

I couldn't find anything for this error online. Please help if anyone faced this error.

2

2 Answers

1
votes

Although not expressly documented, for certain api actions, such as updating the backup policy, the API whitelisting needs to be enabled.

To do so, toggle the Require whitelist for Public API setting:

Organization -> Settings -> Require IP Access List for Public API -> On

and add the source IP in the API key access list:

Organization -> Access Manager -> API Keys -> Edit API key permissions -> Next -> ADD ACCESS LIST ENTRY -> Add your source IP

0
votes

Seems like you have to add your IP address to a whitelist in your Mongo Atlas account. It can be done under Security -> Network Access -> IP Whitelist.

You can find more info about how to do it on official website.