Navigation

mongocli atlas whitelist delete

On this page

The whitelist delete command deletes the specified whitelist entry in the specified Atlas project. The command prompts you to confirm the operation when you run the command without the --force option.

You can also delete a whitelist entry by using the Atlas UI or API.

Syntax

mongocli atlas whitelist delete|rm <whitelist-entry>
     [ --force ]
     [ --profile|-P <profile-name> ]
     [ --projectId <project-ID> ]

Options

Option Type Description Required?
<whitelist-entry> string IP address, AWS security group ID, or CIDR block of the whitelist entry to delete. yes
--force   Flag that indicates that the whitelist entry can be deleted without requiring confirmation. no
--profile, -P string Name of the profile to use for accessing the Atlas project. If omitted, uses the default profile. no
--projectId string Unique identifier of the project containing the whitelist entry to delete. no

Output

The command prints a confirmation message similar to the following to the terminal if it succeeds. If the command prints an error, see Troubleshooting for recommended solutions.

Project whitelist entry '<whitelist-entry>' deleted

Examples

The following examples use the mongocli whitelist cluster delete command to delete the sample IP address 192.0.2.0.

Example 1

The following mongocli atlas whitelist delete command deletes the IP address 192.0.2.0 after prompting for a confirmation. The command uses the default profile to access the Atlas project.

mongocli atlas whitelist delete 192.0.2.0 --projectId 5e2211c17a3e5a48f5497de3
? Are you sure you want to delete: 192.0.2.0 Yes

The command prints the following to the terminal:

Project whitelist entry '192.0.2.0' deleted

Example 2

The following mongocli atlas whitelist delete command uses the --force option to delete the IP address 192.0.2.0 without confirmation. It uses the profile named egAtlasProfile to access Atlas project.

mongocli atlas whitelist delete 192.0.2.0 --projectId 5e2211c17a3e5a48f5497de3 --force --profile egAtlasProfile

The command prints the following to the terminal:

Project whitelist entry '192.0.2.0' deleted