LAMP/nested/db-postgres.json

98 строки
4.3 KiB
JSON

{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"lampCommon": {
"metadata": {
"description": "Common LAMP values"
},
"type": "object"
},
"lbPubIp": {
"metadata": {
"description": "Public IP address of the deployed load balancer"
},
"type": "string"
},
"ctlrPubIp": {
"metadata": {
"description": "Public IP address of the deployed controller VM"
},
"type": "string"
}
},
"resources": [
{
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"kind": "",
"location": "[parameters('lampCommon').location]",
"name": "[parameters('lampCommon').serverName]",
"properties": {
"administratorLogin": "[parameters('lampCommon').dbLogin]",
"administratorLoginPassword": "[parameters('lampCommon').dbLoginPassword]",
"sslEnforcement": "[parameters('lampCommon').sslEnforcement]",
"storageProfile": {
"storageMB": "[mul(parameters('lampCommon').mysqlPgresStgSizeGB, 1024)]",
"backupRetentionDays": "35",
"geoRedundantBackup": "Enabled"
},
"version": "[parameters('lampCommon').postgresVersion]"
},
"sku": {
"capacity": "[parameters('lampCommon').mysqlPgresVcores]",
"name": "[parameters('lampCommon').mysqlPgresSkuName]",
"tier": "[parameters('lampCommon').mysqlPgresSkuTier]",
"family": "[parameters('lampCommon').mysqlPgresSkuHwFamily]"
},
"resources": [
{
"apiVersion": "2017-12-01",
"dependsOn": [
"[concat('Microsoft.DBforPostgreSQL/servers/', parameters('lampCommon').serverName)]"
],
"location": "[parameters('lampCommon').location]",
"name": "postgres-firewall-allow-lb",
"properties": {
"startIpAddress": "[parameters('lbPubIp')]",
"endIpAddress": "[parameters('lbPubIp')]"
},
"type": "firewallRules"
},
{
"apiVersion": "2017-12-01",
"dependsOn": [
"[concat('Microsoft.DBforPostgreSQL/servers/', parameters('lampCommon').serverName)]"
],
"location": "[parameters('lampCommon').location]",
"name": "postgres-firewall-allow-ctlr",
"properties": {
"startIpAddress": "[parameters('ctlrPubIp')]",
"endIpAddress": "[parameters('ctlrPubIp')]"
},
"type": "firewallRules"
}
]
}
],
"outputs": {
"dbFQDN": {
"type": "string",
"value": "[reference(parameters('lampCommon').serverName).fullyQualifiedDomainName]"
}
},
"variables": {
"documentation1": "This sub-template creates a postgresql server. It expects certain values in the 'common' datastructure.",
"documentation10": " serverName - Postgresql server name",
"documentation11": " postgresVersion - Postgresql version",
"documentation2": " administratorLogin - postgresql admin username",
"documentation3": " administratorLoginPassword - postgresql admin password",
"documentation4": " location - Postgresql server location",
"documentation5": " mysqlPgresVcores - Postgresql database trasaction units",
"documentation7": " mysqlPgresSkuName - Postgresql sku name",
"documentation8": " mysqlPgresStgSizeGB - Postgresql sku size in mb",
"documentation9": " mysqlPgresSkuTier - Postgresql sku tier",
"documentationA": " mysqlPgresSkuHwFamily - Mysql sku hardware family"
}
}