|
| 1 | +.. _mcli-atlas-networking-peering-create-aws-cmd: |
| 2 | + |
| 3 | +============================================ |
| 4 | +mongocli atlas networking peering aws create |
| 5 | +============================================ |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 1 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | +.. include:: /includes/styles/corrections.rst |
| 16 | + |
| 17 | +The ``networking peering create aws`` command creates a peering |
| 18 | +connection between the |service| VPC and your AWS VPC for |
| 19 | +a given |service| project. |
| 20 | + |
| 21 | +The ``networking peering create aws`` command checks if a VPC exists for |
| 22 | +your |service| project. If one exists, the {+mcli+} creates the peering |
| 23 | +connection between that VPC and your VPC. If an |service| VPC does not |
| 24 | +exist, the {+mcli+} creates one and creates a connection between it and |
| 25 | +your VPC. |
| 26 | + |
| 27 | +Syntax |
| 28 | +------ |
| 29 | + |
| 30 | +.. code-block:: text |
| 31 | + |
| 32 | + mongocli atlas networking peering aws create |
| 33 | + --accountId <aws-account-id> |
| 34 | + [ --atlasCidrBlock <atlas-cidr-block> ] |
| 35 | + --region <atlas-vpc-region> |
| 36 | + --routeTableCidrBlock <vpc-cidr-block-or-subnet> |
| 37 | + --vpcId <aws-vpc-id> |
| 38 | + [ --output|-o <output-format> ] |
| 39 | + [ --profile|-P <profile-name> ] |
| 40 | + [ --projectId <project-ID> ] |
| 41 | + |
| 42 | +.. include:: /includes/fact-command-line-help.rst |
| 43 | + |
| 44 | +.. _atlas-networking-peering-create-aws-options: |
| 45 | + |
| 46 | +Options |
| 47 | +------- |
| 48 | + |
| 49 | +.. list-table:: |
| 50 | + :widths: 20 10 60 10 |
| 51 | + :header-rows: 1 |
| 52 | + |
| 53 | + * - Option |
| 54 | + - Type |
| 55 | + - Description |
| 56 | + - Required? |
| 57 | + |
| 58 | + * - ``--accountId`` |
| 59 | + - string |
| 60 | + - AWS Account ID of the owner of the peer VPC. |
| 61 | + - yes |
| 62 | + |
| 63 | + * - ``--atlasCidrBlock`` |
| 64 | + - string |
| 65 | + - CIDR block that |service| uses for your clusters. Required only |
| 66 | + if you do not already have an |service| VPC. |
| 67 | + |
| 68 | + .. include:: /includes/fact-vpc-cidr-block.rst |
| 69 | + - no |
| 70 | + |
| 71 | + * - ``--region`` |
| 72 | + - string |
| 73 | + - AWS region in which the peer VPC resides. See the |
| 74 | + :atlas:`Atlas documentation </reference/amazon-aws/>` for a list |
| 75 | + of supported regions. |
| 76 | + - yes |
| 77 | + |
| 78 | + * - ``--routeTableCidrBlock`` |
| 79 | + - string |
| 80 | + - Peer AWS VPC CIDR block or subnet. |
| 81 | + - yes |
| 82 | + |
| 83 | + * - ``--vpcId`` |
| 84 | + - string |
| 85 | + - Unique identifier of the peer AWS VPC. |
| 86 | + - yes |
| 87 | + |
| 88 | + * - ``--output``, ``-o`` |
| 89 | + - string |
| 90 | + - .. include:: /includes/extracts/fact-basic-options-output.rst |
| 91 | + - no |
| 92 | + |
| 93 | + * - ``--profile``, ``-P`` |
| 94 | + - string |
| 95 | + - Name of the profile where the public and private |
| 96 | + keys for the project are saved. If omitted, uses the |
| 97 | + {+default-profile+}. To learn more about creating a |
| 98 | + profile, see :ref:`mcli-configure`. |
| 99 | + - no |
| 100 | + |
| 101 | + * - ``--projectId`` |
| 102 | + - string |
| 103 | + - Unique identifier of the project for which you want to add |
| 104 | + the interface endpoint. If omitted, uses the |
| 105 | + project ID in the profile or :ref:`environment variable |
| 106 | + <mcli-env-var>`. |
| 107 | + - no |
| 108 | + |
| 109 | +.. _atlas-networking-peering-create-aws-output: |
| 110 | + |
| 111 | +Output |
| 112 | +------ |
| 113 | + |
| 114 | +If the command succeeds, it returns the following output in the default |
| 115 | +format. If the command returns errors, see |
| 116 | +:ref:`Troubleshooting <troubleshooting>` for recommended solutions. |
| 117 | + |
| 118 | +.. code-block:: sh |
| 119 | + :copyable: false |
| 120 | + |
| 121 | + Network peering connection '<peering-connection-id>' created. |
| 122 | + |
| 123 | +.. include:: /includes/fact-default-output.rst |
| 124 | + |
| 125 | +- :atlas:`Atlas API </reference/api/vpc-create-peering-connection/#request-body-parameters>` |
| 126 | + |
| 127 | +Example |
| 128 | +------- |
| 129 | + |
| 130 | +.. tabs:: |
| 131 | + |
| 132 | + .. tab:: Default Output |
| 133 | + :tabid: default-output |
| 134 | + |
| 135 | + The following command creates a peering connection between the |
| 136 | + |service| VPC and your AWS VPC for a project using the |
| 137 | + {+default-profile+}, which contains credentials and the project |
| 138 | + ID. The output is returned in the default format. |
| 139 | + |
| 140 | + .. code-block:: sh |
| 141 | + |
| 142 | + atlas networking peering create aws --accountId <aws-account-id> \ |
| 143 | + --atlasCidrBlock 192.168.0.0/24 --region us-east-1 \ |
| 144 | + --routeTableCidrBlock 10.0.0.0/24 --vpcId vpc-078ac381aa90e1e63 |
| 145 | + |
| 146 | + The previous command prints the following to the terminal. |
| 147 | + |
| 148 | + .. code-block:: sh |
| 149 | + :copyable: false |
| 150 | + |
| 151 | + Network peering connection '5f60c5bd0948295c093565ba' created. |
| 152 | + |
| 153 | + .. tab:: JSON Output |
| 154 | + :tabid: json-output |
| 155 | + |
| 156 | + The following command creates a peering connection between the |
| 157 | + |service| VPC and your AWS VPC for a project using the |
| 158 | + {+default-profile+}, which contains credentials and the project |
| 159 | + ID. The output is returned in |json| format. |
| 160 | + |
| 161 | + .. code-block:: sh |
| 162 | + |
| 163 | + atlas networking peering create aws --accountId <aws-account-id> \ |
| 164 | + --atlasCidrBlock 192.168.0.0/24 --region us-east-1 \ |
| 165 | + --routeTableCidrBlock 10.0.0.0/24 --vpcId vpc-078ac381aa90e1e63 \ |
| 166 | + --output json |
| 167 | + |
| 168 | + The previous command prints the following to the terminal in |
| 169 | + |json| format. |
| 170 | + |
| 171 | + .. code-block:: json |
| 172 | + :copyable: false |
| 173 | + |
| 174 | + { |
| 175 | + "awsAccountId": "<aws-account-id>", |
| 176 | + "containerId": "5f4eb2178c9ff67e809a3619", |
| 177 | + "id": "5f60c5bd0948295c093565ba", |
| 178 | + "routeTableCidrBlock": "10.0.0.0/24", |
| 179 | + "statusName": "INITIATING", |
| 180 | + "vpcId": "vpc-078ac381aa90e1e63" |
| 181 | + } |
0 commit comments