Skip to content

Commit

Permalink
[Snippet] Added Route Server snippet (#3976)
Browse files Browse the repository at this point in the history
* Added route server snippet
  • Loading branch information
StefanIvemo authored Aug 31, 2021
1 parent 5856f2a commit c613f8c
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/Bicep.Core.Samples/Files/Completions/declarations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,35 @@
]
}
},
{
"label": "res-route-server",
"kind": "snippet",
"detail": "Route Server",
"documentation": {
"kind": "markdown",
"value": "```bicep\nresource virtualHub 'Microsoft.Network/virtualHubs@2021-02-01' = {\n name: 'name'\n location: resourceGroup().location\n properties: {\n sku: 'Standard'\n }\n}\n\nresource ipConfiguration 'Microsoft.Network/virtualHubs/ipConfigurations@2021-02-01' = {\n name: 'name'\n parent: virtualHub\n properties: {\n subnet: {\n id: 'subnet.id'\n }\n }\n}\n\n```"
},
"deprecated": false,
"preselect": false,
"sortText": "2_res-route-server",
"insertTextFormat": "snippet",
"insertTextMode": "adjustIndentation",
"textEdit": {
"range": {},
"newText": "resource virtualHub 'Microsoft.Network/virtualHubs@2021-02-01' = {\n name: ${1:'name'}\n location: resourceGroup().location\n properties: {\n sku: 'Standard'\n }\n}\n\nresource ${2:ipConfiguration} 'Microsoft.Network/virtualHubs/ipConfigurations@2021-02-01' = {\n name: ${3:'name'}\n parent: virtualHub\n properties: {\n subnet: {\n id: ${4:'subnet.id'}\n }\n }\n}\n"
},
"command": {
"command": "bicep.Telemetry",
"arguments": [
{
"EventName": "TopLevelDeclarationSnippetInsertion",
"Properties": {
"name": "res-route-server"
}
}
]
}
},
{
"label": "res-route-table",
"kind": "snippet",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// $1 = 'name'
// $2 = ipConfiguration
// $3 = 'name'
// $4 = 'subnet.id'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// $1 = 'name'
// $2 = ipConfiguration
// $3 = 'name'
// $4 = 'subnet.id'

resource virtualHub 'Microsoft.Network/virtualHubs@2021-02-01' = {
name: 'name'
location: resourceGroup().location
properties: {
sku: 'Standard'
}
}

resource ipConfiguration 'Microsoft.Network/virtualHubs/ipConfigurations@2021-02-01' = {
name: 'name'
parent: virtualHub
properties: {
subnet: {
id: 'subnet.id'
}
}
}
// Insert snippet here
18 changes: 18 additions & 0 deletions src/Bicep.LangServer/Snippets/Templates/res-route-server.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Route Server
resource virtualHub 'Microsoft.Network/virtualHubs@2021-02-01' = {
name: /*${1:'name'}*/'name'
location: resourceGroup().location
properties: {
sku: 'Standard'
}
}

resource /*${2:ipConfiguration}*/ipConfiguration 'Microsoft.Network/virtualHubs/ipConfigurations@2021-02-01' = {
name: /*${3:'name'}*/'name'
parent: virtualHub
properties: {
subnet: {
id: /*${4:'subnet.id'}*/'subnet.id'
}
}
}

0 comments on commit c613f8c

Please sign in to comment.