-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdatabase.json
116 lines (114 loc) · 3.65 KB
/
database.json
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"databaseServerName": {
"type": "string"
},
"databaseName": {
"type": "string"
},
"databaseUsername": {
"type": "string"
},
"databasePassword": {
"type": "securestring"
},
"alertEmailAddress": {
"type": "string"
},
"postgresSku": {
"type": "object",
"defaultValue": {
"name": "GP_Gen5_2",
"tier": "GeneralPurpose",
"size": 5120,
"family": "Gen5",
"capacity": 2
}
}
},
"variables": {
"platformBuildingBlocksDeploymentUrlBase": "https://raw.githubusercontent.com/DFE-Digital/bat-platform-building-blocks/master/templates/",
"databaseDeploymentName": "[concat(deployment().name, '-database')]",
"securityAlertPolicyName": "[concat(parameters('databaseServerName'), '-DefaultSecurityAlert')]"
},
"resources": [
{
"name": "[parameters('databaseServerName')]",
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"location": "[resourceGroup().location]",
"tags": {},
"sku": "[parameters('postgresSku')]",
"properties": {
"storageProfile": {
"storageMB": "[parameters('postgresSku').size]",
"backupRetentionDays": 35,
"geoRedundantBackup": "disabled",
"storageAutoGrow": "disabled"
},
"version": "9.6",
"sslEnforcement": "Enabled",
"administratorLogin": "[parameters('databaseUsername')]",
"administratorLoginPassword": "[parameters('databasePassword')]"
},
"resources": [
{
"name": "[variables('securityAlertPolicyName')]",
"type": "securityAlertPolicies",
"apiVersion": "2017-12-01",
"properties": {
"state": "Enabled",
"disabledAlerts": [],
"emailAddresses": ["[parameters('alertEmailAddress')]"],
"emailAccountAdmins": false,
"retentionDays": 90
},
"dependsOn": ["[parameters('databaseServerName')]"]
}
]
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2017-05-10",
"name": "[variables('databaseDeploymentName')]",
"dependsOn": ["[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('databaseServerName'))]"],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(variables('platformBuildingBlocksDeploymentUrlBase'), 'postgresql-database.json')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"serverName": {
"value": "[parameters('databaseServerName')]"
},
"databaseName": {
"value": "[parameters('databaseName')]"
}
}
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/configurations",
"apiVersion": "2017-12-01",
"name": "[concat(parameters('databaseServerName'), '/log_disconnections')]",
"dependsOn": ["[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('databaseServerName'))]"],
"properties": {
"value": "ON",
"source": "user-override"
}
}
],
"outputs": {
"databaseServerId": {
"type": "string",
"value": "[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('databaseServerName'))]"
},
"databaseServerFullyQualifiedDomainName": {
"type": "string",
"value": "[reference(resourceId('Microsoft.DBforPostgreSQL/servers', parameters('databaseServerName'))).fullyQualifiedDomainName]"
}
}
}