зеркало из
1
0
Форкнуть 0
PSRule.Rules.Azure/docs/examples-postgresql.json

117 строки
3.4 KiB
JSON

{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.25.53.49325",
"templateHash": "1186622257126358354"
}
},
"parameters": {
"name": {
"type": "string",
"metadata": {
"description": "The name of the resource."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "The location resources will be deployed."
}
},
"localAdministrator": {
"type": "string",
"metadata": {
"description": "The login for an administrator."
}
},
"localAdministratorPassword": {
"type": "securestring",
"metadata": {
"description": "A default administrator password."
}
},
"loginObjectId": {
"type": "string",
"metadata": {
"description": "The object GUID for an administrator account."
}
}
},
"resources": [
{
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"properties": {
"createMode": "Default",
"administratorLogin": "[parameters('localAdministrator')]",
"administratorLoginPassword": "[parameters('localAdministratorPassword')]",
"minimalTlsVersion": "TLS1_2",
"sslEnforcement": "Enabled",
"publicNetworkAccess": "Disabled",
"version": "11"
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers/administrators",
"apiVersion": "2017-12-01",
"name": "[format('{0}/{1}', parameters('name'), 'activeDirectory')]",
"properties": {
"administratorType": "ActiveDirectory",
"login": "[parameters('localAdministrator')]",
"sid": "[parameters('loginObjectId')]",
"tenantId": "[tenant().tenantId]"
},
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers', parameters('name'))]"
]
},
{
"type": "Microsoft.DBforPostgreSQL/flexibleServers",
"apiVersion": "2022-12-01",
"name": "[parameters('name')]",
"location": "[parameters('location')]",
"sku": {
"name": "Standard_D2ds_v4",
"tier": "GeneralPurpose"
},
"properties": {
"createMode": "Default",
"authConfig": {
"activeDirectoryAuth": "Enabled",
"passwordAuth": "Disabled",
"tenantId": "[tenant().tenantId]"
},
"version": "14",
"storage": {
"storageSizeGB": 32
},
"backup": {
"backupRetentionDays": 7,
"geoRedundantBackup": "Enabled"
},
"highAvailability": {
"mode": "ZoneRedundant"
}
}
},
{
"type": "Microsoft.DBforPostgreSQL/flexibleServers/administrators",
"apiVersion": "2022-12-01",
"name": "[format('{0}/{1}', parameters('name'), parameters('loginObjectId'))]",
"properties": {
"principalType": "ServicePrincipal",
"principalName": "[parameters('localAdministrator')]",
"tenantId": "[tenant().tenantId]"
},
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/flexibleServers', parameters('name'))]"
]
}
]
}