Using Console
Using CLI
<db-instance-identifier>
with the identifier of the MongoDB instance and <security-group-id>
with the ID of the security group that allows access only from specific IP addresses.
5. Verify the changes by running the following command:<db-instance-identifier>
with the identifier of the MongoDB instance.After these steps, the MongoDB instance will only allow access from specific IP addresses.Using Python