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

Add cosmos mongo vcore bicep to core templates #3507

Closed
Closed
Changes from 7 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
metadata description = 'Azure Cosmos DB MongoDB vCore cluster'
@maxLength(40)
param name string
param location string = resourceGroup().location
param tags object = {}

param administratorLogin string
john0isaac marked this conversation as resolved.
Show resolved Hide resolved
@secure()
param administratorLoginPassword string
param allowAllIPsFirewall bool = false
param allowAzureIPsFirewall bool = false
param allowedSingleIPs array = []
param highAvailabilityMode bool = false
param nodeCount int
param nodeType string = 'Shard'
param sku string
param storage int

resource mognoCluster 'Microsoft.DocumentDB/mongoClusters@2023-03-01-preview' = {
name: name
tags: tags
location: location
properties: {
administratorLogin: administratorLogin
administratorLoginPassword: administratorLoginPassword
nodeGroupSpecs: [
{
diskSizeGB: storage
enableHa: highAvailabilityMode
kind: 'Shard'
john0isaac marked this conversation as resolved.
Show resolved Hide resolved
nodeCount: nodeCount
sku: sku
}
]
}

resource firewall_all 'firewallRules' = if (allowAllIPsFirewall) {
name: 'allow-all-IPs'
properties: {
startIpAddress: '0.0.0.0'
endIpAddress: '255.255.255.255'
}
}
john0isaac marked this conversation as resolved.
Show resolved Hide resolved

resource firewall_azure 'firewallRules' = if (allowAzureIPsFirewall) {
name: 'allow-all-azure-internal-IPs'
properties: {
startIpAddress: '0.0.0.0'
endIpAddress: '0.0.0.0'
}
}

resource firewall_single 'firewallRules' = [for ip in allowedSingleIPs: {
name: 'allow-single-${replace(ip, '.', '')}'
properties: {
startIpAddress: ip
endIpAddress: ip
}
}]

}

output connectionStringKey string = mognoCluster.properties.connectionString
john0isaac marked this conversation as resolved.
Show resolved Hide resolved