Skip to content

Commit 4c002bc

Browse files
(DOCSP-11853)(DOCSP-11838)(DOCSP-11851): networking peering watch | c… (#232)
* (DOCSP-11853)(DOCSP-11838)(DOCSP-11851): networking peering watch | create gcp | create azure * (DOCSP-11853)(DOCSP-11838)(DOCSP-11851): correct path to new files * (DOCSP-11853)(DOCSP-11838)(DOCSP-11851): fix remaining warnings * (DOCSP-11853)(DOCSP-11838)(DOCSP-11851): tech review feedback * (DOCSP-11853)(DOCSP-11838)(DOCSP-11851): copy review feedback
1 parent df914e8 commit 4c002bc

8 files changed

+667
-1
lines changed

conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@
215215
'gh' : ('https://github.com%s', ''),
216216
'svc-cat' : ('https://svc-cat.io/docs%s', ''),
217217
'datalake' : ('https://docs.mongodb.com/datalake%s', ''),
218-
'aws': ('http://docs.aws.amazon.com%s','')
218+
'aws': ('http://docs.aws.amazon.com%s',''),
219+
'wikipedia' : ('https://en.wikipedia.org/wiki%s', '')
219220
}
220221

221222
intersphinx_mapping = {}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
|service| uses the specified |cidr| block for all other VPC peering
2+
connections created in the project. The |service| |cidr| block must be
3+
at least a ``/18`` in one of the following :rfc:`private networks <1918#section-3>`:
4+
5+
.. list-table::
6+
:header-rows: 1
7+
:widths: 40 40 20
8+
9+
* - Lower Bound
10+
- Upper Bound
11+
- Prefix
12+
13+
* - ``10.0.0.0``
14+
- ``10.255.255.255``
15+
- 10/8
16+
17+
* - ``172.16.0.0``
18+
- ``172.31.255.255``
19+
- 172.16/12
20+
21+
* - ``192.168.0.0``
22+
- ``192.168.255.255``
23+
- 192.168/16
24+
25+
|service| locks this value if an ``M10+`` cluster or a |vpc| peering
26+
connection already exists. To modify the |cidr| block, ensure there are
27+
no ``M10+`` clusters in the project *and* no other |vpc| peering
28+
connections in the project.
29+
30+
Alternatively, :ref:`create a new project <mcli-iam-project-create>`
31+
and create a |vpc| Peering Connection to set the desired |service|
32+
|vpc| |cidr| block for that project.
33+
34+
.. important::
35+
36+
|service| limits the number of MongoDB nodes per |vpc| based on the
37+
|cidr| block and the region selected for the project.
38+
39+
.. example::
40+
41+
A project with an |service| |vpc| |cidr| block of
42+
``/18`` is limited to approximately 80 three-node
43+
replica sets per |gcp| region.
44+
45+
Contact :website:`MongoDB Support </contact>` for any questions on
46+
|service| limits of MongoDB nodes per |vpc|.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
|service| uses the specified |cidr| block for all other Network Peering
2+
connections created in the project. The |service| |cidr| block must be
3+
at least ``/24`` and at most ``/21`` in one of the following
4+
:rfc:`private networks <1918#section-3>`.
5+
6+
.. list-table::
7+
:header-rows: 1
8+
:widths: 40 40 20
9+
10+
* - Lower Bound
11+
- Upper Bound
12+
- Prefix
13+
14+
* - ``10.0.0.0``
15+
- ``10.255.255.255``
16+
- 10/8
17+
18+
* - ``172.16.0.0``
19+
- ``172.31.255.255``
20+
- 172.16/12
21+
22+
* - ``192.168.0.0``
23+
- ``192.168.255.255``
24+
- 192.168/16
25+
26+
|service| locks this value if an ``M10+`` cluster or a Network Peering
27+
connection already exists. To modify the |cidr| block, ensure there are
28+
no ``M10+`` clusters in the project *and* no other Network Peering
29+
connections in the project.
30+
31+
Alternatively, :ref:`create a new project <mcli-iam-project-create>`
32+
and create a Network Peering Connection to set the desired |service|
33+
Network Peering |cidr| block for that project.
34+
35+
.. important::
36+
37+
|service| limits the number of MongoDB nodes per Network Peering
38+
connection based on the |cidr| block and the region selected for the project.
39+
40+
Contact :website:`MongoDB Support </contact>` for any questions on
41+
|service| limits of MongoDB nodes per Network Peer.

source/reference/atlas/networking-commands.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ Atlas ``networking`` Commands
1111

