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

Port ARM snippets to bicep - part 4 #2651

Merged
merged 19 commits into from
May 13, 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
188 changes: 184 additions & 4 deletions src/Bicep.Core.Samples/Files/Completions/declarations.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// $1 = cassandraKeyspace
// $2 = 'accountName/cassandra/databaseName'
// $3 = 'id'
// $4 = 'throughput'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource cassandraKeyspace 'Microsoft.DocumentDB/databaseAccounts/apis/keyspaces@2016-03-31' = {
name: 'accountName/cassandra/databaseName'
properties: {
resource: {
id: 'id'
}
options: {
throughput: 'throughput'
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// $1 = 'accountName/cassandra/databaseName'
// $2 = 'id'
// $3 = cassandraKeyspaceTable
// $4 = 'name'
// $5 = 'id'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
resource cassandraKeyspace 'Microsoft.DocumentDB/databaseAccounts/apis/keyspaces@2016-03-31' = {
name: 'accountName/cassandra/databaseName'
properties: {
resource: {
id: 'id'
}
options: {}
}
}

resource cassandraKeyspaceTable 'Microsoft.DocumentDb/databaseAccounts/apis/keyspaces/tables@2016-03-31' = {
parent: cassandraKeyspace
name: 'name'
properties: {
resource: {
id: 'id'
}
options: {}
}
}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// $1 = databaseAccount
// $1 = gremlinDb
// $2 = 'accountName/gremlin/databaseName'
// $3 = 'id'
// $4 = 'throughput'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
resource gremlinDb 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
name: 'accountName/gremlin/databaseName'
properties: {
resource: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
resource gremlinDb 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
name: 'accountName/gremlin/databaseName'
properties: {
resource: {
Expand All @@ -11,7 +11,7 @@ resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2
}

resource cosmosDBGremlinGraph 'Microsoft.DocumentDb/databaseAccounts/apis/databases/graphs@2016-03-31' = {
parent: databaseAccount
parent: gremlinDb
name: 'name'
properties: {
resource: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// $1 = mongoDb
// $2 = 'accountName/mongodb/databaseName'
// $3 = 'id'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource mongoDb 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
name: 'accountName/mongodb/databaseName'
properties: {
resource: {
id: 'id'
}
options: {}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// $1 = 'accountName/sql/databaseName'
// $2 = 'id'
// $3 = sqlContainerName
// $4 = 'name'
// $5 = 'id'
// $6 = 'paths'
// $7 = Hash
// $8 = Consistent
// $9 = 'path'
// $10 = Hash
// $11 = String
// $12 = -1
// $13 = 'path'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
resource sqlDb 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
name: 'accountName/sql/databaseName'
properties: {
resource: {
id: 'id'
}
options: {}
}
}

resource sqlContainerName 'Microsoft.DocumentDb/databaseAccounts/apis/databases/containers@2016-03-31' = {
parent: sqlDb
name: 'name'
properties: {
resource: {
id: 'id'
partitionKey: {
paths: [
'paths'
]
kind: 'Hash'
}
indexingPolicy: {
indexingMode: 'Consistent'
includedPaths: [
{
path: 'path'
indexes: [
{
kind: 'Hash'
dataType: 'String'
precision: -1
}
]
}
]
excludedPaths: [
{
path: 'path'
}
]
}
}
options: {}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// $1 = sqlDb
// $2 = 'accountName/sql/databaseName'
// $3 = 'id'
// $4 = 'throughput'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource sqlDb 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
name: 'accountName/sql/databaseName'
properties: {
resource: {
id: 'id'
}
options: {
throughput: 'throughput'
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// $1 = cosmosTable
// $2 = 'accountName/table/databaseName'
// $3 = 'id'
// $4 = 'throughput'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource cosmosTable 'Microsoft.DocumentDB/databaseAccounts/apis/tables@2016-03-31' = {
name: 'accountName/table/databaseName'
properties: {
resource: {
id: 'id'
}
options: {
throughput: 'throughput'
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// $1 = logAnalyticsSolution
// $2 = 'name'
// $3 = 'logAnalyticsWorkspace'
// $4 = 'logAnalyticsSolution'
// $5 = 'name'
// $6 = 'product'
// $7 = 'publisher'
// $8 = 'promotionCode'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource logAnalyticsSolution 'Microsoft.OperationsManagement/solutions@2015-11-01-preview' = {
name: 'name'
location: resourceGroup().location
properties: {
workspaceResourceId: resourceId('Microsoft.OperationalInsights/workspaces', 'logAnalyticsWorkspace')
containedResources: [
resourceId('Microsoft.OperationalInsights/workspaces/views', 'logAnalyticsWorkspace', 'logAnalyticsSolution')
]
}
plan: {
name: 'name'
product: 'product'
publisher: 'publisher'
promotionCode: 'promotionCode'
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// $1 = mediaServices
// $2 = 'name'
// $3 = 'mediaServiceStorageAccount'
// $4 = Primary

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
resource mediaServices 'Microsoft.Media/mediaServices@2020-05-01' = {
name: 'name'
location: resourceGroup().location
properties: {
storageAccounts: [
{
id: resourceId('Microsoft.Storage/storageAccounts', 'mediaServiceStorageAccount')
type: 'Primary'
}
]
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// $1 = networkInterface
// $2 = 'name'
// $3 = 'name'
// $4 = Dynamic
// $5 = 'virtualNetwork'
// $6 = 'subnet'

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
resource networkInterface 'Microsoft.Network/networkInterfaces@2020-11-01' = {
name: 'name'
location: resourceGroup().location
properties: {
ipConfigurations: [
{
name: 'name'
properties: {
privateIPAllocationMethod: 'Dynamic'
subnet: {
id: resourceId('Microsoft.Network/virtualNetworks/subnets', 'virtualNetwork', 'subnet')
}
}
}
]
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// $1 = 'name'
// $2 = sqlServerDatabase
// $3 = 'name'
// $4 = 'collation'
// $5 = Basic
// $6 = 'maxSizeBytes'
// $7 = Basic

// Insert snippet here
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
resource sqlServer 'Microsoft.Sql/servers@2014-04-01' ={
name: 'name'
location: resourceGroup().location
}

resource sqlServerDatabase 'Microsoft.Sql/servers/databases@2014-04-01' = {
parent: sqlServer
name: 'name'
location: resourceGroup().location
properties: {
collation: 'collation'
edition: 'Basic'
maxSizeBytes: 'maxSizeBytes'
requestedServiceObjectiveName: 'Basic'
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Cosmos DB Cassandra Namespace
resource ${1:cassandraKeyspace} 'Microsoft.DocumentDB/databaseAccounts/apis/keyspaces@2016-03-31' = {
name: ${2:'name'}
properties: {
resource: {
id: ${3:'id'}
}
options: {
throughput: ${4:'throughput'}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Cosmos DB Cassandra Table
resource cassandraKeyspace 'Microsoft.DocumentDB/databaseAccounts/apis/keyspaces@2016-03-31' = {
name: ${1:'name'}
properties: {
resource: {
id: ${2:'id'}
}
options: {}
}
}

resource ${3:cassandraKeyspaceTable} 'Microsoft.DocumentDb/databaseAccounts/apis/keyspaces/tables@2016-03-31' = {
parent: cassandraKeyspace
name: ${4:'name'}
properties: {
resource: {
id: ${5:'id'}
}
options: {}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Cosmos DB Gremlin Database
resource ${1:databaseAccount} 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
resource ${1:gremlinDb} 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
name: ${2:'name'}
properties: {
resource: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Cosmos DB Gremlin Graph
resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
resource gremlinDb 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
name: ${1:'name'}
properties: {
resource: {
Expand All @@ -11,8 +11,8 @@ resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2
}
}

resource ${4:cosmosDBGremlinGraph} 'Microsoft.DocumentDb/databaseAccounts/apis/databases/graphs@2016-03-31' = {
parent: databaseAccount
resource ${4:cosmosDbGremlinGraph} 'Microsoft.DocumentDb/databaseAccounts/apis/databases/graphs@2016-03-31' = {
parent: gremlinDb
name: ${5:'name'}
properties: {
resource: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Cosmos DB Mongo Database
resource ${1:mongoDb} 'Microsoft.DocumentDB/databaseAccounts/apis/databases@2016-03-31' = {
name: ${2:'name'}
properties: {
resource: {
id: ${3:'id'}
}
options: {}
}
}
Loading