Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Bicep resource definition
The serverGroupsv2 resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.DBforPostgreSQL/serverGroupsv2 resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.DBforPostgreSQL/serverGroupsv2@2023-03-02-preview' = {
scope: resourceSymbolicName or scope
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {}
}
}
location: 'string'
name: 'string'
properties: {
administratorLoginPassword: 'string'
authConfig: {
activeDirectoryAuth: 'string'
passwordAuth: 'string'
}
citusVersion: 'string'
coordinatorEnablePublicIpAccess: bool
coordinatorServerEdition: 'string'
coordinatorStorageQuotaInMb: int
coordinatorVCores: int
databaseName: 'string'
dataEncryption: {
primaryKeyUri: 'string'
primaryUserAssignedIdentityId: 'string'
type: 'string'
}
enableGeoBackup: bool
enableHa: bool
enableShardsOnCoordinator: bool
maintenanceWindow: {
customWindow: 'string'
dayOfWeek: int
startHour: int
startMinute: int
}
nodeCount: int
nodeEnablePublicIpAccess: bool
nodeServerEdition: 'string'
nodeStorageQuotaInMb: int
nodeVCores: int
pointInTimeUTC: 'string'
postgresqlVersion: 'string'
preferredPrimaryZone: 'string'
sourceLocation: 'string'
sourceResourceId: 'string'
}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.DBforPostgreSQL/serverGroupsv2
| Name | Description | Value |
|---|---|---|
| identity | Describes the identity of the cluster. | IdentityProperties |
| location | The geo-location where the resource lives | string (required) |
| name | The resource name | string Constraints: Min length = 3 Max length = 40 Pattern = ^(?![0-9]+$)(?!-)[a-z0-9-]{3,40}(?<!-)$ (required) |
| properties | Properties of the cluster. | ClusterProperties |
| scope | Use when creating a resource at a scope that is different than the deployment scope. | Set this property to the symbolic name of a resource to apply the extension resource. |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
AuthConfig
| Name | Description | Value |
|---|---|---|
| activeDirectoryAuth | 'disabled' 'enabled' |
|
| passwordAuth | 'disabled' 'enabled' |
ClusterProperties
| Name | Description | Value |
|---|---|---|
| administratorLoginPassword | The password of the administrator login. Required for creation. | string Constraints: Sensitive value. Pass in as a secure parameter. |
| authConfig | Authentication configuration of a cluster. | AuthConfig |
| citusVersion | The Citus extension version on all cluster servers. | string |
| coordinatorEnablePublicIpAccess | If public access is enabled on coordinator. | bool |
| coordinatorServerEdition | The edition of a coordinator server (default: GeneralPurpose). Required for creation. | string |
| coordinatorStorageQuotaInMb | The storage of a server in MB. Required for creation. See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| coordinatorVCores | The vCores count of a server (max: 96). Required for creation. See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| databaseName | The database name of the cluster. Only one database per cluster is supported. | string |
| dataEncryption | The data encryption properties of a cluster. | DataEncryption |
| enableGeoBackup | If cluster backup is stored in another Azure region in addition to the copy of the backup stored in the cluster's region. Enabled only at the time of cluster creation. | bool |
| enableHa | If high availability (HA) is enabled or not for the cluster. | bool |
| enableShardsOnCoordinator | If distributed tables are placed on coordinator or not. Should be set to 'true' on single node clusters. Requires shard rebalancing after value is changed. | bool |
| maintenanceWindow | Maintenance window of a cluster. | MaintenanceWindow |
| nodeCount | Worker node count of the cluster. When node count is 0, it represents a single node configuration with the ability to create distributed tables on that node. 2 or more worker nodes represent multi-node configuration. Node count value cannot be 1. Required for creation. | int |
| nodeEnablePublicIpAccess | If public access is enabled on worker nodes. | bool |
| nodeServerEdition | The edition of a node server (default: MemoryOptimized). | string |
| nodeStorageQuotaInMb | The storage in MB on each worker node. See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| nodeVCores | The compute in vCores on each worker node (max: 104). See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| pointInTimeUTC | Date and time in UTC (ISO8601 format) for cluster restore. | string |
| postgresqlVersion | The major PostgreSQL version on all cluster servers. | string |
| preferredPrimaryZone | Preferred primary availability zone (AZ) for all cluster servers. | string |
| sourceLocation | The Azure region of source cluster for read replica clusters. | string |
| sourceResourceId | The resource id of source cluster for read replica clusters. | string |
DataEncryption
| Name | Description | Value |
|---|---|---|
| primaryKeyUri | URI for the key in keyvault for data encryption of the primary server. | string |
| primaryUserAssignedIdentityId | Resource Id for the User assigned identity to be used for data encryption of the primary server. | string |
| type | 'AzureKeyVault' 'SystemAssigned' |
IdentityProperties
| Name | Description | Value |
|---|---|---|
| type | 'SystemAssigned' 'UserAssigned' |
|
| userAssignedIdentities | The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. | IdentityPropertiesUserAssignedIdentities |
IdentityPropertiesUserAssignedIdentities
| Name | Description | Value |
|---|
MaintenanceWindow
| Name | Description | Value |
|---|---|---|
| customWindow | Indicates whether custom maintenance window is enabled or not. | string |
| dayOfWeek | Preferred day of the week for maintenance window. | int |
| startHour | Start hour within preferred day of the week for maintenance window. | int |
| startMinute | Start minute within the start hour for maintenance window. | int |
TrackedResourceTags
| Name | Description | Value |
|---|
UserAssignedIdentity
| Name | Description | Value |
|---|
ARM template resource definition
The serverGroupsv2 resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.DBforPostgreSQL/serverGroupsv2 resource, add the following JSON to your template.
{
"type": "Microsoft.DBforPostgreSQL/serverGroupsv2",
"apiVersion": "2023-03-02-preview",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
}
}
},
"location": "string",
"properties": {
"administratorLoginPassword": "string",
"authConfig": {
"activeDirectoryAuth": "string",
"passwordAuth": "string"
},
"citusVersion": "string",
"coordinatorEnablePublicIpAccess": "bool",
"coordinatorServerEdition": "string",
"coordinatorStorageQuotaInMb": "int",
"coordinatorVCores": "int",
"databaseName": "string",
"dataEncryption": {
"primaryKeyUri": "string",
"primaryUserAssignedIdentityId": "string",
"type": "string"
},
"enableGeoBackup": "bool",
"enableHa": "bool",
"enableShardsOnCoordinator": "bool",
"maintenanceWindow": {
"customWindow": "string",
"dayOfWeek": "int",
"startHour": "int",
"startMinute": "int"
},
"nodeCount": "int",
"nodeEnablePublicIpAccess": "bool",
"nodeServerEdition": "string",
"nodeStorageQuotaInMb": "int",
"nodeVCores": "int",
"pointInTimeUTC": "string",
"postgresqlVersion": "string",
"preferredPrimaryZone": "string",
"sourceLocation": "string",
"sourceResourceId": "string"
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.DBforPostgreSQL/serverGroupsv2
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2023-03-02-preview' |
| identity | Describes the identity of the cluster. | IdentityProperties |
| location | The geo-location where the resource lives | string (required) |
| name | The resource name | string Constraints: Min length = 3 Max length = 40 Pattern = ^(?![0-9]+$)(?!-)[a-z0-9-]{3,40}(?<!-)$ (required) |
| properties | Properties of the cluster. | ClusterProperties |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
| type | The resource type | 'Microsoft.DBforPostgreSQL/serverGroupsv2' |
AuthConfig
| Name | Description | Value |
|---|---|---|
| activeDirectoryAuth | 'disabled' 'enabled' |
|
| passwordAuth | 'disabled' 'enabled' |
ClusterProperties
| Name | Description | Value |
|---|---|---|
| administratorLoginPassword | The password of the administrator login. Required for creation. | string Constraints: Sensitive value. Pass in as a secure parameter. |
| authConfig | Authentication configuration of a cluster. | AuthConfig |
| citusVersion | The Citus extension version on all cluster servers. | string |
| coordinatorEnablePublicIpAccess | If public access is enabled on coordinator. | bool |
| coordinatorServerEdition | The edition of a coordinator server (default: GeneralPurpose). Required for creation. | string |
| coordinatorStorageQuotaInMb | The storage of a server in MB. Required for creation. See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| coordinatorVCores | The vCores count of a server (max: 96). Required for creation. See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| databaseName | The database name of the cluster. Only one database per cluster is supported. | string |
| dataEncryption | The data encryption properties of a cluster. | DataEncryption |
| enableGeoBackup | If cluster backup is stored in another Azure region in addition to the copy of the backup stored in the cluster's region. Enabled only at the time of cluster creation. | bool |
| enableHa | If high availability (HA) is enabled or not for the cluster. | bool |
| enableShardsOnCoordinator | If distributed tables are placed on coordinator or not. Should be set to 'true' on single node clusters. Requires shard rebalancing after value is changed. | bool |
| maintenanceWindow | Maintenance window of a cluster. | MaintenanceWindow |
| nodeCount | Worker node count of the cluster. When node count is 0, it represents a single node configuration with the ability to create distributed tables on that node. 2 or more worker nodes represent multi-node configuration. Node count value cannot be 1. Required for creation. | int |
| nodeEnablePublicIpAccess | If public access is enabled on worker nodes. | bool |
| nodeServerEdition | The edition of a node server (default: MemoryOptimized). | string |
| nodeStorageQuotaInMb | The storage in MB on each worker node. See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| nodeVCores | The compute in vCores on each worker node (max: 104). See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| pointInTimeUTC | Date and time in UTC (ISO8601 format) for cluster restore. | string |
| postgresqlVersion | The major PostgreSQL version on all cluster servers. | string |
| preferredPrimaryZone | Preferred primary availability zone (AZ) for all cluster servers. | string |
| sourceLocation | The Azure region of source cluster for read replica clusters. | string |
| sourceResourceId | The resource id of source cluster for read replica clusters. | string |
DataEncryption
| Name | Description | Value |
|---|---|---|
| primaryKeyUri | URI for the key in keyvault for data encryption of the primary server. | string |
| primaryUserAssignedIdentityId | Resource Id for the User assigned identity to be used for data encryption of the primary server. | string |
| type | 'AzureKeyVault' 'SystemAssigned' |
IdentityProperties
| Name | Description | Value |
|---|---|---|
| type | 'SystemAssigned' 'UserAssigned' |
|
| userAssignedIdentities | The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. | IdentityPropertiesUserAssignedIdentities |
IdentityPropertiesUserAssignedIdentities
| Name | Description | Value |
|---|
MaintenanceWindow
| Name | Description | Value |
|---|---|---|
| customWindow | Indicates whether custom maintenance window is enabled or not. | string |
| dayOfWeek | Preferred day of the week for maintenance window. | int |
| startHour | Start hour within preferred day of the week for maintenance window. | int |
| startMinute | Start minute within the start hour for maintenance window. | int |
TrackedResourceTags
| Name | Description | Value |
|---|
UserAssignedIdentity
| Name | Description | Value |
|---|
Usage Examples
Terraform (AzAPI provider) resource definition
The serverGroupsv2 resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.DBforPostgreSQL/serverGroupsv2 resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.DBforPostgreSQL/serverGroupsv2@2023-03-02-preview"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
administratorLoginPassword = "string"
authConfig = {
activeDirectoryAuth = "string"
passwordAuth = "string"
}
citusVersion = "string"
coordinatorEnablePublicIpAccess = bool
coordinatorServerEdition = "string"
coordinatorStorageQuotaInMb = int
coordinatorVCores = int
databaseName = "string"
dataEncryption = {
primaryKeyUri = "string"
primaryUserAssignedIdentityId = "string"
type = "string"
}
enableGeoBackup = bool
enableHa = bool
enableShardsOnCoordinator = bool
maintenanceWindow = {
customWindow = "string"
dayOfWeek = int
startHour = int
startMinute = int
}
nodeCount = int
nodeEnablePublicIpAccess = bool
nodeServerEdition = "string"
nodeStorageQuotaInMb = int
nodeVCores = int
pointInTimeUTC = "string"
postgresqlVersion = "string"
preferredPrimaryZone = "string"
sourceLocation = "string"
sourceResourceId = "string"
}
}
}
Property Values
Microsoft.DBforPostgreSQL/serverGroupsv2
| Name | Description | Value |
|---|---|---|
| identity | Describes the identity of the cluster. | IdentityProperties |
| location | The geo-location where the resource lives | string (required) |
| name | The resource name | string Constraints: Min length = 3 Max length = 40 Pattern = ^(?![0-9]+$)(?!-)[a-z0-9-]{3,40}(?<!-)$ (required) |
| parent_id | The ID of the resource to apply this extension resource to. | string (required) |
| properties | Properties of the cluster. | ClusterProperties |
| tags | Resource tags | Dictionary of tag names and values. |
| type | The resource type | "Microsoft.DBforPostgreSQL/serverGroupsv2@2023-03-02-preview" |
AuthConfig
| Name | Description | Value |
|---|---|---|
| activeDirectoryAuth | 'disabled' 'enabled' |
|
| passwordAuth | 'disabled' 'enabled' |
ClusterProperties
| Name | Description | Value |
|---|---|---|
| administratorLoginPassword | The password of the administrator login. Required for creation. | string Constraints: Sensitive value. Pass in as a secure parameter. |
| authConfig | Authentication configuration of a cluster. | AuthConfig |
| citusVersion | The Citus extension version on all cluster servers. | string |
| coordinatorEnablePublicIpAccess | If public access is enabled on coordinator. | bool |
| coordinatorServerEdition | The edition of a coordinator server (default: GeneralPurpose). Required for creation. | string |
| coordinatorStorageQuotaInMb | The storage of a server in MB. Required for creation. See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| coordinatorVCores | The vCores count of a server (max: 96). Required for creation. See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| databaseName | The database name of the cluster. Only one database per cluster is supported. | string |
| dataEncryption | The data encryption properties of a cluster. | DataEncryption |
| enableGeoBackup | If cluster backup is stored in another Azure region in addition to the copy of the backup stored in the cluster's region. Enabled only at the time of cluster creation. | bool |
| enableHa | If high availability (HA) is enabled or not for the cluster. | bool |
| enableShardsOnCoordinator | If distributed tables are placed on coordinator or not. Should be set to 'true' on single node clusters. Requires shard rebalancing after value is changed. | bool |
| maintenanceWindow | Maintenance window of a cluster. | MaintenanceWindow |
| nodeCount | Worker node count of the cluster. When node count is 0, it represents a single node configuration with the ability to create distributed tables on that node. 2 or more worker nodes represent multi-node configuration. Node count value cannot be 1. Required for creation. | int |
| nodeEnablePublicIpAccess | If public access is enabled on worker nodes. | bool |
| nodeServerEdition | The edition of a node server (default: MemoryOptimized). | string |
| nodeStorageQuotaInMb | The storage in MB on each worker node. See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| nodeVCores | The compute in vCores on each worker node (max: 104). See /azure/cosmos-db/postgresql/resources-compute for more information. | int |
| pointInTimeUTC | Date and time in UTC (ISO8601 format) for cluster restore. | string |
| postgresqlVersion | The major PostgreSQL version on all cluster servers. | string |
| preferredPrimaryZone | Preferred primary availability zone (AZ) for all cluster servers. | string |
| sourceLocation | The Azure region of source cluster for read replica clusters. | string |
| sourceResourceId | The resource id of source cluster for read replica clusters. | string |
DataEncryption
| Name | Description | Value |
|---|---|---|
| primaryKeyUri | URI for the key in keyvault for data encryption of the primary server. | string |
| primaryUserAssignedIdentityId | Resource Id for the User assigned identity to be used for data encryption of the primary server. | string |
| type | 'AzureKeyVault' 'SystemAssigned' |
IdentityProperties
| Name | Description | Value |
|---|---|---|
| type | 'SystemAssigned' 'UserAssigned' |
|
| userAssignedIdentities | The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. | IdentityPropertiesUserAssignedIdentities |
IdentityPropertiesUserAssignedIdentities
| Name | Description | Value |
|---|
MaintenanceWindow
| Name | Description | Value |
|---|---|---|
| customWindow | Indicates whether custom maintenance window is enabled or not. | string |
| dayOfWeek | Preferred day of the week for maintenance window. | int |
| startHour | Start hour within preferred day of the week for maintenance window. | int |
| startMinute | Start minute within the start hour for maintenance window. | int |
TrackedResourceTags
| Name | Description | Value |
|---|
UserAssignedIdentity
| Name | Description | Value |
|---|
Usage Examples
Terraform Samples
A basic example of deploying Azure Cosmos DB for PostgreSQL Cluster.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
variable "administrator_login_password" {
type = string
description = "The administrator login password for the PostgreSQL server group"
sensitive = true
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "serverGroupsv2" {
type = "Microsoft.DBforPostgreSQL/serverGroupsv2@2022-11-08"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
administratorLoginPassword = var.administrator_login_password
coordinatorEnablePublicIpAccess = true
coordinatorServerEdition = "GeneralPurpose"
coordinatorStorageQuotaInMb = 131072
coordinatorVCores = 2
enableHa = false
nodeCount = 0
nodeEnablePublicIpAccess = false
nodeServerEdition = "MemoryOptimized"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}