Docs Menu
Docs Home
/ /
Atlas CLI
/ / /

atlas api projectIpAccessList createProjectIpAccessList

On this page

  • Syntax
  • Options
  • Inherited Options
  • Examples

Public Preview: please provide feedback at: Adds one or more access list entries to the specified project.

MongoDB Cloud only allows client connections to the cluster from entries in the project's IP access list. Write each entry as either one IP address or one CIDR-notated block of IP addresses. To use this resource, the requesting Service Account or API Key must have the Project Owner or Project Charts Admin roles. This resource replaces the whitelist resource. MongoDB Cloud removed whitelists in July 2021. Update your applications to use this new resource. The /groups/{GROUP-ID}/accessList endpoint manages the database IP access list. This endpoint is distinct from the orgs/{ORG-ID}/apiKeys/{API-KEY-ID}/accesslist endpoint, which manages the access list for MongoDB Cloud organizations. This endpoint doesn't support concurrent POST requests. You must submit multiple POST requests synchronously.

This command is autogenerated and corresponds 1:1 with the Atlas API endpoint https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Project-IP-Access-List/operation/createProjectIpAccessList.

For more information and examples, see the referenced API documentation linked above.

Command Syntax
atlas api projectIpAccessList createProjectIpAccessList [options]
Name
Type
Required
Description

--envelope

envelope

false

Flag that indicates whether Application wraps the response in an envelope JSON object. Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query. Endpoints that return a list of results use the results object as an envelope. Application adds the status parameter to the response body.

--file

string

false

path to your API request file. Leave empty to use standard input instead - you must provide one or the other, but not both.

--groupId

string

true

Unique 24-hexadecimal digit string that identifies your project. Use the [/groups](#tag/Projects/operation/listProjects) endpoint to retrieve all projects to which the authenticated user has access.

NOTE: Groups and projects are synonymous terms. Your group id is the same as your project id. For existing groups, your group/project id remains the same. The resource and corresponding endpoints use the term groups.

-h, --help

false

help for createProjectIpAccessList

--includeCount

false

Flag that indicates whether the response returns the total number of items (totalCount) in the response.

--itemsPerPage

int

false

Number of items that the response returns per page.

--output

string

false

preferred api format, can be ["json", go-template] This value defaults to "json".

--output-file

string

false

file to write the api output to. This flag is required when the output of an endpoint is binary (ex: gzip) and the command is not piped (ex: atlas command > out.zip)

--pageNum

int

false

Number of the page that displays the current set of the total objects that the response returns.

--pretty

false

Flag that indicates whether the response body should be in the prettyprint format.

--version

string

false

api version to use when calling the api call [options: "2023-01-01"], defaults to the latest version or the profiles api_version config value if set This value defaults to "2023-01-01".

Name
Type
Required
Description

-P, --profile

string

false

Create the file below and save it as payload.json

# Adds multiple access list entries to the specified project
[
{
"cidrBlock": "192.168.1.0/24",
"comment": "Internal network range"
},
{
"cidrBlock": "10.0.0.0/16",
"comment": "VPC network range"
}
]

After creating payload.json, run the command below in the same directory.

# Adds multiple access list entries to the specified project
atlas api projectIpAccessList createProjectIpAccessList --version 2023-01-01 --file payload.json --groupId [your-project-id]

Back

projectIpAccessList