This repository has been archived by the owner on Jul 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
/
common_arm_template.go
72 lines (71 loc) · 1.94 KB
/
common_arm_template.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package cosmosdb
// nolint: lll
var armTemplateBytes = []byte(`
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"tags": {
"type": "object"
}
},
"resources": [
{
"apiVersion": "2015-04-08",
"kind": "{{ .kind }}",
"type": "Microsoft.DocumentDb/databaseAccounts",
"name": "{{ .name }}",
"location": "{{ .location }}",
"properties": {
{{ if .consistencyPolicy }}
"consistencyPolicy" : {
"defaultConsistencyLevel" : "{{ .consistencyPolicy.defaultConsistencyLevel }}"
{{ if .consistencyPolicy.boundedStaleness }}
,"maxStalenessPrefix": {{ .consistencyPolicy.boundedStaleness.maxStalenessPrefix }}
{{ end }}
{{ if .consistencyPolicy.maxIntervalInSeconds }}
,"maxIntervalInSeconds" : {{ .consistencyPolicy.boundedStaleness.maxIntervalInSeconds }}
{{ end }}
},
{{ end }}
"databaseAccountOfferType": "Standard",
{{ if .ipFilters }}
"ipRangeFilter" : "{{ .ipFilters }}",
{{ end }}
{{ if .capability }}
"capabilities": [
{
"name": "{{ .capability }}"
}
],
{{ end }}
"locations": [
{{range $index,$locationInformation := .readLocations}}
{{if $index}}
,
{{end}}
{
"failoverPriority": {{$locationInformation.Priority}},
"locationName": "{{$locationInformation.Location}}",
"id": "{{$locationInformation.ID}}"
}
{{end}}
],
"enableAutomaticFailover": {{ .enableAutomaticFailover}},
"enableMultipleWriteLocations": {{ .enableMultipleWriteLocations}}
},
"tags": "[parameters('tags')]"
}
],
"outputs": {
"fullyQualifiedDomainName": {
"type": "string",
"value": "[reference('{{ .name }}').documentEndpoint]"
},
"primaryKey":{
"type": "string",
"value": "[listKeys(resourceId('Microsoft.DocumentDb/databaseAccounts', '{{ .name }}'), '2015-04-08').primaryMasterKey]"
}
}
}
`)