Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snippet] Added Route Server snippet #3976

Merged
merged 4 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -2013,6 +2013,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'
}
}
}