Skip to content

Commit 25f4ae2

Browse files
committed
Add virtual network resource with multiple subnets to main.tf
1 parent 49f8372 commit 25f4ae2

File tree

2 files changed

+37
-22
lines changed

2 files changed

+37
-22
lines changed

.github/workflows/terraform.yml

+1-22
Original file line numberDiff line numberDiff line change
@@ -89,25 +89,4 @@ jobs:
8989
ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }}
9090
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
9191
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
92-
run: terraform apply -auto-approve
93-
94-
codeql:
95-
name: 'CodeQL'
96-
runs-on: ubuntu-latest
97-
98-
steps:
99-
# Checkout the repository to the GitHub Actions runner
100-
- name: Checkout
101-
uses: actions/checkout@v2
102-
103-
# Initialize the CodeQL tools for scanning
104-
- name: Initialize CodeQL
105-
uses: github/codeql-action/init@v1
106-
with:
107-
languages: 'javascript,python' # Specify the languages to analyze
108-
109-
# Perform the CodeQL analysis
110-
- name: Perform CodeQL Analysis
111-
uses: github/codeql-action/analyze@v1
112-
with:
113-
category: '/github/workflow/terraform' # Optional: categorize the analysis results
92+
run: terraform apply -auto-approve

main/main.tf

+36
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,42 @@ resource "random_integer" "name_suffix" {
1111
max = 99999
1212
}
1313

14+
##################################################################################
15+
# VIRTUAL NETWORK
16+
##################################################################################
17+
18+
resource "azurerm_virtual_network" "main" {
19+
name = "main-vnet"
20+
address_space = ["172.16.0.0/21"]
21+
location = var.location
22+
resource_group_name = "avd-rg"
23+
24+
subnet {
25+
name = "firewall-subnet"
26+
address_prefixes = ["172.16.0.0/24"]
27+
}
28+
29+
subnet {
30+
name = "vpn-gateway-subnet"
31+
address_prefixes = ["172.16.1.0/24"]
32+
}
33+
34+
subnet {
35+
name = "vms-subnet"
36+
address_prefixes = ["172.16.2.0/24"]
37+
}
38+
39+
subnet {
40+
name = "private-endpoints-subnet"
41+
address_prefixes = ["172.16.3.0/24"]
42+
}
43+
44+
subnet {
45+
name = "app-services-subnet"
46+
address_prefixes = ["172.16.4.0/24"]
47+
}
48+
}
49+
1450
##################################################################################
1551
# VIRTUAL DESKTOP
1652
##################################################################################

0 commit comments

Comments
 (0)