Skip to content

Commit 23bd4ca

Browse files
Module implementation (#608)
* Module implementation - first pass * Allow modules in example tests * Move path resolution logic around * Add some tests for CycleDetector * Additional tests for module resolution * Switch back to manifest resource streams for examples * Enforce forward slash rather than backslash * Add FileResolver tests * Update implementation based on #614 * Fix example * Params declarational should be optional if all params are optional * Address PR feedback * Address PR feedback
1 parent bf88474 commit 23bd4ca

File tree

214 files changed

+5065
-599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+5065
-599
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"name": "Bicep CLI",
3434
"type": "coreclr",
3535
"request": "launch",
36-
"preLaunchTask": "build",
36+
"preLaunchTask": "build-cli",
3737
"program": "${workspaceFolder}/src/Bicep.Cli/bin/Debug/netcoreapp3.1/Bicep.dll",
3838
"args": [],
3939
"cwd": "${workspaceFolder}/src/Bicep.Cli",

.vscode/tasks.json

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,30 @@
1313
],
1414
"problemMatcher": "$msCompile"
1515
},
16+
{
17+
"label": "build-cli",
18+
"command": "dotnet",
19+
"type": "process",
20+
"args": [
21+
"build",
22+
"${workspaceFolder}/src/Bicep.Cli/Bicep.Cli.csproj",
23+
"/property:GenerateFullPaths=true",
24+
"/consoleloggerparameters:NoSummary"
25+
],
26+
"problemMatcher": "$msCompile"
27+
},
28+
{
29+
"label": "build-langserver",
30+
"command": "dotnet",
31+
"type": "process",
32+
"args": [
33+
"build",
34+
"${workspaceFolder}/src/Bicep.LangServer/Bicep.LangServer.csproj",
35+
"/property:GenerateFullPaths=true",
36+
"/consoleloggerparameters:NoSummary"
37+
],
38+
"problemMatcher": "$msCompile"
39+
},
1640
{
1741
"label": "vscodeext-build",
1842
"command": "npm",
@@ -23,19 +47,9 @@
2347
"cwd": "${workspaceFolder}/src/vscode-bicep"
2448
},
2549
"dependsOn": [
26-
"build",
27-
"vscodeext-install"
50+
"build-langserver"
2851
]
2952
},
30-
{
31-
"label": "vscodeext-install",
32-
"command": "npm",
33-
"args": ["install"],
34-
"type": "shell",
35-
"options": {
36-
"cwd": "${workspaceFolder}/src/vscode-bicep"
37-
}
38-
},
3953
{
4054
"label": "playground-build-wasm",
4155
"command": "npm",
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
param virtualMachineSize string
2+
param adminUsername string
3+
param adminPassword string {
4+
secure: true
5+
}
6+
param storageAccountType string
7+
param location string = resourceGroup().location
8+
9+
var nic1Name = 'nic-1'
10+
var nic2Name = 'nic-2'
11+
var virtualNetworkName = 'virtualNetwork'
12+
var subnet1Name = 'subnet-1'
13+
var subnet2Name = 'subnet-2'
14+
var publicIPAddressName = 'publicIp'
15+
var diagStorageAccountName = concat('diags', uniqueString(resourceGroup().id))
16+
var networkSecurityGroupName = 'NSG'
17+
var networkSecurityGroupName2 = concat(subnet2Name, '-nsg')
18+
19+
module vmMod './vm.bicep' = {
20+
name: 'vmMod'
21+
params: {
22+
adminUsername: adminUsername
23+
adminPassword: adminPassword
24+
virtualMachineSize: virtualMachineSize
25+
virtualMachineName: 'VM-MultiNic'
26+
nic1Id: nic1.id
27+
nic2Id: nic2.id
28+
diagsStorageUri: diagsAccount.properties.primaryEndpoints.blob
29+
}
30+
}
31+
32+
resource diagsAccount 'Microsoft.Storage/storageAccounts@2017-06-01' = {
33+
name: diagStorageAccountName
34+
location: location
35+
sku: {
36+
name: storageAccountType
37+
}
38+
kind: 'Storage'
39+
}
40+
41+
// Simple Network Security Group for subnet2
42+
resource nsg2 'Microsoft.Network/networkSecurityGroups@2019-08-01' = {
43+
name: networkSecurityGroupName2
44+
location: location
45+
properties: {
46+
}
47+
}
48+
49+
// This will build a Virtual Network.
50+
resource vnet 'Microsoft.Network/virtualNetworks@2017-06-01' = {
51+
name: virtualNetworkName
52+
location: location
53+
properties: {
54+
addressSpace: {
55+
addressPrefixes: [
56+
'10.0.0.0/16'
57+
]
58+
}
59+
subnets: [
60+
{
61+
name: subnet1Name
62+
properties: {
63+
addressPrefix: '10.0.0.0/24'
64+
}
65+
}
66+
{
67+
name: subnet2Name
68+
properties: {
69+
addressPrefix: '10.0.1.0/24'
70+
networkSecurityGroup: {
71+
id: nsg2.id
72+
}
73+
}
74+
}
75+
]
76+
}
77+
}
78+
79+
// This will be your Primary NIC
80+
resource nic1 'Microsoft.Network/networkInterfaces@2017-06-01' = {
81+
name: nic1Name
82+
location: location
83+
properties: {
84+
ipConfigurations: [
85+
{
86+
name: 'ipconfig1'
87+
properties: {
88+
subnet: {
89+
id: '${vnet.id}/subnets/${subnet1Name}'
90+
}
91+
privateIPAllocationMethod: 'Dynamic'
92+
publicIPAddress: {
93+
id: pip.id
94+
}
95+
}
96+
}
97+
]
98+
networkSecurityGroup: {
99+
id: nsg.id
100+
}
101+
}
102+
}
103+
104+
// This will be your Secondary NIC
105+
resource nic2 'Microsoft.Network/networkInterfaces@2017-06-01' = {
106+
name: nic2Name
107+
location: location
108+
properties: {
109+
ipConfigurations: [
110+
{
111+
name: 'ipconfig1'
112+
properties: {
113+
subnet: {
114+
id: '${vnet.id}/subnets/${subnet2Name}'
115+
}
116+
privateIPAllocationMethod: 'Dynamic'
117+
}
118+
}
119+
]
120+
}
121+
}
122+
123+
// Public IP for your Primary NIC
124+
resource pip 'Microsoft.Network/publicIPAddresses@2017-06-01' = {
125+
name: publicIPAddressName
126+
location: location
127+
properties: {
128+
publicIPAllocationMethod: 'Dynamic'
129+
}
130+
}
131+
132+
// Network Security Group (NSG) for your Primary NIC
133+
resource nsg 'Microsoft.Network/networkSecurityGroups@2016-09-01' = {
134+
name: networkSecurityGroupName
135+
location: location
136+
properties: {
137+
securityRules: [
138+
{
139+
name: 'default-allow-rdp'
140+
properties: {
141+
priority: 1000
142+
sourceAddressPrefix: '*'
143+
protocol: 'Tcp'
144+
destinationPortRange: '3389'
145+
access: 'Allow'
146+
direction: 'Inbound'
147+
sourcePortRange: '*'
148+
destinationAddressPrefix: '*'
149+
}
150+
}
151+
]
152+
}
153+
}
154+
155+
output publicIp string = pip.properties.ipAddress

0 commit comments

Comments
 (0)