Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli atlas privateendpoint create

On this page

  • Syntax
  • Options
  • Output
  • Example

The privateendpoint create command creates one private endpoint connection for a given Atlas project.

mongocli atlas privateendpoint(s)|privateEndpoint(s) create
--region <cloud-provider-region>
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]

Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
--region
string

Cloud provider region in which you want to create the private endpoint connection.

Note

Atlas supports private endpoint connections only for AWS.

See the Atlas documentation for limitations on the number of private endpoints you can create in different regions.

Accepted values are:

  • us-east-1

  • us-east-2

  • us-west-1

  • us-west-2

  • ca-central-1

  • sa-east-1

  • eu-north-1

  • eu-west-1

  • eu-west-2

  • eu-west-3

  • eu-central-1

  • me-south-1

  • ap-northeast-1

  • ap-northeast-2

  • ap-south-1

  • ap-southeast-1

  • ap-southeast-2

  • ap-east-1

yes
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

If omitted, the command returns output in the default format.

no
--profile, -P
string
Name of the profile where the public and private keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI.
no
--projectId
string

Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable.

no

If the command succeeds, it returns the following output in the default format. If the command returns errors, see Troubleshooting for recommended solutions.

Private endpoint '<private-endpoint-id>' created.

The default output is a subset of the fields returned by this command. For the complete list of JSON fields returned by the command, see the Public API reference for your MongoDB service:

The following command creates one private endpoint connection for a project using the default profile, which contains credentials and the project ID. The output is returned in the default format.

mongocli atlas privateendpoint create --region us-east-1 5f4fc81c1f03a835c2728ff7

The previous command prints the following to the terminal.

Private endpoint '5f4fc829a2b47835a58c6d04' created.

The following command creates one private endpoint connection for a project using the default profile, which contains credentials and the project ID. The output is returned in JSON format.

mongocli atlas privateendpoint create --region us-east-1 5f4fc81c1f03a835c2728ff7 --output json

The previous command prints the following to the terminal in JSON format.

{
"id": "5f4fc81c1f03a835c2728ff7",
"status": "INITIATING"
}

Back

Describe One Private Endpoint Connection