Skip to content

Commit f15b244

Browse files
committed
add some formatting and a better diagram for NGINXaaS DR.
1 parent 9d0f4a7 commit f15b244

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

content/nginxaas-azure/disaster-recovery.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ terraform apply --auto-approve
6363

6464
### Step 2: Deploy prerequisite infrastructure
6565

66-
Each region requires its own VNet, subnet(s), public IP and network security group. The following example shows the creation of the prerequisite resources:
66+
Each region requires its own VNet, subnet(s), public IP and network security group.
67+
68+
<details closed>
69+
<summary style="font-weight:bold">This sample Terraform code creates the prerequisite resources</summary>
6770

6871
```hcl
6972
# Primary Region
@@ -165,13 +168,17 @@ resource "azurerm_subnet_network_security_group_association" "secondary_virtual_
165168
network_security_group_id = azurerm_network_security_group.secondary_virtual_network_nsg.id
166169
}
167170
```
171+
</details>
168172

169173
---
170174

171175
### Step 3: Configure app servers (upstreams)
172176

173177
You may already have upstreams in the primary region that you wish to reverse proxy using NGINXaaS. For the sake of completion, the following example shows creation of Primary Subnet 2, NICs for the upstreams and the upstreams themselves. The upstream VMs need to be in a subnet separate from the NGINXaaS deployment subnet in the **primary region**.
174178

179+
<details closed>
180+
<summary style="font-weight:bold">This sample Terraform code creates and configures the upstreams</summary>
181+
175182
```hcl
176183
resource "azurerm_subnet" "primary_subnet_2" {
177184
# ...
@@ -221,14 +228,18 @@ resource "azurerm_linux_virtual_machine" "nginx_upstream_vm" {
221228
)
222229
}
223230
```
224-
231+
</details>
232+
<br>
225233
> **Note**: As a best practice, maintain identical upstream resources in your secondary region as in your primary region to ensure full protection and availability in the event of a region-wide outage or disaster.
226234
227235
---
228236
229237
### Step 4: Peer the VNets
230238
231-
Peer the virtual networks so that the upstream app servers are accessible from either primary or secondary NGINXaaS deployment
239+
Peer the virtual networks so that the upstream app servers are accessible from either primary or secondary NGINXaaS deployment.
240+
241+
<details closed>
242+
<summary style="font-weight:bold">This sample Terraform code configures peering for the virtual networks</summary>
232243
233244
```hcl
234245
resource "azurerm_virtual_network_peering" "primary_vnet_to_secondary_vnet" {
@@ -245,7 +256,8 @@ resource "azurerm_virtual_network_peering" "secondary_vnet_to_primary_vnet" {
245256
remote_virtual_network_id = azurerm_virtual_network.primary_virtual_network.id
246257
}
247258
```
248-
259+
</details>
260+
<br>
249261
- **Subnet Peering for Overlapping VNets:**
250262
If overlapping address spaces are unavoidable, use subnet-level peering to selectively peer only the required subnets.
251263
@@ -255,7 +267,10 @@ If overlapping address spaces are unavoidable, use subnet-level peering to selec
255267
256268
### Step 5: Deploy NGINXaaS for Azure in each region
257269
258-
Reverse proxy your upstreams using NGINXaaS. Since the virtual networks are peered, both deployments would be able to access the upstreams. The following code deploys and configures both primary and secondary NGINXaaS deployments.
270+
Reverse proxy your upstreams using NGINXaaS. Since the virtual networks are peered, both deployments would be able to access the upstreams.
271+
272+
<details closed>
273+
<summary style="font-weight:bold">This sample Terraform code deploys and configures both primary and secondary NGINXaaS deployments.</summary>
259274
260275
```hcl
261276
resource "azurerm_nginx_deployment" "primary_nginxaas_deployment" {
@@ -374,6 +389,7 @@ EOT
374389
}
375390
}
376391
```
392+
</details>
377393
378394
---
379395
@@ -382,6 +398,9 @@ EOT
382398
- Use Azure Traffic Manager to direct traffic to the primary NGINXaaS deployment.
383399
- When the primary deployment is detected as being unhealthy, Azure Traffic Manager updates the public DNS record of your service to point to the public IP of the NGINXaaS deployment in the secondary region.
384400
401+
<details closed>
402+
<summary style="font-weight:bold">This sample Terraform code configures Azure Traffic Manager to point to both NGINXaaS deployments.</summary>
403+
385404
```hcl
386405
resource "azurerm_traffic_manager_profile" "nginxaas_failover_monitor" {
387406
...
@@ -418,6 +437,7 @@ resource "azurerm_traffic_manager_external_endpoint" "secondary" {
418437
target = azurerm_nginx_deployment.secondary_nginxaas_deployment.ip_address
419438
}
420439
```
440+
</details>
421441
422442
---
423443
20.6 KB
Loading

0 commit comments

Comments
 (0)