1212
List Containers </reference/atlas/networking-containers-list>
1313
Delete One Container </reference/atlas/networking-containers-delete>
14+
Create One Network Peering Connection to an Azure VNet </reference/atlas/networking-peering-create-azure>
15+
Create One Network Peering Connection to a Google Cloud Platform VPC </reference/atlas/networking-peering-create-gcp>
16+
Watch One Network Peering Connection </reference/atlas/networking-peering-watch>
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
.. _mcli-atlas-networking-peering-create-azure-cmd:
2+
3+
==============================================
4+
mongocli atlas networking peering azure 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 azure`` command creates a peering
18+
connection between the |service| VNet and your Azure VNet
19+
for a given |service| project.
20+
21+
The ``networking peering create azure`` command checks if a VNet exists
22+
in the region you specify for your |service| project. If one exists,
23+
this command creates the peering connection between that VNet and your
24+
VNet. If an |service| VNet does not exist, this command creates one and
25+
creates a connection between it and your VNet.
26+
27+
Prerequisites
28+
-------------
29+
30+
.. note::
31+
32+
For details about how |service| creates
33+
:wikipedia:`Network Peering </Virtual_private_cloud>`
34+
connections with Azure VNets, see the ``Azure`` tab in
35+
:atlas:`Set up a Network Peering Connection
36+
</security-vpc-peering/>` in the |service| documentation.
37+
38+
You must complete the following steps before you create each Azure
39+
network peering connection:
40+
41+
1. Run the following Azure CLI command to create a service principal
42+
using the specified |service| peering application ID:
43+
44+
.. code-block:: sh
45+
46+
az ad sp create --id e90a1407-55c3-432d-9cb1-3638900a9d22
47+
48+
You only have to do this once for each subscription. If you receive
49+
the following message, the service principal with the |service|
50+
peering application ID already exists. Proceed to the next step.
51+
52+
.. code-block:: sh
53+
:copyable: false
54+
55+
Another object with the same value for property servicePrincipalNames already exists.
56+
57+
#. Copy the following example ``peering-role.json`` file and save it
58+
to your current working directory:
59+
60+
.. code-block:: json
61+
:linenos:
62+
63+
{
64+
"Name":"AtlasPeering/<azureSubscriptionId>/<resourceGroupName>/<vnetName>",
65+
"IsCustom":true,
66+
"Description":"Grants MongoDB access to manage peering connections on network /subscriptions/<azureSubscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/virtualNetworks/<vnetName>",
67+
"Actions":[
68+
"Microsoft.Network/virtualNetworks/virtualNetworkPeerings/read",
69+
"Microsoft.Network/virtualNetworks/virtualNetworkPeerings/write",
70+
"Microsoft.Network/virtualNetworks/virtualNetworkPeerings/delete",
71+
"Microsoft.Network/virtualNetworks/peer/action"
72+
],
73+
"AssignableScopes":[
74+
"/subscriptions/<azureSubscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/virtualNetworks/<vnetName>"
75+
]
76+
}
77+
78+
#. Replace the variables in the ``peering-role.json`` with details
79+
about the Azure VNet to which you want to create a peering
80+
connection:
81+
82+
.. list-table::
83+
:header-rows: 1
84+
:widths: 30 70
85+
86+
* - Variable
87+
- Description
88+
89+
* - ``azureSubscriptionId``
90+
- Unique identifer of the Azure subscription in which the
91+
VNet resides.
92+
93+
* - ``resourceGroupName``
94+
- Name of your Azure resource group.
95+
96+
* - ``vnetName``
97+
- Name of your Azure VNet.
98+
99+
#. Run the following Azure CLI command to create the role definition
100+
using the ``peering-role.json`` file:
101+
102+
.. code-block:: sh
103+
104+
az role definition create --role-definition peering-role.json
105+
106+
#. Run the Azure CLI command shown below to assign the role you created
107+
to the service principal.
108+
109+
Replace the variables with the same values you used in the
110+
``peering-role.json`` file.
111+
112+
.. code-block:: sh
113+
114+
az role assignment create \
115+
--role "AtlasPeering/<azureSubscriptionId>/<resourceGroupName>/<vnetName>" \
116+
--assignee "e90a1407-55c3-432d-9cb1-3638900a9d22" \
117+
--scope "/subscriptions/<azureSubscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/virtualNetworks/<vnetName>"
118+
119+
Syntax
120+
------
121+
122+
.. code-block:: text
123+
124+
mongocli atlas networking peering azure create
125+
[ --atlasCidrBlock <atlas-cidr-block> ]
126+
--directoryId <azure-ad-tenant-id>
127+
[ --output|-o <output-format> ]
128+
[ --profile|-P <profile-name> ]
129+
[ --projectId <project-ID> ]
130+
--region <azure-region-id>
131+
--resourceGroup <azure-resource-group-name>
132+
--subscriptionId <azure-subscription-id>
133+
--vnet <azure-vnet-name>
134+
135+
.. include:: /includes/fact-command-line-help.rst
136+
137+
.. _atlas-networking-peering-create-azure-options:
138+
139+
Options
140+
-------
141+
142+
.. list-table::
143+
:widths: 20 10 60 10
144+
:header-rows: 1
145+
146+
* - Option
147+
- Type
148+
- Description
149+
- Required?
150+
151+
* - ``--atlasCidrBlock``
152+
- string
153+
- CIDR block that |service| uses for your clusters. Required only
154+
if you do not already have an |service| VNet.
155+
156+
.. include:: /includes/fact-peering-azure-atlas-cidr-block.rst
157+
- no
158+
159+
* - ``--directoryId``
160+
- string
161+
- Unique identifier for your Azure Active Directory tenant.
162+
- yes
163+
164+
* - ``--output``, ``-o``
165+
- string
166+
- .. include:: /includes/extracts/fact-basic-options-output.rst
167+
- no
168+
169+
* - ``--profile``, ``-P``
170+
- string
171+
- Name of the profile where the public and private
172+
keys for the project are saved. If omitted, uses the
173+
{+default-profile+}. To learn more about creating a
174+
profile, see :ref:`mcli-configure`.
175+
- no
176+
177+
* - ``--projectId``
178+
- string
179+
- Unique identifier of the project for which you want to add
180+
the peering connection. If omitted, uses the
181+
project ID in the profile or :ref:`environment variable
182+
<mcli-env-var>`.
183+
- no
184+
185+
* - ``--region``
186+
- string
187+
- Azure region in which the peer VPC resides. See the
188+
:atlas:`Atlas documentation </reference/microsoft-azure/>` for a list
189+
of supported regions.
190+
- no
191+
192+
* - ``--resourceGroup``
193+
- string
194+
- Name of the Azure resource group that contains the VNet that you
195+
want to peer.
196+
- yes
197+
198+
* - ``--subscriptionId``
199+
- string
200+
- Unique identifier of the Azure subscription that contains the
201+
VNet that you want to peer.
202+
- yes
203+
204+
* - ``--vnet``
205+
- string
206+
- Name of the VNet that you want to peer.
207+
- yes
208+
209+
.. _atlas-networking-peering-create-azure-output:
210+
211+
Output
212+
------
213+
214+
If the command succeeds, it returns the following output in the default
215+
format. If the command returns errors, see
216+
:ref:`Troubleshooting <troubleshooting>` for recommended solutions.
217+
218+
.. code-block:: sh
219+
:copyable: false
220+
221+
Network peering connection '<peering-connection-id>' created.
222+
223+
.. include:: /includes/fact-default-output.rst
224+
225+
- :atlas:`Atlas API </reference/api/vpc-create-peering-connection/#request-body-parameters>`
226+
227+
Example
228+
-------
229+
230+
.. tabs::
231+
232+
.. tab:: Default Output
233+
:tabid: default-output
234+
235+
The following command creates a peering connection between the
236+
|service| VNet and your Azure VNet for a project using the
237+
{+default-profile+}, which contains credentials and the project
238+
ID. The output is returned in the default format.
239+
240+
.. code-block:: sh
241+
242+
mongocli atlas networking peering create azure --atlasCidrBlock 192.168.0.0/21 \
243+
--directoryId 56657fdb-ca45-40dc-fr56-77fd8b6d2b37 \
244+
--subscriptionId 345654f3-77cf-4084-9e06-8943a079ed75 \
245+
--resourceGroup mongocli-test --region US_EAST_2 --vnet mongocli-test
246+
247+
The previous command prints the following to the terminal.
248+
249+
.. code-block:: sh
250+
:copyable: false
251+
252+
Network peering connection '5f621a5669a49208c2160f40' created.
253+
254+
.. tab:: JSON Output
255+
:tabid: json-output
256+
257+
The following command creates a peering connection between the
258+
|service| VNet and your Azure VNet for a project using the
259+
{+default-profile+}, which contains credentials and the project
260+
ID. The output is returned in |json| format.
261+
262+
.. code-block:: sh
263+
264+
mongocli atlas networking peering create azure --atlasCidrBlock 192.168.0.0/21 \
265+
--directoryId 56657fdb-ca45-40dc-fr56-77fd8b6d2b37 \
266+
--subscriptionId 345654f3-77cf-4084-9e06-8943a079ed75 \
267+
--resourceGroup mongocli-test --region US_EAST_2 --vnet mongocli-test \
268+
--output json
269+
270+
The previous command prints the following to the terminal in
271+
|json| format.
272+
273+
.. code-block:: json
274+
:copyable: false
275+
276+
{
277+
"containerId": "5f3a84b1242d9c2dc7cf244a",
278+
"id": "5f621a5669a49208c2160f40",
279+
"azureDirectoryId": "56657fdb-ca45-40dc-fr56-77fd8b6d2b37",
280+
"azureSubscriptionId": "345654f3-77cf-4084-9e06-8943a079ed75",
281+
"resourceGroupName": "mongocli-test",
282+
"vnetName": "mongocli-test",
283+
"status": "ADDING_PEER"
284+
}

0 commit comments

Comments
 (0)