This repository has been archived by the owner on Jul 6, 2022. It is now read-only.
/
all_in_one_arm_template.go
84 lines (83 loc) · 2.1 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
75
76
77
78
79
80
81
82
83
84
package mysql
// 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"
}
},
"variables": {
"DBforMySQLapiVersion": "2017-12-01"
},
"resources": [
{
"apiVersion": "[variables('DBforMySQLapiVersion')]",
"kind": "",
"location": "{{.location}}",
"name": "{{ .serverName }}",
"properties": {
"version": "{{.version}}",
"administratorLogin": "{{ .administratorLogin }}",
"administratorLoginPassword": "{{ .administratorLoginPassword }}",
"storageProfile": {
"storageMB": {{.storage}},
{{ if .geoRedundantBackup }}
"geoRedundantBackup": "Enabled",
{{ end }}
"backupRetentionDays": {{.backupRetention}}
},
"sslEnforcement": "{{ .sslEnforcement }}"
},
"sku": {
"name": "{{.sku}}",
"tier": "{{.tier}}",
"capacity": "{{.cores}}",
"size": "{{.storage}}",
"family": "{{.family}}"
},
"type": "Microsoft.DBforMySQL/servers",
"tags": "[parameters('tags')]",
"resources": [
{{ $root := . }}
{{range .firewallRules}}
{
"type": "firewallrules",
"apiVersion": "[variables('DBforMySQLapiVersion')]",
"dependsOn": [
"Microsoft.DBforMySQL/servers/{{ $.serverName }}"
],
"location": "{{$root.location}}",
"name": "{{.name}}",
"properties": {
"startIpAddress": "{{.startIPAddress}}",
"endIpAddress": "{{.endIPAddress}}"
}
},
{{end}}
{
"apiVersion": "[variables('DBforMySQLapiVersion')]",
"name": "{{ .databaseName }}",
"type": "databases",
"location": "{{$root.location}}",
"dependsOn": [
{{range $.firewallRules}}
"Microsoft.DBforMySQL/servers/{{ $.serverName }}/firewallrules/{{.name}}",
{{end}}
"Microsoft.DBforMySQL/servers/{{ $.serverName }}"
],
"properties": {}
}
]
}
],
"outputs": {
"fullyQualifiedDomainName": {
"type": "string",
"value": "[reference('{{ .serverName }}').fullyQualifiedDomainName]"
}
}
}
`)