This repository has been archived by the owner on Jul 6, 2022. It is now read-only.
/
all_in_one_arm_template.go
74 lines (72 loc) · 1.78 KB
/
all_in_one_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
73
74
package mssql
// nolint: lll
var allInOneARMTemplateBytes = []byte(`
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"tags": {
"type": "object"
}
},
"resources": [
{
"type": "Microsoft.Sql/servers",
"name": "{{ .serverName }}",
"apiVersion": "2015-05-01-preview",
"location": "{{.location}}",
"properties": {
"administratorLogin": "{{ .administratorLogin }}",
"administratorLoginPassword": "{{ .administratorLoginPassword }}",
"version": "{{.version}}"
},
"tags": "[parameters('tags')]",
"resources": [
{{ $root := . }}
{{range .firewallRules}}
{
"type": "firewallrules",
"name": "{{.name}}",
"apiVersion": "2014-04-01-preview",
"location": "{{$root.location}}",
"properties": {
"startIpAddress": "{{.startIPAddress}}",
"endIpAddress": "{{.endIPAddress}}"
},
"dependsOn": [
"Microsoft.Sql/servers/{{ $.serverName }}"
]
},
{{end}}
{
"type": "databases",
"name": "{{ .databaseName }}",
"apiVersion": "2017-10-01-preview",
"location": "{{$root.location}}",
"properties": {
"collation": "SQL_Latin1_General_CP1_CI_AS",
"maxSizeBytes": "{{ .maxSizeBytes }}"
},
"sku" : {
"name" : "{{ .sku }}",
"tier" : "{{ .tier }}"
},
"dependsOn": [
{{range .firewallRules}}
"Microsoft.Sql/servers/{{ $.serverName }}/firewallrules/{{.name}}",
{{end}}
"Microsoft.Sql/servers/{{ $.serverName }}"
],
"tags": "[parameters('tags')]"
}
]
}
],
"outputs": {
"fullyQualifiedDomainName": {
"type": "string",
"value": "[reference('{{ .serverName}}').fullyQualifiedDomainName]"
}
}
}
`)