forked from Azure/aks-engine
/
cosmosdb.go
39 lines (37 loc) · 1.15 KB
/
cosmosdb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
package engine
func createCosmosDBAccount() map[string]interface{} {
cosmosEtcdMap := map[string]interface{}{
"apiVersion": "[variables('apiVersionCosmos')]",
"name": "[variables('cosmosAccountName')]",
"location": "[resourceGroup().location]",
"kind": "GlobalDocumentDB",
"properties": map[string]interface{}{
"consistencyPolicy": map[string]interface{}{
"defaultConsistencyLevel": "BoundedStaleness",
"maxStalenessPrefix": 100,
"maxIntervalInSeconds": 5,
},
"databaseAccountOfferType": "Standard",
"capabilities": []map[string]string{
{
"name": "EnableEtcd",
},
},
"locations": []map[string]interface{}{
{
"locationName": "[resourceGroup().location]",
"failoverPriority": 0,
},
},
"name": "[variables('cosmosAccountName')]",
"primaryClientCertificatePemBytes": "[variables('cosmosDBCertb64')]",
},
"tags": map[string]string{
"defaultExperience": "Etcd",
},
"type": "Microsoft.DocumentDB/databaseAccounts",
}
return cosmosEtcdMap
}